Yes, the mappings just provide an interface between the parameters that a user provides, and the values that the internal functions expect. Is it necessary? Absolutely not.
We can't say for certain what the actual reason was for this design choice. There isn't anything particularly complex in any of the options, or some other convenience like expanding acronyms where required. The constants and mapping below probably provide the best hint (copied verbatim from https://github.com/dhan-oss/DhanHQ-py/blob/main/src/dhanhq/dhanhq.py and https://github.com/TradeHull/Dhan-Tradehull/blob/3753bf42de1918236288555e1f753285c5c798ec/Dhan_Tradehull.py#L171C1-L172C1):
NSE = 'NSE_EQ'
BSE = 'BSE_EQ'
CUR = 'NSE_CURRENCY'
MCX = 'MCX_COMM'
FNO = 'NSE_FNO'
NSE_FNO = 'NSE_FNO'
BSE_FNO = 'BSE_FNO'
INDEX = 'IDX_I' 
script_exchange = {
    "NSE":self.Dhan.NSE, 
    "NFO":self.Dhan.FNO, 
    "BFO":"BSE_FNO", 
    "CUR": self.Dhan.CUR, 
    "BSE":self.Dhan.BSE, 
    "MCX":self.Dhan.MCX
}
The user is expected to provide one of the keys in script_exchange to select which exchange they want to make their order on. Rather than expect a user to input NSE_EQ, which is rather unintuitive, they just enter NSE, which is much more familiar. That being said, this code is pretty low quality. The BFO key doesn't use the Dhan.BSE_FNO value, despite it being available. These values should also be created as values in an Enum or some other class, rather than just as constants in the top-level class. All this is to say, don't look at this repository too hard for tips or ideas on good practices.