Parse Trello export JSON file using Python script to create Markdown files and import these into Joplin an open-source note-taking app.
Create a simple Python script to parse Trello export file.
#/usr/bin/env python3 # Read Trello JSON file to export data into text files # imports import json import argparse import os, tempfile # parse arguments arg_parser = argparse.ArgumentParser("trello_export") arg_parser.add_argument("json_file", help="Trello JSON file", type=argparse.FileType(';r';, encoding=';UTF-8';)) args = arg_parser.parse_args() # create temporary directory temp_directory = tempfile.mkdtemp() # load JSON data json_data = json.load(args.json_file) # display basic details like "Temporary directory ';/tmp/tmpauuo95ei'; for board ';Ideas';" print("Temporary directory ';{}'; for board ';{}';".format(temp_directory, json_data["name"])) # Create board directory board_path = os.path.join(temp_directory, json_data["id"]) os.makedirs(board_path) # store board name f = open(os.path.join(board_path, "board_name.md"), ';w';); f.write(json_data["name"]); f.close() # store cards (name, desc, comments) for card in json_data["cards"]: # parse only active cards if card["closed"] != True: # create list directory list_path = os.path.join(board_path, card["idList"]) if not os.path.exists(os.path.join(list_path,"list_name.md")): if not os.path.exists(list_path): os.makedirs(list_path) for list in json_data["lists"]: if list["id"] == card["idList"]: f = open(os.path.join(list_path, "list_name.md"), ';w';); f.write(list["name"]); f.close() break # create card file f = open(os.path.join(list_path, "{}.md".format(card["id"])), "w"); f.write("# {}\n\n".format(card["name"])) f.write("## description\n") f.write(card["desc"]) if card["badges"]["comments"] > : for comment in json_data["actions"]: if comment["type"] == "commentCard": if comment["data"]["card"]["id"] == card["id"]: f.write("\n\n## comment {}\n{}".format(comment["id"], comment["data"]["text"])) f.close()
Download JSON export file.

Inspect downloaded JSON file.
$ jq . Oyw0z3uk.json
{ "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "desc": "", "descData": null, "closed": false, "dateClosed": null, "idOrganization": "60504c6a15fb9b547720893a", "idEnterprise": null, "limits": { "attachments": { "perBoard": { "status": "ok", "disableAt": 36000, "warnAt": 28800 }, "perCard": { "status": "ok", "disableAt": 1000, "warnAt": 800 } }, "boards": { "totalMembersPerBoard": { "status": "ok", "disableAt": 1600, "warnAt": 1280 }, "totalAccessRequestsPerBoard": { "status": "ok", "disableAt": 4000, "warnAt": 3200 } }, "cards": { "openPerBoard": { "status": "ok", "disableAt": 5000, "warnAt": 4000 }, "openPerList": { "status": "ok", "disableAt": 5000, "warnAt": 4000 }, "totalPerBoard": { "status": "ok", "disableAt": 2000000, "warnAt": 1600000 }, "totalPerList": { "status": "ok", "disableAt": 1000000, "warnAt": 800000 } }, "checklists": { "perBoard": { "status": "ok", "disableAt": 1800000, "warnAt": 1440000 }, "perCard": { "status": "ok", "disableAt": 500, "warnAt": 400 } }, "checkItems": { "perChecklist": { "status": "ok", "disableAt": 200, "warnAt": 160 } }, "customFields": { "perBoard": { "status": "ok", "disableAt": 50, "warnAt": 40 } }, "customFieldOptions": { "perField": { "status": "ok", "disableAt": 50, "warnAt": 40 } }, "labels": { "perBoard": { "status": "ok", "disableAt": 1000, "warnAt": 800 } }, "lists": { "openPerBoard": { "status": "ok", "disableAt": 500, "warnAt": 400 }, "totalPerBoard": { "status": "ok", "disableAt": 3000, "warnAt": 2400 } }, "stickers": { "perCard": { "status": "ok", "disableAt": 70, "warnAt": 56 } }, "reactions": { "perAction": { "status": "ok", "disableAt": 900, "warnAt": 720 }, "uniquePerAction": { "status": "ok", "disableAt": 17, "warnAt": 14 } } }, "pinned": false, "starred": false, "url": "https://trello.com/b/Oyw0z3uk/sample-board", "prefs": { "permissionLevel": "org", "hideVotes": false, "voting": "disabled", "comments": "members", "invitations": "members", "selfJoin": true, "cardCovers": true, "isTemplate": false, "cardAging": "regular", "calendarFeedEnabled": false, "hiddenPluginBoardButtons": [], "switcherViews": [ { "_id": "62eef6fc538ee5053f748eb1", "viewType": "Board", "enabled": true }, { "_id": "62eef6fc538ee5053f748eb2", "viewType": "Table", "enabled": true }, { "_id": "62eef6fc538ee5053f748eb3", "viewType": "Calendar", "enabled": false }, { "_id": "62eef6fc538ee5053f748eb4", "viewType": "Dashboard", "enabled": false }, { "_id": "62eef6fc538ee5053f748eb5", "viewType": "Timeline", "enabled": false }, { "_id": "62eef6fc538ee5053f748eb6", "viewType": "Map", "enabled": false } ], "background": "blue", "backgroundColor": "#0079BF", "backgroundImage": null, "backgroundImageScaled": null, "backgroundTile": false, "backgroundBrightness": "dark", "backgroundBottomColor": "#0079BF", "backgroundTopColor": "#0079BF", "canBePublic": true, "canBeEnterprise": true, "canBeOrg": true, "canBePrivate": true, "canInvite": true }, "shortLink": "Oyw0z3uk", "subscribed": false, "labelNames": { "green": "", "yellow": "", "orange": "", "red": "", "purple": "", "blue": "", "sky": "", "lime": "", "pink": "", "black": "", "green_dark": "", "yellow_dark": "", "orange_dark": "", "red_dark": "", "purple_dark": "", "blue_dark": "", "sky_dark": "", "lime_dark": "", "pink_dark": "", "black_dark": "", "green_light": "", "yellow_light": "", "orange_light": "", "red_light": "", "purple_light": "", "blue_light": "", "sky_light": "", "lime_light": "", "pink_light": "", "black_light": "" }, "powerUps": [], "dateLastActivity": "2022-08-06T23:33:33.742Z", "dateLastView": "2022-08-06T23:33:41.555Z", "shortUrl": "https://trello.com/b/Oyw0z3uk", "idTags": [], "datePluginDisable": null, "creationMethod": null, "ixUpdate": "29", "templateGallery": null, "enterpriseOwned": false, "idBoardSource": null, "premiumFeatures": [ "additionalBoardBackgrounds", "additionalStickers", "customBoardBackgrounds", "customEmoji", "customStickers", "plugins" ], "idMemberCreator": "59df7c5213645e8581c1940a", "actions": [ { "id": "62eefa4d78d058691f3d3315", "idMemberCreator": "59df7c5213645e8581c1940a", "data": { "text": "Random comment.", "textData": { "emoji": {} }, "card": { "id": "62eef72318bd987acfdbfd15", "name": "Task 1", "idShort": 1, "shortLink": "dOe7KWFh" }, "board": { "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "shortLink": "Oyw0z3uk" }, "list": { "id": "62eef711381df218479187b9", "name": "Backlog" } }, "appCreator": null, "type": "commentCard", "date": "2022-08-06T23:33:33.732Z", "limits": { "reactions": { "perAction": { "status": "ok", "disableAt": 900, "warnAt": 720 }, "uniquePerAction": { "status": "ok", "disableAt": 17, "warnAt": 14 } } }, "memberCreator": { "id": "59df7c5213645e8581c1940a", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "fullName": "Milosz", "idMemberReferrer": null, "initials": "M", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "username": "admin" } }, { "id": "62eefa4053f2357184e8c8c4", "idMemberCreator": "59df7c5213645e8581c1940a", "data": { "text": "Next comment.", "textData": { "emoji": {} }, "card": { "id": "62eef72318bd987acfdbfd15", "name": "Task 1", "idShort": 1, "shortLink": "dOe7KWFh" }, "board": { "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "shortLink": "Oyw0z3uk" }, "list": { "id": "62eef711381df218479187b9", "name": "Backlog" } }, "appCreator": null, "type": "commentCard", "date": "2022-08-06T23:33:20.579Z", "limits": { "reactions": { "perAction": { "status": "ok", "disableAt": 900, "warnAt": 720 }, "uniquePerAction": { "status": "ok", "disableAt": 17, "warnAt": 14 } } }, "memberCreator": { "id": "59df7c5213645e8581c1940a", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "fullName": "Milosz", "idMemberReferrer": null, "initials": "M", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "username": "admin" } }, { "id": "62eefa3797ea8437578b9de0", "idMemberCreator": "59df7c5213645e8581c1940a", "data": { "text": "Some comment.", "textData": { "emoji": {} }, "card": { "id": "62eef72318bd987acfdbfd15", "name": "Task 1", "idShort": 1, "shortLink": "dOe7KWFh" }, "board": { "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "shortLink": "Oyw0z3uk" }, "list": { "id": "62eef711381df218479187b9", "name": "Backlog" } }, "appCreator": null, "type": "commentCard", "date": "2022-08-06T23:33:11.120Z", "limits": { "reactions": { "perAction": { "status": "ok", "disableAt": 900, "warnAt": 720 }, "uniquePerAction": { "status": "ok", "disableAt": 17, "warnAt": 14 } } }, "memberCreator": { "id": "59df7c5213645e8581c1940a", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "fullName": "Milosz", "idMemberReferrer": null, "initials": "M", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "username": "admin" } }, { "id": "62eef72bfb7f7375c2ea1b1a", "idMemberCreator": "59df7c5213645e8581c1940a", "data": { "card": { "desc": "task description", "id": "62eef72318bd987acfdbfd15", "name": "Task 1", "idShort": 1, "shortLink": "dOe7KWFh" }, "old": { "desc": "" }, "board": { "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "shortLink": "Oyw0z3uk" }, "list": { "id": "62eef711381df218479187b9", "name": "Backlog" } }, "appCreator": null, "type": "updateCard", "date": "2022-08-06T23:20:11.772Z", "limits": null, "memberCreator": { "id": "59df7c5213645e8581c1940a", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "fullName": "Milosz", "idMemberReferrer": null, "initials": "M", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "username": "admin" } }, { "id": "62eef72318bd987acfdbfd1e", "idMemberCreator": "59df7c5213645e8581c1940a", "data": { "card": { "id": "62eef72318bd987acfdbfd15", "name": "Task 1", "idShort": 1, "shortLink": "dOe7KWFh" }, "list": { "id": "62eef711381df218479187b9", "name": "Backlog" }, "board": { "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "shortLink": "Oyw0z3uk" } }, "appCreator": null, "type": "createCard", "date": "2022-08-06T23:20:03.596Z", "limits": null, "memberCreator": { "id": "59df7c5213645e8581c1940a", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "fullName": "Milosz", "idMemberReferrer": null, "initials": "M", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "username": "admin" } }, { "id": "62eef7183fcf0d37d577de1e", "idMemberCreator": "59df7c5213645e8581c1940a", "data": { "list": { "id": "62eef7183fcf0d37d577de1a", "name": "Done" }, "board": { "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "shortLink": "Oyw0z3uk" } }, "appCreator": null, "type": "createList", "date": "2022-08-06T23:19:52.376Z", "limits": null, "memberCreator": { "id": "59df7c5213645e8581c1940a", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "fullName": "Milosz", "idMemberReferrer": null, "initials": "M", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "username": "admin" } }, { "id": "62eef716287fbe1c43425e10", "idMemberCreator": "59df7c5213645e8581c1940a", "data": { "list": { "id": "62eef716287fbe1c43425e0c", "name": "Doing" }, "board": { "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "shortLink": "Oyw0z3uk" } }, "appCreator": null, "type": "createList", "date": "2022-08-06T23:19:50.592Z", "limits": null, "memberCreator": { "id": "59df7c5213645e8581c1940a", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "fullName": "Milosz", "idMemberReferrer": null, "initials": "M", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "username": "admin" } }, { "id": "62eef711381df218479187bd", "idMemberCreator": "59df7c5213645e8581c1940a", "data": { "list": { "id": "62eef711381df218479187b9", "name": "Backlog" }, "board": { "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "shortLink": "Oyw0z3uk" } }, "appCreator": null, "type": "createList", "date": "2022-08-06T23:19:45.054Z", "limits": null, "memberCreator": { "id": "59df7c5213645e8581c1940a", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "fullName": "Milosz", "idMemberReferrer": null, "initials": "M", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "username": "admin" } }, { "id": "62eef6fc538ee5053f748ed3", "idMemberCreator": "59df7c5213645e8581c1940a", "data": { "board": { "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "shortLink": "Oyw0z3uk" }, "organization": { "id": "60504c6a15fb9b547720893a", "name": "Przestrzeń robocza użytkownika Milosz" } }, "appCreator": null, "type": "addToOrganizationBoard", "date": "2022-08-06T23:19:24.544Z", "limits": null, "memberCreator": { "id": "59df7c5213645e8581c1940a", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "fullName": "Milosz", "idMemberReferrer": null, "initials": "M", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "username": "admin" } }, { "id": "62eef6fc538ee5053f748ed0", "idMemberCreator": "59df7c5213645e8581c1940a", "data": { "board": { "id": "62eef6fc538ee5053f748eb0", "name": "Sample board", "shortLink": "Oyw0z3uk" } }, "appCreator": null, "type": "createBoard", "date": "2022-08-06T23:19:24.538Z", "limits": null, "memberCreator": { "id": "59df7c5213645e8581c1940a", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "fullName": "Milosz", "idMemberReferrer": null, "initials": "M", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "username": "admin" } } ], "cards": [ { "id": "62eef72318bd987acfdbfd15", "address": null, "badges": { "attachmentsByType": { "trello": { "board": , "card": 0 } }, "location": false, "votes": , "viewingMemberVoted": false, "subscribed": true, "fogbugz": "", "checkItems": , "checkItemsChecked": , "checkItemsEarliestDue": null, "comments": 3, "attachments": , "description": true, "due": null, "dueComplete": false, "start": null }, "checkItemStates": null, "closed": false, "coordinates": null, "creationMethod": null, "dueComplete": false, "dateLastActivity": "2022-08-06T23:33:33.742Z", "desc": "task description", "descData": { "emoji": {} }, "due": null, "dueReminder": null, "email": "sleeplessbeas+2p5a62yusg2blaotiq3+2yv6kmfp2l4l6z6mplh+13zu6kxvfy@boards.trello.com", "idBoard": "62eef6fc538ee5053f748eb0", "idChecklists": [], "idLabels": [], "idList": "62eef711381df218479187b9", "idMembers": [], "idMembersVoted": [], "idShort": 1, "idAttachmentCover": null, "labels": [], "limits": { "attachments": { "perCard": { "status": "ok", "disableAt": 1000, "warnAt": 800 } }, "checklists": { "perCard": { "status": "ok", "disableAt": 500, "warnAt": 400 } }, "stickers": { "perCard": { "status": "ok", "disableAt": 70, "warnAt": 56 } } }, "locationName": null, "manualCoverAttachment": false, "name": "Task 1", "pos": 65535, "shortLink": "dOe7KWFh", "shortUrl": "https://trello.com/c/dOe7KWFh", "staticMapUrl": null, "start": null, "subscribed": true, "url": "https://trello.com/c/dOe7KWFh/1-task-1", "cover": { "idAttachment": null, "color": null, "idUploadedBackground": null, "size": "normal", "brightness": "dark", "idPlugin": null }, "isTemplate": false, "cardRole": null, "attachments": [], "pluginData": [], "customFieldItems": [] } ], "labels": [ { "id": "62eef6fca70fbaa9f2fc2452", "idBoard": "62eef6fc538ee5053f748eb0", "name": "", "color": "green" }, { "id": "62eef6fca70fbaa9f2fc2458", "idBoard": "62eef6fc538ee5053f748eb0", "name": "", "color": "red" }, { "id": "62eef6fca70fbaa9f2fc2459", "idBoard": "62eef6fc538ee5053f748eb0", "name": "", "color": "orange" }, { "id": "62eef6fca70fbaa9f2fc245a", "idBoard": "62eef6fc538ee5053f748eb0", "name": "", "color": "purple" }, { "id": "62eef6fca70fbaa9f2fc245b", "idBoard": "62eef6fc538ee5053f748eb0", "name": "", "color": "blue" }, { "id": "62eef6fca70fbaa9f2fc245c", "idBoard": "62eef6fc538ee5053f748eb0", "name": "", "color": "yellow" } ], "lists": [ { "id": "62eef711381df218479187b9", "name": "Backlog", "closed": false, "idBoard": "62eef6fc538ee5053f748eb0", "pos": 65535, "subscribed": false, "softLimit": null, "limits": { "cards": { "openPerList": { "status": "ok", "disableAt": 5000, "warnAt": 4000 }, "totalPerList": { "status": "ok", "disableAt": 1000000, "warnAt": 800000 } } }, "creationMethod": null }, { "id": "62eef716287fbe1c43425e0c", "name": "Doing", "closed": false, "idBoard": "62eef6fc538ee5053f748eb0", "pos": 131071, "subscribed": false, "softLimit": null, "limits": { "cards": { "openPerList": { "status": "ok", "disableAt": 5000, "warnAt": 4000 }, "totalPerList": { "status": "ok", "disableAt": 1000000, "warnAt": 800000 } } }, "creationMethod": null }, { "id": "62eef7183fcf0d37d577de1a", "name": "Done", "closed": false, "idBoard": "62eef6fc538ee5053f748eb0", "pos": 196607, "subscribed": false, "softLimit": null, "limits": { "cards": { "openPerList": { "status": "ok", "disableAt": 5000, "warnAt": 4000 }, "totalPerList": { "status": "ok", "disableAt": 1000000, "warnAt": 800000 } } }, "creationMethod": null } ], "members": [ { "id": "59df7c5213645e8581c1940a", "aaId": "557058:c7d55364-8080-43e4-a8e8-8f5138886ff1", "activityBlocked": false, "avatarHash": "407af03af1e3b967ee32ddb9c48e752c", "avatarUrl": "https://trello-members.s3.amazonaws.com/59df7c5213645e8581c1940a/407af03af1e3b967ee32ddb9c48e752c", "bio": "", "bioData": null, "confirmed": true, "fullName": "Milosz", "idEnterprise": null, "idEnterprisesDeactivated": [], "idMemberReferrer": null, "idPremOrgsAdmin": [], "initials": "M", "memberType": "normal", "nonPublic": { "fullName": "Milosz", "initials": "M", "avatarHash": null }, "nonPublicAvailable": true, "products": [], "url": "https://trello.com/admin", "username": "admin", "status": "disconnected" } ], "checklists": [], "customFields": [], "memberships": [ { "idMember": "59df7c5213645e8581c1940a", "memberType": "admin", "unconfirmed": false, "deactivated": false, "id": "62eef6fc538ee5053f748eb8" } ], "pluginData": [] }
Execute script to convert Trello export from JSON to Markdown files.
$ python3 cttop.py Oyw0z3uk.json
Temporary directory '/tmp/tmpyvzrcbw3' for board 'Sample board'
Inspect created directory tree.
$ tree /tmp/tmpyvzrcbw3/
/tmp/tmpyvzrcbw3/ └── 62eef6fc538ee5053f748eb0 ├── 62eef711381df218479187b9 │ ├── 62eef72318bd987acfdbfd15.md │ └── list_name.md └── board_name.md
Inspect converted Markdown file.
$ cat /tmp/tmpyvzrcbw3/62eef6fc538ee5053f748eb0/62eef711381df218479187b9/62eef72318bd987acfdbfd15.md
# Task 1 ## description task description ## comment 62eefa4d78d058691f3d3315 Random comment. ## comment 62eefa4053f2357184e8c8c4 Next comment. ## comment 62eefa3797ea8437578b9de0 Some comment.
Import created directory.

Modify Python script to reflect you needs and have a nice day.