Created
May 14, 2020 13:24
-
-
Save gmelikov/6653fafe70fdd07a76f4bb0aacd35892 to your computer and use it in GitHub Desktop.
Convert trello json into text
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
#!/usr/bin/env python3 | |
import json | |
import sys | |
def main(): | |
with open(sys.argv[1]) as infile: | |
data = json.load(infile) | |
lists = {} | |
for l in data['lists']: | |
if l['closed']: | |
continue | |
lists[l['id']] = l | |
lists[l['id']]['fullCards'] = [] | |
for i in data['cards']: | |
if i['idList'] in lists: | |
lists[i['idList']]['fullCards'].append(i) | |
for _, l in lists.items(): | |
print('{}:'.format(l['name'])) | |
for i in l['fullCards']: | |
if i['closed']: | |
continue | |
print('- {}'.format(i['name'])) | |
print('') | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment