nhl-api-py icon indicating copy to clipboard operation
nhl-api-py copied to clipboard

team_info dict extraction error

Open coreyjs opened this issue 1 year ago • 0 comments

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

coreyjs avatar Mar 10 '25 13:03 coreyjs