pyteamtv
Python SDK for the TeamTV platform.
Quick start
pip install pyteamtv pyiceberg[s3fs] polars
Set TEAMTV_API_TOKEN in your environment or .env file.
Working with observation data (Polars)
Use get_catalog() to access observation data as a Polars DataFrame.
This returns pre-materialised data — fast and filterable.
from pyteamtv import get_team
import polars as pl
team = get_team("My Team")
catalog = team.get_catalog()
df = catalog.load_table("observations").scan().to_polars()
# Filter to shots
shots = df.filter(pl.col("code") == "SHOT")
# Group by player
shots.group_by("full_name").len().sort("len", descending=True)
# Filter to a specific match
match = df.filter(pl.col("sporting_event_name") == "Team A - Team B")
# Distinguish own vs shared data
own = df.filter(pl.col("source_resource_group_id") == team.resource_group_id)
shared = df.filter(pl.col("source_resource_group_id") != team.resource_group_id)
Use with DuckDB
table = catalog.load_table("observations")
con = table.scan().to_duckdb("observations")
con.sql("SELECT code, COUNT(*) FROM observations GROUP BY code").show()
Available columns
| Column | Description |
|---|---|
sporting_event_id |
Match UUID |
sporting_event_name |
Match name (e.g. "Team A - Team B") |
sporting_event_scheduled_at |
Scheduled time (UTC) |
observation_id |
Observation UUID |
code |
Observation type (e.g. SHOT, POSSESSION, CUSTOM) |
description |
Free-text description |
start_time, end_time |
Timing (seconds) |
clock_id |
Clock identifier |
team_id, team_name, team_ground |
Team context |
person_id, first_name, last_name, full_name, number |
Primary person |
attributes |
Raw observation attributes (JSON string) |
persons |
Additional persons by role (JSON string) |
source_resource_group_id, source_resource_group_name |
Data provenance |
enrichment, enrichment_version |
Computed fields (JSON string) |
Examples
See pyteamtv/examples/analyze_observations.py for a complete working script.
Metadata
Release files for pyteamtv 0.41.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyteamtv-0.41.1.tar.gz | 50.8 kB | With provenance | Details for pyteamtv-0.41.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyteamtv-0.41.1-py3-none-any.whl | Python 3 | none | any | Details for pyteamtv-0.41.1-py3-none-any.whl |
Total release size: 111.8 kB
Release files / pyteamtv-0.41.1.tar.gz
| Download URL | pyteamtv-0.41.1.tar.gz |
|---|---|
| Size | 50.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a1510cd85f0b464bd5e055306f53f57337a00ec70117e1c83b6794a1d913e86
|
|
BLAKE2b-256 checksum How to use checksums |
39d6ad9526a608c5c5446ab0464a3eb5dd95f0c37d8b77a469af4112a217257f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.
Transparency logRelease files / pyteamtv-0.41.1-py3-none-any.whl
| Download URL | pyteamtv-0.41.1-py3-none-any.whl |
|---|---|
| Size | 61.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae07c3161c9f1f78e830d0e3731c60d6341978993d55e9d97c34013b7f8f7222
|
|
BLAKE2b-256 checksum How to use checksums |
1b52a8bb8ffc7f891e50c11fdbb3dae5341c18d93dd4d0060fdb9dc1fc69ff58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.
Transparency logSecurity for pyteamtv 0.41.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pyteamtv-0.41.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.