tunas¶
A Python library for parsing USA Swimming meet result files (.cl2 / SDIF v3 and Hy-Tek .hy3) into structured Python objects and querying offline motivational time standards.
tunas parses results files into clean, idiomatic objects — Meet, Club, Swimmer, IndividualSwim, and Relay. Parsing is lenient by default, collecting warnings in a ParseReport to prevent data loss.
Install¶
Requires Python 3.12+. At present the runtime depends only on the Python standard library.
Quick example¶
from tunas import read_cl2, read_hy3
# read_cl2 yields one MeetArchive (meets + a parse report) per source file
for archive in read_cl2("results.cl2"):
for meet in archive.meets:
print(meet.name, "—", len(meet.swimmers), "swimmers")
for swim in meet.individual_swims:
print(swim.swimmer.full_name, swim.event.name, swim.time)
# read_hy3 parses Hy-Tek files into the exact same object graph
for archive in read_hy3("results.hy3"):
for meet in archive.meets:
print(meet.name, "—", len(meet.swimmers), "swimmers")
Where to next¶
-
Getting started
Install
tunasand parse your first.cl2file in a few lines. -
Parsing & errors
Understand the parsing modes and the never-lose-data error model.
-
Cookbook
Copy-paste practical recipes for common analysis tasks.
-
Domain model
Learn the object graph —
Meet,Club,Swimmer,Relay. -
API reference
Look up a specific class, function, or exception.
-
Design
Understand the architecture and the decisions behind it.