nhl-api-py
nhl-api-py copied to clipboard
team_info dict extraction error
Thank you for the work on making this available. I was trying to working directly with the APIs and was going nuts.
I'm new to this and may be using the wrong terminology. I noticed that in the method "teams_info" using date "2021-05-01" it will fail. I poked around a bit and noticed that for the code in it
team = {
"conference": {"abbr": i["conferenceAbbrev"], "name": i["conferenceName"]},
"division": {"abbr": i["divisionAbbrev"], "name": i["divisionName"]},
"name": i["teamName"]["default"],
"common_name": i["teamCommonName"]["default"],
"abbr": i["teamAbbrev"]["default"],
logo": i["teamLogo"],
}
it fails because the results do not have a conferenceAbbrev or divisionAbbrev field. That was during covid so I guess they organized things a bit different that year. Or I'm doing something wrong :-p
Just thought I would share.
-Alan
Originally posted by @Glumdar in https://github.com/coreyjs/nhl-api-py/discussions/6#discussioncomment-12408161