Skip to main content

sdif

Parser/writer for US Swimming SDIF files.

GitHub forks Main workflow PyPI This project uses CalVer

The format is described in sdifv3.txt, obtained from https://www.usms.org/admin/sdifv3f.txt, dated April 28 1998, accessed Feb 12 2023.

United States Swimming has matured as an organization and expanded services to individuals and clubs. To support this expansion, USS has developed a computer plan. One component is a standard interchange format for technical data. Swimming data must be transmitted among the clubs, Local Swimming Committees (LSCs), and the USS headquarters office. Exchanging meet results is one example, where data from a host club is distributed to swimmers and clubs using diskettes or modems. Some LSCs are compiling swimmer statistics and would retype the data from printed sheets if electronic transmission were not available. A standard format promotes easy exchange of data and the development of new computer programs and services. The goal is to preserve the valuable efforts of our volunteers.

But why?

Swim meet administration uses some incredibly venerable software! Whatever innovations have visited swimming in the last twenty-five years have not made much of a mark on the conduct of meets, and a handful of vendors continue to do the bare minimum to keep their legacy code, and their legacy data formats, chugging along on new hardware and modern operating systems.

Most of these legacy data formats have no public documentation, so, if you'd like to get a bunch of entries into some meet management software, there aren't many obvious starting points! They don't accept anything as quotidian as a spreadsheet.

SDIF (SD3) is the proud exception, so here's a library. SD3 is a single-file data format with multiple record types and optional internal consistency checks. Each line in the file represents a record, and the fields are specified as fixed-width regions. It seems intended to represent a sort of flat-file database as much as an interchange format.

You can use this package to make sense of these files, or construct the records that you need to get data into a meet management tool.

How do I start?

To read a sd3 file:

with open("my_file.sd3", "rt") as f:
    for record in sdif.records.decode_records(f):
        print(record)

To write a sd3 file:

a0 = sdif.models.FileDescription(
    organization=sdif.models.OrganizationCode.masters,
    sdif_version="V3",
    file_code=sdif.models.FileCode.vendor_defined,
    software_name="My Cool Software",
    software_version="v0.0.0",
    contact_name="Joe Bloggs",
    contact_phone="+15555551212",
    file_creation=date.today(),
    submitted_by_lsc=None,
)
with open("my_file.sd3", "w") as f:
    f.write(sdif.records.encode_records([a0]))

Valid sd3 files must contain at least a FileDescription and a FileTerminator. See the SDIF specification for more details.

For the specific case of feeding meet entry data to Meet Manager, one hint is

I have found that the only essential records are:

  • one A0 (FileDescription) and
  • one B1 (Meet) at the start of the file,
  • one C1 (TeamId) line per club,
  • one D0 line (IndividualEvent) per swimmer per event followed by one D1 line (IndividualInfo) per swimmer,
  • and a Z0 (FileTerminator) at the end of the file.

Other resources

License

Copyright 2023 Tim D. Smith

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this package except in compliance with the License. There is a copy of the license in the file LICENSE.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Metadata

Release files for sdif 24.2.1.post0

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

Source distribution (sdist)

Source distribution for sdif 24.2.1.post0
File Size Uploaded Provenance Actions
sdif-24.2.1.post0.tar.gz 20.0 kB Without provenance Details for sdif-24.2.1.post0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sdif 24.2.1.post0
File Interpreter ABI Platform Actions
sdif-24.2.1.post0-py3-none-any.whl Python 3 none any Details for sdif-24.2.1.post0-py3-none-any.whl

Total release size: 38.0 kB

Release files / sdif-24.2.1.post0.tar.gz

Download URL sdif-24.2.1.post0.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
eb20270d4285e87842cccc06a26837aaab842c3fe1134dbca94ae004c06d75c5
BLAKE2b-256 checksum
How to use checksums
6fdba475fde30d24a126dfb36077e3e49f5a7c8769ddc9e2a14b10285e83ae6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / sdif-24.2.1.post0-py3-none-any.whl

Download URL sdif-24.2.1.post0-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15ddec4f9e62335f80de2012cdb02d7698fef8cd298cc668d68b089fcfc55ca6
BLAKE2b-256 checksum
How to use checksums
f8d164e9abb4628d9ab0f2b3a6dcc0efc50d7f13e4fa708e3a7fe1e84c786842
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for sdif 24.2.1.post0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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