Skip to main content
Version: 0.2.0

🧭 More sources with sportsdataverse-py

This page is the executed notebook 19_more_sources_intro.ipynb: download it to run it yourself.

Four smaller surfaces, one notebook:

SurfaceModuleProvider
NBA G Leaguesportsdataverse.nbaglESPN
Formula 1sportsdataverse.f1Jolpica (the Ergast API successor)
TheSportsDBsportsdataverse.providers.thesportsdbTheSportsDB (free tier)
ESPN contentsportsdataverse.providers.espn_contentESPN news API

No API keys needed.

🧰 The toolbox​

FunctionWhat it gives you
espn_nbagl_standingsG League standings
espn_nbagl_scoreboardG League scoreboard
f1_scheduleRace calendar of a season
f1_driver_standingsDrivers' championship
f1_resultsRace classification
f1_lapsEvery lap of a race, all pages
thesportsdb_leaguesLeagues TheSportsDB knows
thesportsdb_tableA league table
espn_content_newsCross-sport headlines
espn_content_league_newsHeadlines for one league

πŸ”Œ Setup​

pip install "sportsdataverse[sdvplot]"

The sdvplot extra brings in sdvplot and matplotlib for the charts.

import matplotlib.pyplot as plt
import polars as pl

from sportsdataverse import f1, nbagl
from sportsdataverse.providers import espn_content, thesportsdb

pl.Config.set_tbl_rows(10)
pl.Config.set_fmt_str_lengths(60)
polars.config.Config

Provider feeds are seasonal and occasionally rate-limited, so a tiny safe() helper runs each call defensively: you get the frame when the feed is up, and a one-line skip when it isn't, naming whether the answer was nothing there (NoDataError) or the fetch failed (AssetFetchError). πŸ›Ÿ

from sportsdataverse.errors import AssetFetchError, NoDataError

def safe(label, thunk):
try:
out = thunk()
print(f"βœ… {label}")
return out
except (NoDataError, AssetFetchError) as e:
print(f"\u23ed\ufe0f {label}: {type(e).__name__}: {e}")
return None

πŸ€ NBA G League​

The G League rides the cross-league ESPN wrappers (espn_nbagl_*). espn_nbagl_standings takes a season (END year), and sdvplot's team_colors("nbagl", ...) resolves ESPN team ids to each team's color.

The nbagl_enhanced_pbp / nbagl_possessions / nbagl_rapm_from_games helpers in the same module read stats.nba.com, which blocks datacenter IPs, so this notebook does not call them.

import sdvplot

gst = safe("G League standings 2026", lambda: nbagl.espn_nbagl_standings(season=2026))
if gst is not None and gst.height:
top = gst.sort("win_percent", "point_differential")
colors = [c or "#999999" for c in sdvplot.team_colors("nbagl", [str(i) for i in top["team_id"]])]
fig, ax = plt.subplots(figsize=(7, 8))
ax.barh(top["team_display_name"], top["win_percent"], color=colors)
ax.set_xlabel("win %")
ax.set_title("G League 2025-26 standings")
plt.tight_layout()
plt.show()
else:
print("standings unavailable")
βœ… G League standings 2026

png

gsb = safe("G League scoreboard", nbagl.espn_nbagl_scoreboard)
cols = ["date", "short_name", "status_type_detail", "home_score", "away_score"]
gsb.select([c for c in cols if c in gsb.columns]).head() if gsb is not None and gsb.height else "no games today"
βœ… G League scoreboard





shape: (2, 5)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ date ┆ short_name ┆ status_type_detail ┆ home_score ┆ away_score β”‚
β”‚ --- ┆ --- ┆ --- ┆ --- ┆ --- β”‚
β”‚ str ┆ str ┆ str ┆ str ┆ str β”‚
β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•ͺ════════════β•ͺ════════════════════β•ͺ════════════β•ͺ════════════║
β”‚ 2026-12-01T00:00Z ┆ MNE @ CPS ┆ Final ┆ 103 ┆ 105 β”‚
β”‚ 2026-12-01T01:00Z ┆ MHU @ RGV ┆ Final ┆ 114 ┆ 110 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🏎️ Formula 1​

The F1 helpers take season and round as strings. f1_driver_standings returns the table after a season's last round; f1_laps pages through every lap of a race.

F1_SEASON = "2025"
dst = safe(f"F1 driver standings {F1_SEASON}", lambda: f1.f1_driver_standings(F1_SEASON))
cols = ["position", "driver_given_name", "driver_family_name", "constructors", "points", "wins"]
dst.select([c for c in cols if c in dst.columns]).head(10) if dst is not None else None
βœ… F1 driver standings 2025





shape: (10, 6)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”
β”‚ position ┆ driver_given_name ┆ driver_family_name ┆ constructors ┆ points ┆ wins β”‚
β”‚ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- β”‚
β”‚ i64 ┆ str ┆ str ┆ str ┆ f64 ┆ i64 β”‚
β•žβ•β•β•β•β•β•β•β•β•β•β•ͺ═══════════════════β•ͺ════════════════════β•ͺ══════════════════════════════β•ͺ════════β•ͺ══════║
β”‚ 1 ┆ Lando ┆ Norris ┆ [{"constructorId": ┆ 423.0 ┆ 7 β”‚
β”‚ ┆ ┆ ┆ "mclaren", "url": ┆ ┆ β”‚
β”‚ ┆ ┆ ┆ "https://en.wikipedia.o… ┆ ┆ β”‚
β”‚ 2 ┆ Max ┆ Verstappen ┆ [{"constructorId": ┆ 421.0 ┆ 8 β”‚
β”‚ ┆ ┆ ┆ "red_bull", "url": ┆ ┆ β”‚
β”‚ ┆ ┆ ┆ "https://en.wikipedia.… ┆ ┆ β”‚
β”‚ 3 ┆ Oscar ┆ Piastri ┆ [{"constructorId": ┆ 410.0 ┆ 7 β”‚
β”‚ ┆ ┆ ┆ "mclaren", "url": ┆ ┆ β”‚
β”‚ ┆ ┆ ┆ "https://en.wikipedia.o… ┆ ┆ β”‚
β”‚ 4 ┆ George ┆ Russell ┆ [{"constructorId": ┆ 319.0 ┆ 2 β”‚
β”‚ ┆ ┆ ┆ "mercedes", "url": ┆ ┆ β”‚
β”‚ ┆ ┆ ┆ "https://en.wikipedia.… ┆ ┆ β”‚
β”‚ 5 ┆ Charles ┆ Leclerc ┆ [{"constructorId": ┆ 242.0 ┆ 0 β”‚
β”‚ ┆ ┆ ┆ "ferrari", "url": ┆ ┆ β”‚
β”‚ ┆ ┆ ┆ "https://en.wikipedia.o… ┆ ┆ β”‚
β”‚ 6 ┆ Lewis ┆ Hamilton ┆ [{"constructorId": ┆ 156.0 ┆ 0 β”‚
β”‚ ┆ ┆ ┆ "ferrari", "url": ┆ ┆ β”‚
β”‚ ┆ ┆ ┆ "https://en.wikipedia.o… ┆ ┆ β”‚
β”‚ 7 ┆ Andrea Kimi ┆ Antonelli ┆ [{"constructorId": ┆ 150.0 ┆ 0 β”‚
β”‚ ┆ ┆ ┆ "mercedes", "url": ┆ ┆ β”‚
β”‚ ┆ ┆ ┆ "https://en.wikipedia.… ┆ ┆ β”‚
β”‚ 8 ┆ Alexander ┆ Albon ┆ [{"constructorId": ┆ 73.0 ┆ 0 β”‚
β”‚ ┆ ┆ ┆ "williams", "url": ┆ ┆ β”‚
β”‚ ┆ ┆ ┆ "https://en.wikipedia.… ┆ ┆ β”‚
β”‚ 9 ┆ Carlos ┆ Sainz ┆ [{"constructorId": ┆ 64.0 ┆ 0 β”‚
β”‚ ┆ ┆ ┆ "williams", "url": ┆ ┆ β”‚
β”‚ ┆ ┆ ┆ "https://en.wikipedia.… ┆ ┆ β”‚
β”‚ 10 ┆ Fernando ┆ Alonso ┆ [{"constructorId": ┆ 56.0 ┆ 0 β”‚
β”‚ ┆ ┆ ┆ "aston_martin", "url": ┆ ┆ β”‚
β”‚ ┆ ┆ ┆ "https://en.wikipe… ┆ ┆ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”˜
laps = safe(f"F1 laps {F1_SEASON} round 1", lambda: f1.f1_laps(F1_SEASON, "1"))
res = safe(f"F1 results {F1_SEASON} round 1", lambda: f1.f1_results(F1_SEASON, "1"))
if laps is not None and laps.height and res is not None and res.height:
top5 = res.sort(pl.col("position").cast(pl.Int64, strict=False)).head(5)["driver_id"].to_list()
fig, ax = plt.subplots(figsize=(9, 4))
for d in top5:
s = laps.filter(pl.col("driver_id") == d).sort("lap_number")
ax.plot(s["lap_number"], s["position"].cast(pl.Int64, strict=False), label=d)
ax.invert_yaxis()
ax.set_xlabel("lap")
ax.set_ylabel("position")
ax.set_title(f"{res['race_name'][0]} {F1_SEASON}: the top five finishers, lap by lap")
ax.legend(fontsize=8)
plt.show()
else:
print("lap data unavailable")
βœ… F1 laps 2025 round 1


βœ… F1 results 2025 round 1

png

πŸ“š TheSportsDB​

TheSportsDB's free tier serves a sample of its catalog (a handful of leagues, five rows of a table), which is enough to see the shape. thesportsdb_table takes the league id and a season label such as "2024-2025" (4328 is the English Premier League).

safe("TheSportsDB leagues", thesportsdb.thesportsdb_leagues)
βœ… TheSportsDB leagues





shape: (10, 3)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ id_league ┆ str_league ┆ str_sport β”‚
β”‚ --- ┆ --- ┆ --- β”‚
β”‚ str ┆ str ┆ str β”‚
β•žβ•β•β•β•β•β•β•β•β•β•β•β•ͺ═════════════════════════════β•ͺ═══════════║
β”‚ 4328 ┆ English Premier League ┆ Soccer β”‚
β”‚ 4329 ┆ English League Championship ┆ Soccer β”‚
β”‚ 4330 ┆ Scottish Premier League ┆ Soccer β”‚
β”‚ 4331 ┆ German Bundesliga ┆ Soccer β”‚
β”‚ 4332 ┆ Italian Serie A ┆ Soccer β”‚
β”‚ 4334 ┆ French Ligue 1 ┆ Soccer β”‚
β”‚ 4335 ┆ Spanish La Liga ┆ Soccer β”‚
β”‚ 4336 ┆ Greek Super League 1 ┆ Soccer β”‚
β”‚ 4337 ┆ Dutch Eredivisie ┆ Soccer β”‚
β”‚ 4338 ┆ Belgian Pro League ┆ Soccer β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
epl = safe("EPL table 2024-2025", lambda: thesportsdb.thesportsdb_table("4328", "2024-2025"))
cols = ["int_rank", "str_team", "int_played", "int_win", "int_draw", "int_loss", "int_points"]
epl.select([c for c in cols if c in epl.columns]) if epl is not None else None
βœ… EPL table 2024-2025





shape: (5, 7)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ int_rank ┆ str_team ┆ int_played ┆ int_win ┆ int_draw ┆ int_loss ┆ int_points β”‚
β”‚ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- β”‚
β”‚ str ┆ str ┆ str ┆ str ┆ str ┆ str ┆ str β”‚
β•žβ•β•β•β•β•β•β•β•β•β•β•ͺ══════════════════β•ͺ════════════β•ͺ═════════β•ͺ══════════β•ͺ══════════β•ͺ════════════║
β”‚ 1 ┆ Liverpool ┆ 38 ┆ 25 ┆ 9 ┆ 4 ┆ 84 β”‚
β”‚ 2 ┆ Arsenal ┆ 38 ┆ 20 ┆ 14 ┆ 4 ┆ 74 β”‚
β”‚ 3 ┆ Manchester City ┆ 38 ┆ 21 ┆ 8 ┆ 9 ┆ 71 β”‚
β”‚ 4 ┆ Chelsea ┆ 38 ┆ 20 ┆ 9 ┆ 9 ┆ 69 β”‚
β”‚ 5 ┆ Newcastle United ┆ 38 ┆ 20 ┆ 6 ┆ 12 ┆ 66 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“° ESPN content​

espn_content_news returns cross-sport headlines; espn_content_league_news takes ESPN's sport and league slugs ("basketball", "nba").

news = safe("ESPN NBA news", lambda: espn_content.espn_content_league_news("basketball", "nba", limit="5"))
news.select("published", "headline") if news is not None and news.height else "no headlines"
βœ… ESPN NBA news





shape: (5, 2)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ published ┆ headline β”‚
β”‚ --- ┆ --- β”‚
β”‚ str ┆ str β”‚
β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•ͺ═══════════════════════════════════════════════════════════════║
β”‚ 2026-12-01T03:40:32Z ┆ Jayson Tatum helps balanced Celtics bounce back with 125-101… β”‚
β”‚ 2026-12-01T03:34:31Z ┆ Sengun powers the Rockets past the Lakers 110-105 for their … β”‚
β”‚ 2026-12-01T03:15:31Z ┆ Coby White makes 7 3s and Hornets spoil debut of Wizards int… β”‚
β”‚ 2026-12-01T03:01:32Z ┆ Gilgeous-Alexander scores 31 as the Thunder beat the Nets 10… β”‚
β”‚ 2026-12-01T02:40:31Z ┆ John Collins scores season-high 33 points and banged-up Pist… β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸŽ‰ Where to next​

  • The G League's ESPN surface has the same shape as every other ESPN league: see the NBA G League reference pages.
  • F1 also has f1_qualifying, f1_sprint, f1_pitstops and the f1_circuits / f1_status vocabularies.
  • Headlines for any league: pass its ESPN slugs to espn_content_league_news.