Search code examples
pythontrello

Py-trello tutorial or example


I am trying to pull data from our trello boards into python and possibly output results in a tabular format which contains Name of member, Card name, description, date opened, due date etc..

The closest thing I have found is this package py-trello but I am unable to proceed further than just getting the names of the boards and cards. Is there anyone who has experience in this package who can guide me?

pip install py-trello
from trello import TrelloClient
client = TrelloClient(
    api_key='Your API Key',
    api_secret='Your Secret',
    token='Your Token',

all_boards = client.list_boards()
last_board = all_boards[-1]
print(last_board.name)
board = client.list_boards()[0]

board.list_lists()


all_boards = client.list_boards()
last_board = all_boards[-1]
last_board.list_lists()
my_list = last_board.get_list(list_id)

for card in my_list.list_cards():
    print(card.name)


Solution

  • all_boards = client.list_boards()
    last_board = all_boards[-1]
    print(last_board.name)
    board = client.list_boards()[0]
    
    board.list_lists()
    
    
    all_boards = client.list_boards()
    last_board = all_boards[-1]
    last_board.list_lists()
    list 
    my_list = last_board.list_lists()[number]
    
    print(my_list.list_cards())