API for TeamTV Platform
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyteamtv-0.41.0.tar.gz.
File metadata
- Download URL: pyteamtv-0.41.0.tar.gz
- Upload date:
- Size: 50.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64044061e89d8f08cf4aa658cb73fe2283286d110d6f8a27842b6cd3460017d2
|
|
| MD5 |
893bfef914eb9db251345270acf7cc59
|
|
| BLAKE2b-256 |
65ca7b124d0f38047a42d0ceb6aa1e55cc68e08aa8fd07d5f065b07676188b21
|
Provenance
The following attestation bundles were made for pyteamtv-0.41.0.tar.gz:
Publisher:
release.yml on teamtv/pyteamtv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyteamtv-0.41.0.tar.gz -
Subject digest:
64044061e89d8f08cf4aa658cb73fe2283286d110d6f8a27842b6cd3460017d2 - Sigstore transparency entry: 1349787452
- Sigstore integration time:
-
Permalink:
teamtv/pyteamtv@62a3fbb3e3e208f9b4166a34e78127c29aca580e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/teamtv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@62a3fbb3e3e208f9b4166a34e78127c29aca580e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyteamtv-0.41.0-py3-none-any.whl.
File metadata
- Download URL: pyteamtv-0.41.0-py3-none-any.whl
- Upload date:
- Size: 60.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c19d3d44785924a95ead6bb549439ebc58041198b443909cb1333c944d56dcc1
|
|
| MD5 |
14af22ce19cfecbc8091e5a6c57ac5f0
|
|
| BLAKE2b-256 |
f7fac06f7ebd62eafe0c569ca208596ab7aa813713bdcb467d1b2f0544ec227c
|
Provenance
The following attestation bundles were made for pyteamtv-0.41.0-py3-none-any.whl:
Publisher:
release.yml on teamtv/pyteamtv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyteamtv-0.41.0-py3-none-any.whl -
Subject digest:
c19d3d44785924a95ead6bb549439ebc58041198b443909cb1333c944d56dcc1 - Sigstore transparency entry: 1349787511
- Sigstore integration time:
-
Permalink:
teamtv/pyteamtv@62a3fbb3e3e208f9b4166a34e78127c29aca580e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/teamtv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@62a3fbb3e3e208f9b4166a34e78127c29aca580e -
Trigger Event:
workflow_dispatch
-
Statement type: