Skip to main content

statcast-bigquery

Idempotent Statcast → BigQuery ingestion, with first-class documentation for SQL/LLM agents and round-trip validation against Baseball Savant.

Install

pip install statcast-bigquery

Quickstart

gcloud auth application-default login
statcast-bigquery sync \
    --start 2024-04-01 --end 2024-10-31 \
    --table myproject.mydataset.statcast_pitches

Backfill

Backfill historical seasons in resumable chunks:

statcast-bigquery sync \
    --start 2015-04-01 --end 2026-05-11 \
    --chunk-by year --resume \
    --table myproject.mydataset.statcast_pitches

--resume skips chunks already recorded as success in <dataset>._statcast_ingest_runs. Override with --runs-table if you want the run log in a sidecar dataset. Re-running with the same --chunk-by is safe; switching --chunk-by year → month between runs will re-process (chunks must match exactly to skip).

Documentation

statcast-bigquery docs --format llm > STATCAST_FOR_LLMS.md

Seed your data dictionary

If you maintain a data_dictionary table (one row per column with business definitions, tags, lineage), you can seed it directly:

statcast-bigquery docs --format dictionary --apply \
    --dataset mydataset --table myproject.mydataset.statcast_pitches \
    --dictionary-table myproject.shared_ops.data_dictionary

Atomically replaces rows for (dataset, table) only; other entries in the dictionary table are untouched. Required target schema:

dataset, table, column, dtype, description, business_definition,
owner, tags ARRAY<STRING>, source_system, upstream_lineage_json,
created_at TIMESTAMP, updated_at TIMESTAMP

Verification

statcast-bigquery verify \
    --source baseball-savant \
    --aggregation player-season \
    --metric all --season 2024 \
    --table myproject.mydataset.statcast_pitches

Standings verify

End-to-end integrity check: reconstruct each team's season standings from the pitch data and compare against MLB statsapi:

statcast-bigquery verify \
    --source baseball-savant \
    --aggregation team-season \
    --metric all --season 2024 \
    --table myproject.mydataset.statcast_pitches

Three metrics are checked per team: wins, losses, run_diff. Default tolerances are ±1 game and ±5 runs. A passing run gives high confidence that no games are missing from the pitch ingest.

MIT licensed. This software does not include or distribute MLB data.

Metadata

Release files for statcast-bigquery 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for statcast-bigquery 0.5.2
File Size Uploaded Provenance Actions
statcast_bigquery-0.5.2.tar.gz 860.9 kB With provenance Details for statcast_bigquery-0.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for statcast-bigquery 0.5.2
File Interpreter ABI Platform Actions
statcast_bigquery-0.5.2-py3-none-any.whl Python 3 none any Details for statcast_bigquery-0.5.2-py3-none-any.whl

Total release size: 929.1 kB

Release files / statcast_bigquery-0.5.2.tar.gz

Download URL statcast_bigquery-0.5.2.tar.gz
Size 860.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c704fa9e13e6d546b828af58690d32538789a16ba7c72b2881316e877c0c0288
BLAKE2b-256 checksum
How to use checksums
d8d55042612b4b9d0bc88916be78cf5a64d04fe37a31a41956baad541a96b132
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 21, 2026.

Transparency log

Release files / statcast_bigquery-0.5.2-py3-none-any.whl

Download URL statcast_bigquery-0.5.2-py3-none-any.whl
Size 68.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8278243b1a544590def358d8b8314e7dcad67dc0430d41dcdd2fc4264af2c0b8
BLAKE2b-256 checksum
How to use checksums
6c5524fc0a11742fdcab971c4714df38dd005b4e8af684eebb0ca9fbc807f009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 21, 2026.

Transparency log

Security for statcast-bigquery 0.5.2

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.

Select from 2 files

Attestation for statcast_bigquery-0.5.2.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 Nov 21, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page