Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A simple python script to show MLB standings between arbitrary start and end dates using the MLB stats API

Notifications You must be signed in to change notification settings

jonner/mlb-standings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

$ uv run ./mlb-standings.py --help
usage: mlb-standings.py [-h] [--start START] [--end END] [--sort {division,league,overall}]

Get MLB standings for a given date range.

options:
  -h, --help            show this help message and exit
  --start START         Start date in YYYY-MM-DD format (defaults to the beginning of the current year)
  --end END             End date in YYYY-MM-DD format (defaults to the end of the regular season)
  --sort {division,league,overall}
                        Sort order for the standings.

By default, running the script outputs standings for the current year:

$ uv run ./mlb-standings.py 
Major League Baseball standings between 2025-01-01 and 2025-08-06

American League Central
-----------------------
1.    Detroit Tigers          66-49      0.574
2.    Cleveland Guardians     58-55      0.513
3.    Kansas City Royals      56-58      0.491
4.    Minnesota Twins         53-60      0.469
5.    Chicago White Sox       42-71      0.372

American League East
--------------------
1.    Toronto Blue Jays       67-48      0.583
2.    Boston Red Sox          64-51      0.557
3.    New York Yankees        60-54      0.526
4.    Tampa Bay Rays          56-59      0.487
5.    Baltimore Orioles       51-63      0.447

American League West
--------------------
1.    Houston Astros          64-50      0.561
2.    Seattle Mariners        61-53      0.535
3.    Texas Rangers           60-55      0.522
4.    Los Angeles Angels      55-59      0.482
5.    Athletics               50-65      0.435

National League Central
-----------------------
1.    Milwaukee Brewers       69-44      0.611
2.    Chicago Cubs            65-48      0.575
3.    Cincinnati Reds         60-54      0.526
4.    St. Louis Cardinals     57-58      0.496
5.    Pittsburgh Pirates      49-65      0.430

National League East
--------------------
1.    Philadelphia Phillies   65-48      0.575
2.    New York Mets           63-51      0.553
3.    Miami Marlins           55-57      0.491
4.    Atlanta Braves          47-65      0.420
5.    Washington Nationals    44-68      0.393

National League West
--------------------
1.    Los Angeles Dodgers     66-48      0.579
2.    San Diego Padres        63-51      0.553
3.    San Francisco Giants    57-57      0.500
4.    Arizona Diamondbacks    54-60      0.474
5.    Colorado Rockies        30-83      0.265

For now the start and end date must be within the same season. To show overall rankings for teams in july and august of 2023:

$ uv run ./mlb-standings.py --start 2023-07-01 --end 2023-08-31 --sort overall
Major League Baseball standings between 2023-07-01 and 2023-08-31

Overall Standings
-----------------
1.    Seattle Mariners        38-15      0.717
2.    Los Angeles Dodgers     37-15      0.712
3.    Baltimore Orioles       35-18      0.660
4.    Atlanta Braves          34-18      0.654
5.    Chicago Cubs            33-20      0.623
6.    Milwaukee Brewers       31-20      0.608
7.    Houston Astros          32-21      0.604
8.    Philadelphia Phillies   31-21      0.596
9.    Toronto Blue Jays       28-23      0.549
9.    Boston Red Sox          28-23      0.549
9.    Minnesota Twins         28-23      0.549
12.   Washington Nationals    29-25      0.537
13.   Tampa Bay Rays          25-24      0.510
14.   Texas Rangers           26-25      0.510
15.   New York Mets           25-27      0.481
16.   Cleveland Guardians     25-28      0.472
16.   Detroit Tigers          25-28      0.472
16.   Cincinnati Reds         25-28      0.472
16.   San Diego Padres        25-28      0.472
20.   St. Louis Cardinals     25-29      0.463
21.   San Francisco Giants    24-28      0.462
22.   Pittsburgh Pirates      22-31      0.415
23.   Los Angeles Angels      20-30      0.400
24.   Arizona Diamondbacks    20-31      0.392
25.   New York Yankees        20-33      0.377
26.   Miami Marlins           19-32      0.373
27.   Chicago White Sox       17-33      0.340
27.   Oakland Athletics       17-33      0.340
29.   Kansas City Royals      18-35      0.340
30.   Colorado Rockies        16-33      0.327

About

A simple python script to show MLB standings between arbitrary start and end dates using the MLB stats API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages