""" Distribution Fee ETL stuff. For things too insignificant to be in its own module. """ from collections import namedtuple # status will be an immutable object (namedtuple) that has all statuses # accessible as attributes of the same exact name. So to use # _status_names['FOO_BAR'], you should use status.FOO_BAR _status_names = [ 'STARTED', 'LOADED_CONTRACT_IDS', 'TEMP_TABLES_CREATED', 'DIST_FEE_REGULAR_LOADED', 'DIST_FEE_TERRITORY_LOADED', 'DISTRIBUTION_FEE_TABLE_UPDATED', 'TEMP_TABLES_DROPPED', 'COMPLETED', 'CLIENT_AMOUNT_INSERTED'] _Status = namedtuple('Status', _status_names) status = _Status(**dict(zip(_status_names, _status_names)))