""" Cable 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', 'TEMP_TABLE_CREATED', 'RAW_UNLOADED', 'CALCULATION_NOT_NEEDED', 'CALCULATION_COMPLETED', 'TEMP_TABLE_INSERTED', 'TEMP_TABLE_MADE_LIVE', 'COMPLETED'] _Status = namedtuple('Status', _status_names) status = _Status(**dict(zip(_status_names, _status_names)))