Skip to content

Instantly share code, notes, and snippets.

@EugeneLoy
Created January 19, 2018 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EugeneLoy/38192c41f707be76d799e6f388ee6d2a to your computer and use it in GitHub Desktop.
Save EugeneLoy/38192c41f707be76d799e6f388ee6d2a to your computer and use it in GitHub Desktop.
Export cards from specific list in Trello (json) to csv
import json
import csv
LIST_NAME = "Backlog"
INPUT_FILE = "data.json"
OUTPUT_FILE = 'data.csv'
with open(INPUT_FILE) as jsonfile:
data = json.load(jsonfile)
for card_list in data["lists"]:
if card_list["name"] == LIST_NAME:
list_id = card_list["id"]
card_names = []
for card in data["cards"]:
if card["idList"] == list_id:
card_names.append(card["name"])
with open(OUTPUT_FILE, 'wb') as csvfile:
writer = csv.writer(csvfile)
for card_name in card_names:
writer.writerow([card_name])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment