I am trying to create a Config class which will hold all my static values for an etl im developing to call them neatly like this reducing variables loaded and keeping the lower part of my script clean of parameter objects
Config.S3.bucket >> 'CYBERPUNK'
Config.S3.partition >> '2042'
code:
class Config:
class DT:
today_str = '2077' #str(date.today())
yesterday_str = '2042' #str(date.today() - timedelta(days=1))
class S3:
bucket = 'CYBERPUNK'
partition = Config.DT.yesterday_str #2042 <-- the problem
How do I load this class? it seems that because i'm referencing to the parent class and its subclass i am getting an error because i have not yet loaded the class.
NameError: name 'DT' is not defined
Can anyone help me pull this off? I've been reading on python inheritances, static methods class methods and multilevel classess but none seem to be able to give me the solution.I tried adding def init aswell but couldn't picture how to make it work