""" 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', 'DOWNLOADED_FROM_FTP', 'VALIDATED_SOURCE_FILES', 'UPLOADED_RAW_TO_S3_ARCHIVES', 'CLEANED_UP_LOCAL_RAW', 'CREATED_TEMP_RAW_TABLE', 'INSERTED_TO_TEMP_RAW_TABLE', 'INSERTED_TO_RAW_TABLE', 'COMPLETED'] _Status = namedtuple('Status', _status_names) status = _Status(**dict(zip(_status_names, _status_names)))