sdvplot 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. sdvplot/__init__.py +68 -0
  2. sdvplot/_cache.py +484 -0
  3. sdvplot/_colors.py +206 -0
  4. sdvplot/_contrast.py +60 -0
  5. sdvplot/_court.py +110 -0
  6. sdvplot/_deprecate.py +39 -0
  7. sdvplot/_dispatch.py +342 -0
  8. sdvplot/_errors.py +93 -0
  9. sdvplot/_headshots.py +131 -0
  10. sdvplot/_images.py +292 -0
  11. sdvplot/_index.py +178 -0
  12. sdvplot/_lazy.py +15 -0
  13. sdvplot/_manifest.py +73 -0
  14. sdvplot/_marks.py +296 -0
  15. sdvplot/_normalize.py +82 -0
  16. sdvplot/_placement.py +168 -0
  17. sdvplot/_resolve.py +363 -0
  18. sdvplot/_surface.py +220 -0
  19. sdvplot/_tables.py +87 -0
  20. sdvplot/_tiers.py +135 -0
  21. sdvplot/_types.py +38 -0
  22. sdvplot/_versions.py +30 -0
  23. sdvplot/_web.py +61 -0
  24. sdvplot/altair.py +652 -0
  25. sdvplot/bokeh.py +323 -0
  26. sdvplot/data/INDEX_VERSION +1 -0
  27. sdvplot/data/aliases.parquet +0 -0
  28. sdvplot/data/teams.parquet +0 -0
  29. sdvplot/folium.py +316 -0
  30. sdvplot/great_tables/__init__.py +267 -0
  31. sdvplot/great_tables/_cells.py +1814 -0
  32. sdvplot/great_tables/_export.py +844 -0
  33. sdvplot/great_tables/_layout.py +1802 -0
  34. sdvplot/great_tables/_marks.py +798 -0
  35. sdvplot/great_tables/_themes.py +2134 -0
  36. sdvplot/holoviews.py +303 -0
  37. sdvplot/matplotlib.py +934 -0
  38. sdvplot/plotly.py +595 -0
  39. sdvplot/plotnine.py +1104 -0
  40. sdvplot/plottable.py +141 -0
  41. sdvplot/py.typed +0 -0
  42. sdvplot/pygal.py +416 -0
  43. sdvplot/reactable.py +488 -0
  44. sdvplot/testing.py +579 -0
  45. sdvplot/typing.py +21 -0
  46. sdvplot-0.1.0.dist-info/METADATA +188 -0
  47. sdvplot-0.1.0.dist-info/RECORD +49 -0
  48. sdvplot-0.1.0.dist-info/WHEEL +4 -0
  49. sdvplot-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,188 @@
1
+ Metadata-Version: 2.5
2
+ Name: sdvplot
3
+ Version: 0.1.0
4
+ Summary: Team logos, wordmarks, headshots and colors for Python plots and tables (SportsDataverse)
5
+ Project-URL: Homepage, https://sdvplot.sportsdataverse.org/
6
+ Project-URL: Documentation, https://sdvplot.sportsdataverse.org/
7
+ Project-URL: Repository, https://github.com/sportsdataverse/sdvplot
8
+ Project-URL: Bug Tracker, https://github.com/sportsdataverse/sdvplot/issues
9
+ Project-URL: Changelog, https://sdvplot.sportsdataverse.org/CHANGELOG
10
+ Author: Saiem Gilani
11
+ Maintainer: Saiem Gilani, SportsDataverse
12
+ License-Expression: MIT
13
+ License-File: LICENSE
14
+ Keywords: altair,logos,matplotlib,plotly,sports,sportsdataverse,team colors
15
+ Classifier: Development Status :: 3 - Alpha
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Topic :: Scientific/Engineering :: Visualization
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.10
27
+ Requires-Dist: narwhals>=2.0
28
+ Requires-Dist: pillow>=12.3
29
+ Requires-Dist: platformdirs>=4
30
+ Requires-Dist: polars<2,>=1.24
31
+ Requires-Dist: requests>=2.33
32
+ Requires-Dist: urllib3>=2.6
33
+ Provides-Extra: all
34
+ Requires-Dist: altair>=5.1; extra == 'all'
35
+ Requires-Dist: bokeh>=3.8.2; extra == 'all'
36
+ Requires-Dist: folium>=0.19; extra == 'all'
37
+ Requires-Dist: great-tables>=1.0; extra == 'all'
38
+ Requires-Dist: holoviews>=1.18; extra == 'all'
39
+ Requires-Dist: htmltools>=0.4.1; extra == 'all'
40
+ Requires-Dist: matplotlib>=3.7; extra == 'all'
41
+ Requires-Dist: mplsoccer>=1.2; extra == 'all'
42
+ Requires-Dist: nokap>=0.1; extra == 'all'
43
+ Requires-Dist: plotly>=5.14; extra == 'all'
44
+ Requires-Dist: plotnine>=0.15; extra == 'all'
45
+ Requires-Dist: plottable>=0.1.5; extra == 'all'
46
+ Requires-Dist: pygal>=3.0.1; extra == 'all'
47
+ Requires-Dist: reactable>=0.1.6; extra == 'all'
48
+ Requires-Dist: resvg-py>=0.2.5; extra == 'all'
49
+ Requires-Dist: sportypy>=1.0; extra == 'all'
50
+ Provides-Extra: altair
51
+ Requires-Dist: altair>=5.1; extra == 'altair'
52
+ Provides-Extra: bokeh
53
+ Requires-Dist: bokeh>=3.8.2; extra == 'bokeh'
54
+ Provides-Extra: folium
55
+ Requires-Dist: folium>=0.19; extra == 'folium'
56
+ Provides-Extra: holoviews
57
+ Requires-Dist: bokeh>=3.8.2; extra == 'holoviews'
58
+ Requires-Dist: holoviews>=1.18; extra == 'holoviews'
59
+ Provides-Extra: mpl
60
+ Requires-Dist: matplotlib>=3.7; extra == 'mpl'
61
+ Provides-Extra: plotly
62
+ Requires-Dist: plotly>=5.14; extra == 'plotly'
63
+ Provides-Extra: plotnine
64
+ Requires-Dist: plotnine>=0.15; extra == 'plotnine'
65
+ Provides-Extra: plottable
66
+ Requires-Dist: plottable>=0.1.5; extra == 'plottable'
67
+ Provides-Extra: pygal
68
+ Requires-Dist: pygal>=3.0.1; extra == 'pygal'
69
+ Provides-Extra: reactable
70
+ Requires-Dist: reactable>=0.1.6; extra == 'reactable'
71
+ Provides-Extra: surfaces
72
+ Requires-Dist: mplsoccer>=1.2; extra == 'surfaces'
73
+ Requires-Dist: sportypy>=1.0; extra == 'surfaces'
74
+ Provides-Extra: svg
75
+ Requires-Dist: resvg-py>=0.2.5; extra == 'svg'
76
+ Provides-Extra: tables
77
+ Requires-Dist: great-tables>=1.0; extra == 'tables'
78
+ Requires-Dist: htmltools>=0.4.1; extra == 'tables'
79
+ Requires-Dist: nokap>=0.1; extra == 'tables'
80
+ Description-Content-Type: text/markdown
81
+
82
+ # sdvplot <a href='https://sdvplot.sportsdataverse.org/'><img src='https://raw.githubusercontent.com/sportsdataverse/sdvplot/main/docs/static/img/sdvplot-logo.png' align="right" width="25%" min-width="120px" alt="sdvplot hex logo" /></a>
83
+
84
+ [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
85
+ [![Docs](https://img.shields.io/badge/docs-sdvplot.sportsdataverse.org-blue)](https://sdvplot.sportsdataverse.org)
86
+
87
+ Team logos, wordmarks, headshots and colors for Python plots and tables, from the SportsDataverse logo archive. It
88
+ resolves team abbreviations, names and provider ids across 28 leagues and picks the right era's mark for a season. Colors
89
+ and logos work with any library through `palette()`, `team_colors()`, `logo_url()` and `logo_image()`, and the
90
+ `add_logos()`, `add_wordmarks()` and `add_headshots()` adapters draw them on matplotlib (and seaborn), plotnine, plotly,
91
+ altair, bokeh, holoviews, great_tables, folium and pygal plots, tables and maps. `sdvplot.great_tables` also ports
92
+ sdvplotR's table themes, cell styling, legends and image export, and `surface()` draws a league's field, court or rink
93
+ in a team's colors. The Python counterpart to [sdvplotR](https://sdvplotR.sportsdataverse.org/). See
94
+ [CHANGELOG](https://github.com/sportsdataverse/sdvplot/blob/main/CHANGELOG.md).
95
+
96
+ ## Installation
97
+
98
+ ```bash
99
+ pip install sdvplot
100
+ # or
101
+ uv add sdvplot
102
+ ```
103
+
104
+ Plotting libraries are optional extras, for example
105
+ `pip install "sdvplot[mpl]"`. Each extra adds the libraries for one feature: `[svg]` lets `logo_image()`
106
+ rasterize SVG marks. With `[mpl]`, `[plotnine]`, `[plotly]`, `[altair]`, `[bokeh]`, `[holoviews]`, `[tables]`,
107
+ `[folium]` or `[pygal]`, `add_logos()`, `add_wordmarks()` and `add_headshots()` draw on that library's plots, tables and
108
+ maps; `axis_logos()` works on matplotlib, seaborn, plotnine, Plotly and Altair. `[surfaces]` is for `surface()`, and
109
+ `[reactable]` and `[plottable]` add column helpers (`sdvplot.reactable`, `sdvplot.plottable`).
110
+
111
+ | Extra | Adds |
112
+ | --- | --- |
113
+ | `[mpl]` | matplotlib |
114
+ | `[plotnine]` | plotnine |
115
+ | `[plotly]` | plotly |
116
+ | `[altair]` | altair |
117
+ | `[bokeh]` | bokeh |
118
+ | `[holoviews]` | holoviews |
119
+ | `[tables]` | great_tables |
120
+ | `[reactable]` | reactable (reactable-py) |
121
+ | `[folium]` | folium |
122
+ | `[svg]` | resvg-py, for SVG marks |
123
+ | `[surfaces]` | sportypy and mplsoccer |
124
+ | `[plottable]` | plottable |
125
+ | `[pygal]` | pygal |
126
+ | `[all]` | everything above |
127
+
128
+ ## Get started
129
+
130
+ ```python
131
+ import sdvplot
132
+
133
+ sdvplot.resolve(["LV", "OAK", "Las Vegas Raiders"], "nfl") # ['13', '13', '13']
134
+ sdvplot.palette("nfl", teams=["LV", "KC"]) # {'LV': '#000000', 'KC': '#e31837'}
135
+ sdvplot.logo_url("OAK", "nfl", season=2010) # the Oakland-era mark
136
+ img = sdvplot.logo_image("LV", "nfl", size=128) # a PIL image
137
+ ```
138
+
139
+ Colors work in any library that takes a `{value: color}` mapping, for example seaborn:
140
+ `sns.barplot(data=df, x="team", y="epa", hue="team", palette=sdvplot.palette("nfl", teams=df["team"]))`.
141
+
142
+ `teams()` records where each team's colors come from in `color_source`: `nflverse` or `espn` when that source
143
+ publishes them, `logo` when they are derived from the team's archived logo because no source does, and `fallback` for
144
+ a placeholder that is not the team's colors.
145
+
146
+ ## Environment variables
147
+
148
+ - `SDVPLOT_CACHE_DIR`: cache root.
149
+ - `SDVPLOT_CACHE_TTL`: cache lifetime in days (default 7).
150
+ - `SDVPLOT_LIVE_TESTS=1`: enable the network tests.
151
+
152
+ ## Documentation
153
+
154
+ - [Docs site](https://sdvplot.sportsdataverse.org) with concepts, tutorials and the API reference.
155
+ - [Changelog](https://github.com/sportsdataverse/sdvplot/blob/main/CHANGELOG.md).
156
+ - [Contributing](https://github.com/sportsdataverse/sdvplot/blob/main/CONTRIBUTING.md).
157
+
158
+ ## Logos, trademarks and data
159
+
160
+ Team names, logos, wordmarks and player headshots are trademarks or copyrighted works of their respective leagues,
161
+ teams, schools and other rights holders. sdvplot is not affiliated with, sponsored by or endorsed by any of them, and
162
+ using sdvplot to draw a mark grants no right to use it. The package ships no logo files: the wheel carries only an
163
+ index of team names, ids and colors, and marks are fetched at runtime from the
164
+ [SportsDataverse logo archive](https://github.com/sportsdataverse/sdv-assets), headshots from ESPN (or, for NFL gsis
165
+ ids, the URLs in nflverse's player table). Use of any mark in your own work is
166
+ governed by that owner's terms, and following them is your responsibility. The [MIT license](https://github.com/sportsdataverse/sdvplot/blob/main/LICENSE)
167
+ covers the sdvplot code only; team data belongs to its respective owners and sources.
168
+
169
+ ## Companion packages
170
+
171
+ - [sdvplotR](https://sdvplotR.sportsdataverse.org/): the R package this one mirrors.
172
+ - [sdv-py](https://py.sportsdataverse.org/): SportsDataverse data for Python.
173
+ - [sportypy](https://sportypy.sportsdataverse.org/): sports surfaces for Python plots.
174
+
175
+ ## Citations
176
+
177
+ To cite [**`sdvplot`**](https://sdvplot.sportsdataverse.org) in publications, use:
178
+
179
+ BibTex Citation
180
+
181
+ ```bibtex
182
+ @misc{gilani_2026_sdvplot,
183
+ author = {Gilani, Saiem},
184
+ title = {sdvplot: Team logos, wordmarks, headshots and colors for Python plots and tables},
185
+ url = {https://sdvplot.sportsdataverse.org},
186
+ year = {2026}
187
+ }
188
+ ```
@@ -0,0 +1,49 @@
1
+ sdvplot/__init__.py,sha256=NOy3y_KocmQt5M0miSFUuURnWExwwt9SsgCOJBeGbm0,1800
2
+ sdvplot/_cache.py,sha256=L1_B0fSi5sjxyQCGQkmi_C9UI909Eh1TK0XyknWl2fY,21745
3
+ sdvplot/_colors.py,sha256=k98JUzSfuGBFB-tPvcb77Wp4sFrUxtzteYupmlxvCGU,8139
4
+ sdvplot/_contrast.py,sha256=uYhxHqtZ5buAok5vmNEilA7QQT48p24XQy804caavfM,2887
5
+ sdvplot/_court.py,sha256=V8cdSDxYtnBChi18r85Rmanh6EKd6c46kdZa_1dpHc0,5903
6
+ sdvplot/_deprecate.py,sha256=IiZq9RequW0TOLqsdAxVgaO0iDOu-ELFQiWjRcszIM0,1747
7
+ sdvplot/_dispatch.py,sha256=irWy-5fP-EQ1dFmQOfwG9J1v8pkFcEXzcT3coeI1O74,19575
8
+ sdvplot/_errors.py,sha256=DNOuqZia4YEbFkxX2UrwuTSYsMuGv0gynlFDsWt__Wc,4006
9
+ sdvplot/_headshots.py,sha256=DJ4v0Qhp3mUDDeglHxvSduUA3kTvHayF2QovsJSrRC4,5257
10
+ sdvplot/_images.py,sha256=HiCTsp6q_lsEFI-FApk_fQKWvCEB2zwstWmXDUqz-cc,12659
11
+ sdvplot/_index.py,sha256=z_c30n-C9Hp8TCEXeo7DzQdg5n0fByL7_h-eYarQ8dE,6411
12
+ sdvplot/_lazy.py,sha256=I6Hbu10X1pvppe1KTP0vML21oHlQgfzWpsCxzn01lM0,316
13
+ sdvplot/_manifest.py,sha256=5pdrCP71juna6SJsCDfvqFPeTbKyunJ_L8GbN--HVxY,2600
14
+ sdvplot/_marks.py,sha256=V51fXEmfaMuMfypKssKTcUXsTDL-c21Qmb59lOsnBw8,13206
15
+ sdvplot/_normalize.py,sha256=xYKEMiBcMuLB3UZx6lt3fcm-YpWQd6FIEDKED_iGAXY,3301
16
+ sdvplot/_placement.py,sha256=G9Sow6OyqwN4JlPr7dfFd5MI_3R-RC5H_wumXy1_ZkU,7304
17
+ sdvplot/_resolve.py,sha256=vP1Rmscibg3qwK_iTCeF0-wDYAJE_kiJTxzVni95uWA,15445
18
+ sdvplot/_surface.py,sha256=pgFlwvlTsCnIk1_4zZaVu-6Zl4nbXr9xmrQrYOnI2K4,10252
19
+ sdvplot/_tables.py,sha256=usu2-FWxj-RDmgQZcNEuXHCyK5AxHtdvuG5YUi0B28g,3717
20
+ sdvplot/_tiers.py,sha256=QMI_6CgImuBtmPr_zW_D4atDq2xJwRHX-NrpKFD_KBU,6391
21
+ sdvplot/_types.py,sha256=22xtZtooUbKiHT1q66HxcbIPARh0HeOoXvAt361xJHo,1235
22
+ sdvplot/_versions.py,sha256=4L9o4C15EW9Z0RiGyurfXRoSYMQ5jeXLJkrJnUJ--JI,970
23
+ sdvplot/_web.py,sha256=01sO_PX7LTLnR74UH-2PGTSr3g_BMGl6WoNg1usRnEY,2643
24
+ sdvplot/altair.py,sha256=NOkXDAaG5j08FzG71fSgiuiYkCap_Ev7Qk8lckIHNPA,29717
25
+ sdvplot/bokeh.py,sha256=APwaetY6WyaKnkWcDsBLRYzaXn_dogr8lWYKoJomgQ8,13319
26
+ sdvplot/folium.py,sha256=IXlMfQt5gP0YNngJtuGjkegfptZiELvQz6QaHiKFsL0,12383
27
+ sdvplot/holoviews.py,sha256=3XkzUOFfHh0fCWOASbg0z6b5fVdOBEmZqgDelVBlt-w,12421
28
+ sdvplot/matplotlib.py,sha256=sQNiAsDPUyGlizcqhuI93F3PyCIEokD-gmVQO5UJobI,43821
29
+ sdvplot/plotly.py,sha256=RYuPT-2dS8_h7rbcQwpZ3avjPU9iR8iJtHARXBGcBkU,27926
30
+ sdvplot/plotnine.py,sha256=XJWb4A08zuCrAYEPf317TRAI1pS-1xvk_fNOG4eIVUU,51575
31
+ sdvplot/plottable.py,sha256=l055fHY6uEk0Ineeg1NUVssLWHaFqtdePUTBOTfURiI,5702
32
+ sdvplot/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
+ sdvplot/pygal.py,sha256=MsZI3l6r6UFITDKwfwPhYRcJzosD6l-X68naaG1mufU,18037
34
+ sdvplot/reactable.py,sha256=z7qi8PVM6Y6fmvvq8Ls0_7VmpmodG2nPyRRusKWL3H0,20478
35
+ sdvplot/testing.py,sha256=iYMpWwaUzp8SEqbQGQ2ZBlY_DtnvoB6hnRfMuYF35RU,28656
36
+ sdvplot/typing.py,sha256=D7hJkTn9rjJ2ZD9IDvlAE5qaZO13qpqVONTxBTWFXTI,779
37
+ sdvplot/data/INDEX_VERSION,sha256=SDR0zYmUAjTwHsEfvXzMxchlyoSyQMcYTwiRLP0FRuA,13
38
+ sdvplot/data/aliases.parquet,sha256=vCI-gOXLIMTDlof5TqZfifEFuGBf73Z0hYkGlDn1MC8,200988
39
+ sdvplot/data/teams.parquet,sha256=0v1UR5XTLPLtcxbOLseDFQt8i8Cv3Rt1S--esMS66Ig,123744
40
+ sdvplot/great_tables/__init__.py,sha256=uk08XJm6Bz5vdxP6igi-MMbQeBsKsmRutnqDWAd0czQ,7573
41
+ sdvplot/great_tables/_cells.py,sha256=_zZRBXKaJPcl_ol96lf1hje4yEkiHJt-EAmOxCAeuHc,73600
42
+ sdvplot/great_tables/_export.py,sha256=p-a8CcYcv6wRRoxKqmYqGel8Zz6yibZv2tTy9Mc0J8s,36523
43
+ sdvplot/great_tables/_layout.py,sha256=O8d4k-iGGDtCL44nCWAbHwsr7wF2jgk0-lfNJrAXin8,77918
44
+ sdvplot/great_tables/_marks.py,sha256=NVSiDZ9C1C38PUUHtcS2xkOutwu8977BgVjP0q8mJ8U,35865
45
+ sdvplot/great_tables/_themes.py,sha256=gDDLFAvnajYH2IzXjoxKVpsDk_eqIAdMcQBYYX4OSEg,91569
46
+ sdvplot-0.1.0.dist-info/METADATA,sha256=o7KJll0Dh5IGkmSnDRBUPBhgwZ4039N17yYOwJRSqBk,8647
47
+ sdvplot-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
48
+ sdvplot-0.1.0.dist-info/licenses/LICENSE,sha256=llGQBA8uOMP-hqaJ2dFyl-WOkuovpKV1oyBGsi-WzWA,1069
49
+ sdvplot-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Saiem Gilani
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.