Export cards from specific list in Trello (json) to csv
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 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