ππ International basketball with sportsdataverse-py
This page is the executed notebook
16_international_basketball_intro.ipynb: download it to run it yourself.
The NBA is one league; the rest of the basketball world is dozens. sportsdataverse-py wraps the
feeds behind the biggest of them, and this notebook tours four:
| League | Module | Provider |
|---|---|---|
| EuroLeague | sportsdataverse.basketball.euroleague | EuroLeague Competition Engine |
| Super League Basketball (UK) | sportsdataverse.basketball.genius | Genius Sports LiveStats |
| NBL (Australia) | sportsdataverse.basketball.nbl_au | NBL Rosetta |
| Liga Endesa (Spain) | sportsdataverse.basketball.acb | ACB |
No API keys, polars by default (return_as_pandas=True for pandas), and at the end a EuroLeague
shot chart drawn on a FIBA court with sdvplot. π―
π§° The toolboxβ
| Function | What it gives you |
|---|---|
euroleague_seasons | Seasons of a competition (E = EuroLeague, U = EuroCup) |
euroleague_games | Every game of a season, played or not |
euroleague_standings | Standings after a round |
euroleague_game_points | Shot chart of one game (coord_x / coord_y in cm) |
slb_competitions | SLB competitions with their END-year season |
slb_schedule | Every match of an SLB season |
slb_player_box | Player box score of a finished SLB game |
slb_shots | Shot chart of a finished SLB game |
nbl_rosetta_standings | NBL regular-season ladder |
nbl_rosetta_matches | Matches of an NBL season |
acb_standings | Liga Endesa table after a round |
acb_calendar | Every round of a season with its games |
Genius LiveStats serves many leagues (wbbl_*, bal_*, nznbl_*, esake_*, lfb_*, ...) with the
same shape, so the SLB recipes below work for every one of them.
π Setupβ
pip install "sportsdataverse[sdvplot,sportypy]"
The sdvplot extra brings in sdvplot and matplotlib; the sportypy extra (GPL-3.0, kept separate on
purpose) draws the court.
import matplotlib.pyplot as plt
import polars as pl
from sportsdataverse.basketball import euroleague as el
from sportsdataverse.basketball import acb, genius, nbl_au
pl.Config.set_tbl_rows(10)
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
πͺπΊ EuroLeagueβ
Season codes are the competition letter plus the START year (E2025 is 2025-26). We take the newest
season that has a played game, so the notebook works in the off-season too.
seasons = safe("EuroLeague seasons", lambda: el.euroleague_seasons("E"))
season_code, games = None, None
if seasons is not None:
for code in seasons.sort("year", descending=True)["code"].head(3):
g = safe(f"games {code}", lambda code=code: el.euroleague_games("E", code))
if g is not None and g.filter(pl.col("played") == True).height:
season_code, games = code, g
break
print("season:", season_code, "| games:", None if games is None else games.shape)
β
EuroLeague seasons
β
games E2026
season: E2026 | games: (380, 94)
played = games.filter(pl.col("played") == True).sort("utc_date") if games is not None else None
cols = ["game_code", "round", "utc_date", "local_club_name", "road_club_name"]
(played.select([c for c in cols if c in played.columns]).tail(5)
if played is not None and played.height else "no played games")
shape: (5, 5)
βββββββββββββ¬ββββββββ¬βββββββββββββββββββββββ¬βββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β game_code β round β utc_date β local_club_name β road_club_name β
β --- β --- β --- β --- β --- β
β str β i64 β str β str β str β
βββββββββββββͺββββββββͺβββββββββββββββββββββββͺβββββββββββββββββββββͺββββββββββββββββββββββββββββββββ‘
β 133 β 14 β 2026-11-24T20:00:00Z β FC Barcelona β Fenerbahce Tarfin Istanbul β
β 137 β 14 β 2026-11-25T16:00:00Z β Dubai Basketball β Partizan Mozzart Bet Belgrade β
β 140 β 14 β 2026-11-25T19:15:00Z β Olympiacos Piraeus β Hapoel IBI Tel Aviv β
β 138 β 14 β 2026-11-25T19:30:00Z β Kosner Baskonia β Anadolu Efes Istanbul β
β β β β Vitoria-Gasteiβ¦ β β
β 139 β 14 β 2026-11-25T19:45:00Z β Real Madrid β Zalgiris Kaunas β
βββββββββββββ΄ββββββββ΄βββββββββββββββββββββββ΄βββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ
Standings after the latest round πβ
euroleague_standings takes the round as a string.
last_round = str(played["round"].max()) if played is not None and played.height else None
stand = safe(f"standings round {last_round}",
lambda: el.euroleague_standings("E", season_code, last_round)) if last_round else None
cols = ["position", "club_name", "games_played", "games_won", "games_lost", "points_difference"]
(stand.select([c for c in cols if c in stand.columns]).head(10)
if stand is not None and stand.height else "standings unavailable")
β
standings round 14
shape: (10, 6)
ββββββββββββ¬ββββββββββββββββββββββββββββ¬βββββββββββββββ¬ββββββββββββ¬βββββββββββββ¬ββββββββββββββββββββ
β position β club_name β games_played β games_won β games_lost β points_difference β
β --- β --- β --- β --- β --- β --- β
β i64 β str β i64 β i64 β i64 β str β
ββββββββββββͺββββββββββββββββββββββββββββͺβββββββββββββββͺββββββββββββͺβββββββββββββͺββββββββββββββββββββ‘
β 1 β Olympiacos Piraeus β 14 β 11 β 3 β +116 β
β 2 β Valencia Basket β 14 β 10 β 4 β +101 β
β 3 β Panathinaikos AKTOR β 14 β 10 β 4 β +97 β
β β Athens β β β β β
β 4 β Fenerbahce Tarfin β 14 β 9 β 5 β +81 β
β β Istanbul β β β β β
β 5 β Dubai Basketball β 14 β 9 β 5 β +8 β
β 6 β Real Madrid β 14 β 8 β 6 β +90 β
β 7 β Crvena Zvezda Meridianbet β 14 β 8 β 6 β +26 β
β β Belgβ¦ β β β β β
β 8 β FC Barcelona β 14 β 8 β 6 β +21 β
β 9 β Partizan Mozzart Bet β 14 β 8 β 6 β +17 β
β β Belgrade β β β β β
β 10 β Zalgiris Kaunas β 14 β 8 β 6 β +6 β
ββββββββββββ΄ββββββββββββββββββββββββββββ΄βββββββββββββββ΄ββββββββββββ΄βββββββββββββ΄ββββββββββββββββββββ
A shot chart on a FIBA court π―β
euroleague_game_points returns one row
per field-goal attempt and made free throw, in centimeters with the hoop at the origin.
sdvplot.court_coords(..., provider="euroleague") converts that frame to meters on the FIBA court
that sdvplot.surface("fiba") draws (free throws, encoded -1, -1, become null). Both teams shoot at
one basket, so we draw the defensive half.
import sdvplot
gcode = str(played["game_code"][-1]) if played is not None and played.height else None
pts = safe(f"shots game {gcode}", lambda: el.euroleague_game_points(gcode, season_code)) if gcode else None
if pts is not None and pts.height:
shots = sdvplot.court_coords(pts, x="coord_x", y="coord_y", provider="euroleague")
shots = shots.filter(pl.col("court_x").is_not_null())
made = shots.filter(pl.col("id_action").is_in(["2FGM", "3FGM"]))
missed = shots.filter(pl.col("id_action").is_in(["2FGA", "3FGA"]))
ax = sdvplot.surface("fiba", display_range="defense")
ax.scatter(missed["court_x"], missed["court_y"], marker="x", s=30, c="#888888", zorder=20, label="missed")
ax.scatter(made["court_x"], made["court_y"], s=30, c="#d62728", zorder=21, label="made")
ax.legend(loc="upper right")
ax.set_title(f"EuroLeague {season_code} game {gcode}: {shots.height} field-goal attempts")
plt.show()
else:
print("no shot data for this game")
β
shots game 139

π¬π§ Super League Basketball (Genius Sports)β
slb_competitions lists the SLB competitions
Genius hosts; slb_schedule defaults to the current one.
comps = safe("SLB competitions", genius.slb_competitions)
comps.select([c for c in ["comp_id", "label", "season"] if c in comps.columns]).head() if comps is not None else None
β
SLB competitions
shape: (5, 3)
βββββββββββ¬βββββββββββββββββββββββ¬βββββββββ
β comp_id β label β season β
β --- β --- β --- β
β i64 β str β i64 β
βββββββββββͺβββββββββββββββββββββββͺβββββββββ‘
β 49597 β Championship 26-27 β 2027 β
β 39625 β Championship 2024-25 β 2025 β
β 41897 β Championship 2025-26 β 2026 β
β 49599 β Cup 26-27 β 2027 β
β 39732 β Cup 2024-25 β 2025 β
βββββββββββ΄βββββββββββββββββββββββ΄βββββββββ
sched = safe("SLB schedule", genius.slb_schedule)
done = sched.filter(pl.col("status") == "COMPLETE") if sched is not None else None
cols = ["match_id", "date_time", "home_team_name", "home_score", "away_team_name", "away_score"]
(done.select([c for c in cols if c in done.columns]).tail(5)
if done is not None and done.height else "no completed SLB games yet")
β
SLB schedule
shape: (5, 6)
ββββββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββββ¬βββββββββββββ¬βββββββββββββββββββββββ¬βββββββββββββ
β match_id β date_time β home_team_name β home_score β away_team_name β away_score β
β --- β --- β --- β --- β --- β --- β
β i64 β str β str β i64 β str β i64 β
ββββββββββββͺββββββββββββββββͺβββββββββββββββββββββββͺβββββββββββββͺβββββββββββββββββββββββͺβββββββββββββ‘
β 2882484 β Nov 20, 2026, β Bristol Flyers β 83 β Cheshire Phoenix β 100 β
β β 7:30 PM β β β β β
β 2882485 β Nov 20, 2026, β Newcastle Eagles β 82 β Leicester Riders β 74 β
β β 7:30 PM β β β β β
β 2882486 β Nov 22, 2026, β Manchester β 81 β London Lions β 96 β
β β 4:00 PM β Basketball β β β β
β 2882487 β Nov 22, 2026, β Liverpool Basketball β 86 β Leicester Riders β 77 β
β β 4:00 PM β β β β β
β 2882488 β Nov 22, 2026, β Cheshire Phoenix β 108 β Caledonia Gladiators β 92 β
β β 5:30 PM β β β β β
ββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββββββ΄βββββββββββββββββββββββ΄βββββββββββββ
One game: box score and shots πβ
Take the latest completed match_id, then the player box score
(slb_player_box) and the shot chart
(slb_shots, x/y as a percent of the full court).
mid = int(done["match_id"][-1]) if done is not None and done.height else None
box = safe(f"SLB box {mid}", lambda: genius.slb_player_box(mid)) if mid else None
cols = ["name", "minutes", "points", "rebounds_total", "assists", "field_goals_made", "field_goals_attempted"]
(box.select([c for c in cols if c in box.columns]).sort("points", descending=True).head(8)
if box is not None and box.height and "points" in box.columns else "box score unavailable")
β
SLB box 2882488
shape: (8, 7)
βββββββββββββββ¬ββββββββββ¬βββββββββ¬βββββββββββββββββ¬ββββββββββ¬βββββββββββββββββββ¬ββββββββββββββββββββ
β name β minutes β points β rebounds_total β assists β field_goals_made β field_goals_attem β
β --- β --- β --- β --- β --- β --- β pted β
β str β str β i64 β i64 β i64 β i64 β --- β
β β β β β β β i64 β
βββββββββββββββͺββββββββββͺβββββββββͺβββββββββββββββββͺββββββββββͺβββββββββββββββββββͺββββββββββββββββββββ‘
β S. White β 26:09 β 37 β 13 β 2 β 12 β 22 β
β I. Small β 35:35 β 24 β 11 β 2 β 11 β 17 β
β A. Dawes β 31:33 β 23 β 3 β 4 β 8 β 14 β
β I. Gray β 23:36 β 19 β 3 β 4 β 9 β 11 β
β N. Williams β 22:37 β 15 β 1 β 3 β 5 β 10 β
β C. Keeling β 32:55 β 15 β 7 β 2 β 6 β 16 β
β Z. Gattorna β 25:23 β 13 β 10 β 1 β 4 β 10 β
β R. Cisarik β 31:40 β 12 β 5 β 1 β 4 β 8 β
βββββββββββββββ΄ββββββββββ΄βββββββββ΄βββββββββββββββββ΄ββββββββββ΄βββββββββββββββββββ΄ββββββββββββββββββββ
sh = safe(f"SLB shots {mid}", lambda: genius.slb_shots(mid)) if mid else None
(sh.group_by("action_type", "result").len().sort("action_type")
if sh is not None and sh.height else "no shots for this game")
β
SLB shots 2882488
shape: (4, 3)
βββββββββββββββ¬βββββββββ¬ββββββ
β action_type β result β len β
β --- β --- β --- β
β str β i64 β u32 β
βββββββββββββββͺβββββββββͺββββββ‘
β 2pt β 1 β 51 β
β 2pt β 0 β 44 β
β 3pt β 0 β 38 β
β 3pt β 1 β 23 β
βββββββββββββββ΄βββββββββ΄ββββββ
π¦πΊ NBL (Australia)β
The NBL's Rosetta API takes the season as its END year.
nbl_rosetta_standings gives the ladder;
nbl_rosetta_matches the match list.
nbl_season = 2026
ladder = safe(f"NBL ladder {nbl_season}", lambda: nbl_au.nbl_rosetta_standings(nbl_season))
cols = ["position", "team_name", "won", "lost", "win_percentage", "points_for", "points_against", "streak"]
(ladder.select([c for c in cols if c in ladder.columns]).sort("position")
if ladder is not None and ladder.height else "ladder unavailable")
β
NBL ladder 2026
shape: (10, 8)
ββββββββββββ¬βββββββββββββββββββ¬ββββββ¬βββββββ¬βββββββββββββββββ¬βββββββββββββ¬βββββββββββββββββ¬βββββββββ
β position β team_name β won β lost β win_percentage β points_for β points_against β streak β
β --- β --- β --- β --- β --- β --- β --- β --- β
β i64 β str β i64 β i64 β f64 β i64 β i64 β i64 β
ββββββββββββͺβββββββββββββββββββͺββββββͺβββββββͺβββββββββββββββββͺβββββββββββββͺβββββββββββββββββͺβββββββββ‘
β 1 β Sydney Kings β 24 β 9 β 0.7273 β 3276 β 2879 β 11 β
β 2 β Adelaide 36ers β 23 β 10 β 0.697 β 3042 β 2890 β 0 β
β 3 β South East β 22 β 11 β 0.6667 β 3324 β 3061 β 0 β
β β Melbourne β β β β β β β
β β Phoenix β β β β β β β
β 4 β Perth Wildcats β 21 β 12 β 0.6364 β 2996 β 2840 β 1 β
β 5 β Melbourne United β 20 β 13 β 0.6061 β 3041 β 2905 β 1 β
β 6 β Tasmania β 14 β 19 β 0.4242 β 2873 β 2884 β 0 β
β β JackJumpers β β β β β β β
β 7 β NZ Breakers β 13 β 20 β 0.3939 β 3022 β 3058 β 1 β
β 8 β Illawarra Hawks β 13 β 20 β 0.3939 β 3074 β 3205 β 2 β
β 9 β Cairns Taipans β 9 β 24 β 0.2727 β 2754 β 3194 β 0 β
β 10 β Brisbane Bullets β 6 β 27 β 0.1818 β 2710 β 3196 β 0 β
ββββββββββββ΄βββββββββββββββββββ΄ββββββ΄βββββββ΄βββββββββββββββββ΄βββββββββββββ΄βββββββββββββββββ΄βββββββββ
matches = safe(f"NBL matches {nbl_season}", lambda: nbl_au.nbl_rosetta_matches(nbl_season))
(matches.group_by("match_status").len() if matches is not None and "match_status" in matches.columns
else "matches unavailable")
β
NBL matches 2026
shape: (2, 2)
ββββββββββββββββ¬ββββββ
β match_status β len β
β --- β --- β
β str β u32 β
ββββββββββββββββͺββββββ‘
β complete β 206 β
β draft β 3 β
ββββββββββββββββ΄ββββββ
πͺπΈ Liga Endesa (ACB)β
acb_standings defaults to the table after the current round;
acb_calendar lists every round of the season in one call.
A bar chart of the table makes the early-season race easy to read.
table = safe("ACB standings", acb.acb_standings)
if table is not None and table.height:
t = table.sort("win_pct", "plus_minus")
fig, ax = plt.subplots(figsize=(7, 6))
ax.barh(t["team"], t["win_pct"], color="#1f4e79")
ax.set_xlabel("win %")
end = int(t["season"][0]) # END year
ax.set_title(f"Liga Endesa {end - 1}-{str(end)[2:]} standings")
plt.tight_layout()
plt.show()
else:
print("ACB standings unavailable")
β
ACB standings

cal = safe("ACB calendar", acb.acb_calendar)
(cal.group_by("round_number").agg(games=pl.len(), played=pl.col("home_score").is_not_null().sum())
.sort("round_number").head(8) if cal is not None and cal.height else "calendar unavailable")
β
ACB calendar
shape: (8, 3)
ββββββββββββββββ¬ββββββββ¬βββββββββ
β round_number β games β played β
β --- β --- β --- β
β i64 β u32 β u32 β
ββββββββββββββββͺββββββββͺβββββββββ‘
β 1 β 9 β 9 β
β 2 β 9 β 9 β
β 3 β 9 β 9 β
β 4 β 9 β 9 β
β 5 β 9 β 9 β
β 6 β 9 β 9 β
β 7 β 9 β 9 β
β 8 β 9 β 9 β
ββββββββββββββββ΄ββββββββ΄βββββββββ
π Where to nextβ
- Every Genius league (
wbbl_,bal_,nznbl_,esake_,lfb_,lnbm_,lub_) has the same_schedule/_player_box/_pbp/_shotsset as SLB. - More homes under
sportsdataverse.basketball:fiba_hub,atrium,feb,scb,lba,vtb,kbl,bleague,cebl,abaand others; each has a reference page in the sidebar. - Shot charts: sdvplot's
court_coordsalso converts NBA and WNBA stats-API shots (provider="nba"). - NBA, WNBA and college basketball have their own notebooks (
04,08,06,05).