roclark / sportsipy

A free sports API written for python
MIT License
476 stars 189 forks source link

Today's MLB Schedule #607

Open heirjordan23 opened 3 years ago

heirjordan23 commented 3 years ago

Is your feature request related to a problem? Please describe. I'm attempting to pull the schedule of today's games that are YET to be played. The boxscores module only includes games that have been finalized as of the prior day. Similarly the schedule module does not include any games that have yet to be played. I have created a duplicate version for NBA that does indeed pull today's games that are yet to be played, so I am confused as to why this might be any different...

Describe the solution you'd like Simple code to pull today's games that are yet to be played

peteC360 commented 2 years ago

the data needed is available on the preview page or on the full schedule page but it would be great to get it included in the schedule call.

jd-harris commented 2 years ago

I'm experiencing the same issue

What's not working:

from sportsipy.mlb.teams import Teams as mlbTeams
from sportsipy.mlb.schedule import Schedule as mlbSchedule

dfTest = mlbTeams()
for team in dfTest:
    df = mlbSchedule(team.abbreviation).dataframe

And

dfTest = mlbTeams()
for team in dfTest:
    df = team.schedule.dataframe

Both result in a dataframe that only has the completed games for each team in the MLB. Games that have not been played yet do not show up in the dataframe.

What the expected outcome is:

With the NBA I can do this:

from sportsipy.nba.teams import Teams as nbaTeams
from sportsipy.nba.schedule import Schedule as nbaSchedule

df_Teams = nbaTeams().dataframes
for team in df_Teams['abbreviation'].values:
    df_schedule = nbaSchedule(f"{team}").dataframe

And get a dataframe that has the whole schedule for each team in the NBA. Even if the game has not been played yet, it still shows up in the dataframe.

With the MLB if I do this I can get the entire schedule for the Houston Astros.

houston_schedule = mlbSchedule('HOU')
for game in houston_schedule:
    print(game.date)

But the entire schedule does not show up in mlbSchedule(team.abbreviation).dataframe