Created
March 8, 2023 19:16
-
-
Save fhk/dff91ed1536a6db7fea7f8ed72941c3e to your computer and use it in GitHub Desktop.
Yay JSON export isn't premium but csv is. Lets just move some data...
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
import sys | |
import json | |
import csv | |
def main(): | |
input_json = sys.argv[1] | |
output_csv_data = [['name', 'lastdate', 'desc', 'shorturl']] | |
with open(input_json, mode='r') as ijson: | |
data = json.load(ijson) | |
cards = data['cards'] | |
for c in cards: | |
output_csv_data.append([ | |
c['name'], | |
c['dateLastActivity'], | |
c['desc'], | |
c['shortUrl']]) | |
with open('trello.csv', mode='w') as output: | |
writer = csv.writer(output) | |
writer.writerows(output_csv_data) | |
if __name__ == "__main__": | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment