USA Swimming meet result (.cl2 / SDIF v3) parser and analysis library
Project description
tunas
A Python library for parsing and analyzing USA Swimming meet result files (.cl2 / Hy-Tek SDIF v3).
tunas parses .cl2 files into clean, idiomatic Python objects (Meet, Club, Swimmer, IndividualSwim, Relay) and bundles USA Swimming time standards for offline qualifying-time lookups.
Install
pip install tunas
Requires Python 3.12+ and has zero third-party runtime dependencies.
Quick example
from tunas import read_cl2
meets, report = read_cl2("results.cl2")
for meet in meets:
print(f"{meet.name} ({meet.start_date})")
for swim in meet.individual_swims:
outcome = swim.time if swim.time is not None else swim.status.value # DQ / NS / ...
print(f" {swim.swimmer.full_name:<24} {swim.event.name:<16} {outcome}")
if report.warnings:
print(f"{len(report.warnings)} records flagged — see report.warnings")
read_cl2 parses files into self-contained Meet objects and a ParseReport. Swimmers are scoped to each meet; reconcile cross-meet swimmers by grouping on id_short or id_long in your application.
Features
- SDIF v3 Parser: Parses
.cl2meet result files including relays (E0/F0) and splits (G0). - Self-Contained Meets: No global state or cross-file merging; parsing is a pure function of input bytes.
- Clean Object Model: Slotted dataclasses with direct object references (swimmers, clubs, swims, splits, and contact/registration data).
- Offline Time Standards: Local lookup of USA Swimming B through AAAA motivational cuts.
- Lenient Parsing: Recovers from data-quality issues by default with a detailed
ParseReport. Opt-instrict=Trueraises on the first violation. - Type-Safe: Fully typed and carries the
py.typedmarker.
Documentation
Full documentation is available in docs/:
- Getting started
- Architecture
- Parsing · Models · Time · Event · Enums · Exceptions · Standards
- CL2 / SDIF v3 format · Cookbook
Development
Managed with uv (Python 3.12+):
uv sync # set up the environment
uv run pytest # run the (offline, self-contained) test suite
uv run pytest --cov=tunas # with coverage (gated at 95%)
uv run ruff check && uv run mypy src/tunas # lint + type-check
See docs/architecture.md for the full workflow and the release process.
Status
tunas is in alpha. The API documented in docs/ is stable, but breaking changes may occur before 1.0 based on real-world feedback.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tunas-0.1.0.tar.gz.
File metadata
- Download URL: tunas-0.1.0.tar.gz
- Upload date:
- Size: 69.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f45ce25505db6bcfee9c380a884ff39f88fdf92ad6227f841718c14e2767a0c8
|
|
| MD5 |
ab0eeab43964b5120ede3dd525c5c21d
|
|
| BLAKE2b-256 |
0160645e2dae7c63d506a1594f01f7da5f030f2ed9c3ed655941edbce05d9316
|
Provenance
The following attestation bundles were made for tunas-0.1.0.tar.gz:
Publisher:
publish.yml on ajoe2/tunas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tunas-0.1.0.tar.gz -
Subject digest:
f45ce25505db6bcfee9c380a884ff39f88fdf92ad6227f841718c14e2767a0c8 - Sigstore transparency entry: 1621103981
- Sigstore integration time:
-
Permalink:
ajoe2/tunas@2151058ab977178e879882e8ef136e5d9ba8a607 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ajoe2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2151058ab977178e879882e8ef136e5d9ba8a607 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tunas-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tunas-0.1.0-py3-none-any.whl
- Upload date:
- Size: 75.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74a2e10c256c74da0aefe4cf5b4263194d7bdda50859ee764c96b5527c71af90
|
|
| MD5 |
612c5c109d438b5451b34124719ae437
|
|
| BLAKE2b-256 |
16b7cbe19097ff7228c16b26ab36ec86fc0733cf681de7f9ae2374017a49aacb
|
Provenance
The following attestation bundles were made for tunas-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ajoe2/tunas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tunas-0.1.0-py3-none-any.whl -
Subject digest:
74a2e10c256c74da0aefe4cf5b4263194d7bdda50859ee764c96b5527c71af90 - Sigstore transparency entry: 1621104077
- Sigstore integration time:
-
Permalink:
ajoe2/tunas@2151058ab977178e879882e8ef136e5d9ba8a607 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ajoe2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2151058ab977178e879882e8ef136e5d9ba8a607 -
Trigger Event:
release
-
Statement type: