Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyteamtv-0.41.1.tar.gz (50.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyteamtv-0.41.1-py3-none-any.whl (61.0 kB view details)

Uploaded Python 3

File details

Details for the file pyteamtv-0.41.1.tar.gz.

File metadata

  • Download URL: pyteamtv-0.41.1.tar.gz
  • Upload date:
  • Size: 50.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyteamtv-0.41.1.tar.gz
Algorithm Hash digest
SHA256 9a1510cd85f0b464bd5e055306f53f57337a00ec70117e1c83b6794a1d913e86
MD5 9fba3231e5df3fc7674f0c51b8aef115
BLAKE2b-256 39d6ad9526a608c5c5446ab0464a3eb5dd95f0c37d8b77a469af4112a217257f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyteamtv-0.41.1.tar.gz:

Publisher: release.yml on teamtv/pyteamtv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyteamtv-0.41.1-py3-none-any.whl.

File metadata

  • Download URL: pyteamtv-0.41.1-py3-none-any.whl
  • Upload date:
  • Size: 61.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyteamtv-0.41.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae07c3161c9f1f78e830d0e3731c60d6341978993d55e9d97c34013b7f8f7222
MD5 4715e70657f2c413ec1e558bc5d43974
BLAKE2b-256 1b52a8bb8ffc7f891e50c11fdbb3dae5341c18d93dd4d0060fdb9dc1fc69ff58

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyteamtv-0.41.1-py3-none-any.whl:

Publisher: release.yml on teamtv/pyteamtv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.41.1 This release

2 files

0.41.0

2 files

0.40.0

2 files

0.39.0

2 files

0.38.0

2 files

0.37.0

2 files

0.36.0

2 files

0.35.0

2 files

0.34.0

2 files

0.33.0

2 files

0.32.0

2 files

0.30.3

2 files

0.30.2

2 files

0.30.1

2 files

0.30.0

2 files

0.29.0

2 files

0.28.0

2 files

0.27.0

2 files

0.26.3

2 files

0.26.2

2 files

0.26.1

2 files

0.26.0

2 files

0.25.1

2 files

0.25.0

2 files

0.24.3

2 files

0.24.2

2 files

0.24.1

2 files

0.24.0

2 files

0.22.1

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.1

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.2

2 files

0.15.1

2 files

0.15.0

2 files

0.14.0

2 files

0.13.2

2 files

0.13.1

2 files

0.13.0

2 files

0.12.1

2 files

0.12.0

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

1 file

0.9.1

1 file

0.9.0

1 file

0.8.2

1 file

0.8.1

1 file

0.8.0

1 file

0.7.1

1 file

0.7.0

1 file

0.6.0

1 file

0.5.1

1 file

0.5.0

1 file

0.4.0

1 file

0.3.0

1 file

0.2.0

1 file

0.1.0

1 file

0.0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page