Skip to content

Instantly share code, notes, and snippets.

@ottomata
Created June 8, 2020 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ottomata/828f08a145a2744612b0ba44b38dbc73 to your computer and use it in GitHub Desktop.
Save ottomata/828f08a145a2744612b0ba44b38dbc73 to your computer and use it in GitHub Desktop.
# schedule be keys.txt
committed_id
money_for_baths
# OR
keys = ['committee_id', 'money_for_baths']
transformed_list_of_dict =
[
{commitee_id: 123, otherthing: woohoo, money_for_baths: 500},
...
]
rows = []
for dict_entry in transformed_list_of_dict:
# entry will be each dict in the list
# {commitee_id: 123, oth ...
# ...
row = []
for key in keys:
# key will be committee_id, then money_for_baths
row.append(dict_entry[key])
rows.append(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment