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

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.1
File Size Uploaded Provenance Actions
statcast_bigquery-0.5.1.tar.gz 858.8 kB With provenance Details for statcast_bigquery-0.5.1.tar.gz

Built distribution (wheel)

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

Total release size: 926.1 kB

Release files / statcast_bigquery-0.5.1.tar.gz

Download URL statcast_bigquery-0.5.1.tar.gz
Size 858.8 kB
Tags Source
SHA-256 checksum
How to use checksums
02a846788312119c8ea8e111bcecf88652c7dda873c5c7cffd3be1072a7ebdcd
BLAKE2b-256 checksum
How to use checksums
a603ad4734a873a39c2e3293b9491d20080cc0661138d66e0c750e2a45884cf4
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 20, 2026.

Transparency log

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

Download URL statcast_bigquery-0.5.1-py3-none-any.whl
Size 67.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3e58560d1aa4728fe5a963d72e1d88a5b23438141e7fe98782077f82bd326cb
BLAKE2b-256 checksum
How to use checksums
e5c99e8c8d91161d0efcb488fcfa8243f41c57d362029184604c5b3b4c63a99b
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 20, 2026.

Transparency log

Security for statcast-bigquery 0.5.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.

Select from 2 files

Attestation for statcast_bigquery-0.5.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 Nov 20, 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