""" Projections 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', 'DROP_FILE_ARCHIVED', 'ANCHOR_DATE_DETERMINED', 'ANCHOR_DATE_UNDETERMINED', 'TEMP_TABLE_CREATED', 'DATA_DOWNLOADED_TO_TEMP_TABLE', 'TEMP_TABLE_MADE_LIVE', 'TEMP_TABLE_DROPPED', 'INGESTED'] _Status = namedtuple('Status', _status_names) status = _Status(**dict(zip(_status_names, _status_names)))