swar / nba_api

An API Client package to access the APIs for NBA.com
MIT License
2.47k stars 532 forks source link

Most direct way to get champion for year? #186

Closed BlairCurrey closed 3 years ago

BlairCurrey commented 3 years ago

I'm new to this API and the way I found is rather indirect. I'm wondering if anyone knows of a faster way then the following:

Get all the playoff games like so:

from nba_api.stats.endpoints import leaguegamelog
playoffs = leaguegamelog.LeagueGameLog(season="1992-93", season_type_all_star="Playoffs")

Then get the last game of the playoff (whoever wins the last game is the champion). Each game has a home team and a result. So I can check if the home team won, and if they did, then they are the champion. If they lost, then I can check the matchup, which would be CHI @ PHX from the above example. Then I could somehow map the abbreviation to the team name. This seems so indirect but I don't see another way.

BlairCurrey commented 3 years ago

Also, any interest in opening discussions for this repo? I don't think this is really an "issue" but I didn't have anywhere else to ask.

rsforbes commented 3 years ago

We have a Slack Channel for many of these types of questions: https://github.com/swar/nba_api#slack-channel

BlairCurrey commented 3 years ago

@rsforbes awesome, thank you. I'll check it out next time.

I do not need an answer to this question at this point. Not sure if it has any value as a purely academic question so I'll leave it to you to close it or not.