Salil999 / TrelloBoardReader

1 stars 0 forks source link

KeyError line 111 in _handle_cards #1

Open isFakeAccount opened 4 years ago

isFakeAccount commented 4 years ago

Hi,

I don't know if you this project is active or not but I was using your API to read a certain board and I got this error

Traceback (most recent call last):
  File "C:/Users/distr/Documents/PyCharm/fallout76marketplace/trello_blacklist.py", line 3, in <module>
    board = TrelloBoardReader(url='https://trello.com/b/0eCDKYHr/market76-blacklist')
  File "C:\Users\distr\Documents\PyCharm\fallout76marketplace\venv\lib\site-packages\trello_board_reader\reader.py", line 75, in __init__
    self._organize_data(self._raw_data)
  File "C:\Users\distr\Documents\PyCharm\fallout76marketplace\venv\lib\site-packages\trello_board_reader\reader.py", line 88, in _organize_data
    self._handle_cards(data['cards'])
  File "C:\Users\distr\Documents\PyCharm\fallout76marketplace\venv\lib\site-packages\trello_board_reader\reader.py", line 111, in _handle_cards
    self._list_ids[item['idList']]._add_card(card_obj)
KeyError: '5c33be76a192636e2152a2e5'

Do you know what this the reason for this error? Is it a bug? How should I solve it?

Thanks

Salil999 commented 4 years ago

What steps did you take to produce this error?

isFakeAccount commented 4 years ago

All I did what test the code from Readme. The board I was testing is this https://trello.com/b/0eCDKYHr/market76-blacklist

Full Code

from trello_board_reader.reader import TrelloBoardReader

board = TrelloBoardReader('https://trello.com/b/0eCDKYHr/market76-blacklist')
all_lists = board.get_lists()
print(all_lists)

first_list = board.get_list_from_id(all_lists[0])
for card in first_list.get_cards():
    print(card.get_text())
Salil999 commented 4 years ago

Thanks for that - I think Trello might have changed some of their JSON structure. I will take a look after work today.