-
-
Save jdyke/453b02fc30b7925dfda30e7f4b385b8b to your computer and use it in GitHub Desktop.
write_csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def write_csv(api_keys): | |
headers = unique_headers(api_keys) | |
with open('keys.csv', 'w') as key_csv: | |
csv_writer = csv.writer(key_csv) | |
csv_writer.writerow(headers) | |
# Create our CSV rows using our API Key data. | |
for key in api_keys: | |
current_row = [] | |
for field in headers: | |
current_row.append(key.get(field)) | |
csv_writer.writerow(current_row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment