Has few .xlsx files storing the data I refer to. Added them up to Enum Class. Within the source code file I need to obtain some properties of the members of this Enum class, like file name here. Would the below code serve the problem well or there is an avenue to rework it in accordance with the best practices? Thank you!
from enum import Enum
class Data(Enum):
TYPE_A = 1
TYPE_B = 2
TYPE_C = 3
TYPE_D = 4
TYPE_E = 5
TYPE_F = 6
TYPE_G = 7
@property
def file_name(cls):
FILE_NAMES_DATA = (
'TYPE_A.xlsx',
'TYPE_B.xlsx',
'TYPE_C.xlsx',
'TYPE_D.xlsx',
'TYPE_E.xlsx',
'TYPE_F.xlsx',
'TYPE_G.xlsx',
)
MAP_DATA = {
member: file_name for member, file_name in zip(Data, FILE_NAMES_DATA)
}
return MAP_DATA[cls]