Skip to main content

chadwickpy

CI PyPI Docs

A pure-Python port of the Chadwick baseball tools: cwevent, cwgame, cwdaily, cwsub, cwcomment and cwbox. They read Retrosheet event files and write the same tables Chadwick does. No compiler, no C library, no dependencies: pip install chadwickpy.

The code is a function-by-function translation of Chadwick's C. Its output is byte-identical to the real tools on every season from 1910 to 2025 (all six tools; see Verification), apart from the differences below.

Install and use

pip install chadwickpy        # or: uv tool install chadwickpy
cwevent -y 2010 -f 0-96 2010NYA.EVA > 2010NYA.csv
cwgame -y 2010 2010NYA.EVA
chadwickpy cwbox -y 2010 2010NYA.EVA   # same tool, always this package's version
python -m chadwickpy cwdaily -y 2010 2010NYA.EVA

The command names and options are Chadwick's; see its documentation. If the C programs are also installed, whichever comes first on PATH runs; chadwickpy TOOL always runs this package. Roster (.ROS, TEAMyyyy) files are read from the event file's directory, as in Chadwick.

The library is importable too. The layout follows Chadwick's: chadwickpy (the cwlib parts: parser, game, file, roster, box score, game iterator) and chadwickpy.tools (the cwtools programs).

Speed

About 25 times slower than the C (cwevent on one team-season: 0.075 s in C, about 1.4 s here). That is the price of needing nothing but Python. Whole seasons still run in seconds to minutes.

Differences from Chadwick

  • Where the C crashes or reads uninitialised memory this port raises ValueError or uses a defined value. cwbox -S (it segfaults in Chadwick 0.10.0) and the pb attribute of cwbox -X are compared against a patched build.
  • The reference is Chadwick's development commit c685ab5 (it reports 0.10.0), not the released v0.10.0 tag, whose output differs on 2025 files.
  • Inputs that make the C behave in undefined ways are not compared.

Verification

tests/ runs every tool against captured real-Chadwick output and, when Chadwick is available, against the real programs (set CHADWICK_BIN and CHADWICK_SRC, or build Chadwick at c685ab5; CI does). Season-sweep drivers in tests/reference/ compare whole seasons; they need the Retrosheet decade zips. Run: uv run pytest.

Licence and credit

GPL-3.0-or-later (LICENSE). This package is a derivative work of Chadwick, Copyright (C) 2002-2023 Dr T L Turocy and the Chadwick Baseball Bureau, GPL-2.0-or-later (COPYING-chadwick, NOTICE); each ported module keeps that notice. chadwickpy is independent: it is not endorsed or sponsored by Chadwick or Retrosheet, and ships no Retrosheet data.

Retrosheet's data-use notice asks that anyone using its data say so. If you publish anything built on it, include:

The information used here was obtained free of charge from and is copyrighted by Retrosheet. Interested parties may contact Retrosheet at "www.retrosheet.org".

Contributing and security

See CONTRIBUTING.md and SECURITY.md. A rule of this project: the port stays a translation of Chadwick's C. Rules are taken from the C, never guessed from output.

Metadata

Release files for chadwickpy 0.1.0

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

Source distribution (sdist)

Source distribution for chadwickpy 0.1.0
File Size Uploaded
chadwickpy-0.1.0.tar.gz 245.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chadwickpy 0.1.0
File Interpreter ABI Platform
chadwickpy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 360.9 kB

Release files / chadwickpy-0.1.0.tar.gz

Download URL chadwickpy-0.1.0.tar.gz
Size 245.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0a950dc971bc07a5311910915eaaafa2cea020ebce220bd844454bda4215a949
BLAKE2b-256 checksum
How to use checksums
bdee277c58d69e1f40ca1852d5fa07d3345d931a435dc0effac94e9799bcf0fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 5, 2026.

Transparency log

Release files / chadwickpy-0.1.0-py3-none-any.whl

Download URL chadwickpy-0.1.0-py3-none-any.whl
Size 115.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92b1e70c6130cc0c9e024770ac9176453a2692d7a3e3fee021e789fd5d2db40b
BLAKE2b-256 checksum
How to use checksums
24138403eb1a2d6623fd06a3f61f0be9c4af6bf3b2a9c34b2e7f720c53496581
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

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