Search code examples
pythontrello

Get Archived Cards


I'm using the trello api for python (py-trello) and I need to get all the cards that exists in a specific list even the archived ones.

I have tried to list all the cards with the method list_cards() from the list.

all_boards = client.list_boards()
wls_board = all_boards[1]
my_lists = wls_board.list_lists()

for list in my_lists:
    for card in list.list_cards():
        if "Done" in card.name: print(card.name)

The method returned only the cards that are not archived. Is there a way for getting also the archived cards using py-trello?


Solution

  • Just found the solution in the documentation.

    The method list_cards() has the parameter card_filter setted to 'open' by default so I simply needed to change it to 'all'.

    list_cards(card_filter=’all’)