Skip to content

Instantly share code, notes, and snippets.

@gmelikov
Created May 14, 2020 13:24
Show Gist options
  • Save gmelikov/6653fafe70fdd07a76f4bb0aacd35892 to your computer and use it in GitHub Desktop.
Save gmelikov/6653fafe70fdd07a76f4bb0aacd35892 to your computer and use it in GitHub Desktop.
Convert trello json into text
#!/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