-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing and also implementing live game data
- Loading branch information
1 parent
f74a807
commit 43571ae
Showing
6 changed files
with
626 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,23 @@ | ||
from pybaseball_live.schedule import schedule | ||
|
||
from pybaseball_live.schedule import schedule_range | ||
from pybaseball_live.game import games | ||
import datetime | ||
import time | ||
|
||
if __name__ == "__main__": | ||
schedule_df_2024_2023 = schedule(years=[2024, 2023]) | ||
print(schedule_df_2024_2023) | ||
todays_schedule = schedule_range( | ||
sport_ids=[1], | ||
game_types=["R"], | ||
start_dt=datetime.datetime.now().date(), | ||
end_dt=datetime.datetime.now().date(), | ||
) | ||
|
||
assert todays_schedule is not None | ||
assert "game_id" in todays_schedule.columns | ||
|
||
todays_game_ids = todays_schedule["game_id"].to_list() | ||
while True: | ||
game_data = games(todays_game_ids) | ||
for game_df in game_data.values(): | ||
print(game_df) | ||
|
||
time.sleep(1) |
Oops, something went wrong.