retrosheetpy
Fast, strongly-typed Retrosheet baseball data downloader, parser, and database ingestor.
retrosheetpy brings modern data workflows to Retrosheet baseball archives. It enables baseball researchers, analysts, professors, and DBAs to download, parse, and ingest play-by-play events, historical game logs, rosters, and ballparks directly into DuckDB, Parquet, Polars, pandas, and SQL databases with strongly-typed schemas (integers, dates, booleans—never raw text dumps).
Powered by chadwickpy for multi-core play-by-play parsing with zero C compiler dependencies.
Unified Ingestion & Querying
One API to download, parse, and stream baseball data into your favorite analytical stack:
Why retrosheetpy?
flowchart LR
A["Retrosheet.org\n(HTTP Archives)"] --> B["Smart Cache\n(~/.cache/retrosheetpy)"]
B --> C["Typed Parsers\n(chadwickpy + Arrow)"]
C --> D1["DuckDB\n(Analytics)"]
C --> D2["Parquet / Arrow\n(Data Lake)"]
C --> D3["Polars / pandas\n(In-Memory)"]
C --> D4["Postgres / Cloud\n(via dlt)"] - Zero C Compiler Required: 100% pure Python / PyArrow wheels. Installable on Windows, macOS, and Linux in seconds with
piporuv. - Explicit, Strongly Typed Schemas: Dates are parsed to
DATE, counts and scores toINTEGER, flags toBOOLEAN. No untyped string conversions or silent failures. - Smart Bandwidth Caching: Downloads once to
~/.cache/retrosheetpy/with atomic writes, respecting Retrosheet server bandwidth. - Pre-Existing Table Alignment: When ingesting into existing database tables, columns are automatically mapped by name—only matching columns are inserted.
- Complete Retrosheet Catalog: Regular season Events (play-by-play), Postseason, All-Star games, Game Logs (1871–present), Rosters, Ballparks, Schedules, Biographical encyclopedia, Ejections, and Player Transactions.
The Retrosheet Notice
The information used in this project was obtained free of charge from and is copyrighted by Retrosheet. Interested parties may contact Retrosheet at www.retrosheet.org.