Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError line 111 in _handle_cards #1

Open
isFakeAccount opened this issue Jun 6, 2020 · 3 comments
Open

KeyError line 111 in _handle_cards #1

isFakeAccount opened this issue Jun 6, 2020 · 3 comments

Comments

@isFakeAccount
Copy link

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
Copy link
Owner

What steps did you take to produce this error?

@isFakeAccount
Copy link
Author

isFakeAccount commented Sep 16, 2020

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants