Install and try it
pip install sportypy
import matplotlib.pyplot as plt
from sportypy.surfaces.hockey import NHLRink
nhl = NHLRink()
ax = nhl.draw(display_range = "offense")
nhl.scatter([80, 70, 85], [10, -15, 3], ax = ax, color = "#e06000")
plt.show()
The usage guide covers display ranges, units, rotation and colors.
Every surface, to scale
BaseballBaseballField· 6 leagues
BasketballBasketballCourt· 6 leagues
CurlingCurlingSheet· 2 leagues
FootballFootballField· 4 leagues
HockeyHockeyRink· 11 leagues
LacrosseLacrosseField· 7 leagues
SoccerSoccerPitch· 5 leagues
SoftballSoftballField· 1 league
TennisTennisCourt· 6 leagues
VolleyballVolleyballCourt· 3 leagues
Cookbooks
Real analyses, start to finish: sportsdataverse-py loads the data, sdvplot brings the team colors and logos, and sportypy draws the surface and bins the data onto it. See them all.
Rule-book dimensions
A class per league, drawn to the dimensions in that league's rule book: the NHL, NFL, NBA, MLB, FIFA, the PLL and dozens more.
Plot your data on it
scatter, heatmap, contour, hexbin and arrow on the surface's own coordinates, kept inside its boundaries.
Any units, any view
Draw in the league's units or any other, rotate to a TV or a vertical view, and show the whole surface or just the part you need: an offensive half, a red zone, a house.
Your colors
update_colors() restyles every feature, and update_*_params() redraws a surface for a league sportypy doesn't ship yet.
Parity with sportyR
The same leagues, dimensions and colors as sportyR, checked point for point against what sportyR draws.
Part of the SportsDataverse
Pairs with sdvplot for team logos and colors, and with sdv-py for the play-by-play to put on the surface.


