Skip to content

tunas

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

pip install tunas

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 tunas and parse your first .cl2 file in a few lines.

    Get up and running

  • Parsing & errors


    Understand the parsing modes and the never-lose-data error model.

    Parsing files

  • Cookbook


    Copy-paste practical recipes for common analysis tasks.

    Browse recipes

  • Domain model


    Learn the object graph — Meet, Club, Swimmer, Relay.

    Domain model

  • API reference


    Look up a specific class, function, or exception.

    API reference

  • Design


    Understand the architecture and the decisions behind it.

    Design notes