pywcif
Read, query, check and write World Cube Association (WCA) speedcubing competition data in Python. pywcif works with WCIF, the format the WCA website, Groupifier and WCA Live use for competitions: competitors, events, rounds, results, schedules and group assignments, as fully typed models.
Useful for competition organizers, WCA delegates and anyone building cubing tools: scorecards, group and schedule printouts, results analysis, or checking a competition before it is announced.
pip install pywcif
Quick start
from pywcif import fetch_wcif, format_result
comp = fetch_wcif("WC2025") # any competition id from the WCA website
print(comp.name, "-", len(comp.get_accepted_competitors()), "competitors")
# Podium of the 3x3x3 final
final = comp.get_event("333").rounds[-1]
podium = sorted((r for r in final.results if r.ranking in (1, 2, 3)), key=lambda r: r.ranking)
for result in podium:
person = comp.get_person(registrant_id=result.person_id)
print(result.ranking, person.name, format_result(result.average, "333", is_average=True))
Everything is a typed object with autocomplete: comp.persons, comp.events, round.results,
comp.schedule.venues, and so on.
Common tasks
Load and save WCIF files
from pywcif import dump_wcif, load_wcif
comp = load_wcif("competition.json") # also accepts a Path, JSON text, bytes or a dict
dump_wcif(comp, "competition-out.json") # writes the same document back, unchanged
Saving is lossless: fields pywcif doesn't know about, such as Groupifier extensions, are
written back exactly as they were read.
Find people
comp.get_person(wca_id="2019PAPA01") # or registrant_id=..., wca_user_id=...
comp.get_accepted_competitors("333") # accepted and registered for 3x3x3
comp.get_first_timers() # competitors without a WCA ID
comp.get_staff() # people with a role or a staff assignment
A competitor's schedule, in local time
person = comp.get_person(wca_id="2019PAPA01")
for entry in comp.get_person_schedule(person.registrant_id):
when = entry.local_start.strftime("%a %H:%M")
print(when, entry.activity.name, entry.assignment.assignment_code)
Sat 09:30 3x3x3 Cube Round 1 Group 1 competitor
Sat 11:30 3x3x3 Fewest Moves Round 1 Group 1 competitor
Sat 14:00 3x3x3 Multi-Blind Group 1 competitor
Sat 15:30 3x3x3 Cube Round 2 Group 1 competitor
Times are converted from UTC to the venue's timezone.
Turn result numbers into readable text
WCIF stores results as integers. format_result knows each event's encoding:
from pywcif import MultiBlindResult, format_result
format_result(6543, "333") # '1:05.43'
format_result(-1, "333") # 'DNF'
format_result(28, "333fm") # '28' (single: moves)
format_result(2833, "333fm", is_average=True) # '28.33' (mean)
format_result(880325201, "333mbf") # '12/13 54:12'
MultiBlindResult.from_wcif_int(880325201).points # 11
Check a competition for mistakes
from pywcif import audit_competition
for issue in audit_competition(comp):
print(issue.severity, issue.code, issue.message)
error CUTOFF_GE_TIMELIMIT Round 333-r1 of event 333 has a cutoff of 60000 cs, which is not below its time limit of 60000 cs
error UNMAPPED_ACTIVITY_ID Eleni Konstantinou is assigned to activity 42, which is not in the schedule
The audit never stops loading or saving; it only reports. It checks:
| Code | Severity | What it means |
|---|---|---|
CUTOFF_GE_TIMELIMIT |
error | A round's cutoff is not below its time limit. |
MISSING_ADVANCEMENT_CONDITION |
error | A non-final round has no advancement condition, or the final has one. |
REG_9P1_ADVANCEMENT |
error | Fewer than 25% of competitors would be eliminated (Regulation 9p1). |
UNMAPPED_ACTIVITY_ID |
error | Someone is assigned to an activity that isn't in the schedule. |
SCHEDULE_CONFLICT |
warning | Someone has two assignments at the same time. |
Private data (organizers and delegates)
comp = fetch_wcif("YourCompetition2026", oauth_token="...") # WCA OAuth token
This includes emails, birthdates and registration comments. The token is only sent over https.
Good to know
- Python names, WCIF JSON. Attributes are snake_case (
person.wca_id), JSON keys are camelCase (wcaId). Both are accepted when loading. - New WCA values don't break anything. Fields such as event ids, roles and assignment codes
come with enums for autocomplete (
EventId,AssignmentCode, ...), but also accept any other string. - Use
to_wcif_dict()/to_wcif_json()to export, notmodel_dump(exclude_none=True). They keep thenullvalues WCIF requires and leave out private fields that were never present. - Activity codes such as
333-r1-g2can be parsed withActivityCode.parse()oractivity.parsed_code.
Links
MIT licensed.
Metadata
Release files for pywcif 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pywcif-0.1.1.tar.gz | 55.0 kB | With provenance | Details for pywcif-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pywcif-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pywcif-0.1.1-py3-none-any.whl |
Total release size: 78.6 kB
Release files / pywcif-0.1.1.tar.gz
| Download URL | pywcif-0.1.1.tar.gz |
|---|---|
| Size | 55.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b032017f776cd7f33f18eb262d286a7033b82db4375af4e595632c2a51e0d6dd
|
|
BLAKE2b-256 checksum How to use checksums |
63ff872c5770518ad6ecc8d9ae366fea9f361be63fe34c5507a081a70445a5d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 30, 2026.
Transparency logRelease files / pywcif-0.1.1-py3-none-any.whl
| Download URL | pywcif-0.1.1-py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c5dbcf6178b20fab6d0b80fd78070860314a8805f95ef0785e3cfcd816f6de1
|
|
BLAKE2b-256 checksum How to use checksums |
70b92697a45ce17d0e6dca2b97bed89cc75403656db37cd258fa57106507a567
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 30, 2026.
Transparency logSecurity for pywcif 0.1.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pywcif-0.1.1.tar.gz
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 30, 2026.
Transparency logA 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.