Skip to main content

pychallonge

Lightweight Python wrapper for the Challonge API. The pychallonge module was created by Russ Amos and maintained by George Lemanis

Python version support

  • 3.10 or later

Installation

The pychallonge package is available on PyPI and you can install it through your favorite package manager:

pip install pychallonge

Usage

from challonge import Client

# Create a client with your Challonge API credentials.
client = Client(user="your_challonge_username", api_key="your_api_key")

# Retrieve a tournament by its id (or its url).
tournament = client.tournaments.show(3272)

# Tournaments, matches, and participants are returned as typed dataclasses.
print(tournament.id)          # 3272
print(tournament.name)        # My Awesome Tournament
print(tournament.started_at)  # None

# Retrieve the participants for a given tournament.
participants = client.participants.index(tournament.id)
print(len(participants))  # 13

# Mutations (POST/PUT) return the updated resource directly.
tournament = client.tournaments.start(tournament.id)
print(tournament.started_at)  # 2011-07-31 16:16:02-04:00

# Close the client when done, or use it as a context manager.
client.close()

Context manager

with Client(user="your_challonge_username", api_key="your_api_key") as client:
    tournament = client.tournaments.show(3272)

Async

from challonge import AsyncClient

async with AsyncClient(user="your_challonge_username", api_key="your_api_key") as client:
    tournament = await client.tournaments.show(3272)
    participants = await client.participants.index(tournament.id)

Timezone

By default datetime fields are normalised to your machine's local timezone. Pass a timezone string to override:

client = Client(user="your_challonge_username", api_key="your_api_key", timezone="UTC")

See challonge.com for full API documentation.

API Issues

The Challonge API has some issues with the attachments endpoints. When uploading an attachment with a file (asset), the API returns a 500 internal server error. This issue has been reported to Challonge.

The check-in undo endpoint has unexpected behaviour: the checked_in field in the API response remains True even after a successful undo. The participant is correctly marked as not checked in on the website.

Running the tests

Tests make real API calls and require a Challonge account. Set CHALLONGE_USER and CHALLONGE_KEY in your environment before running.

$ git clone https://github.com/ZEDGR/pychallonge
$ cd pychallonge
$ CHALLONGE_USER=my_user CHALLONGE_KEY=my_api_key uv run pytest tests.py -v

Note that several tournaments are created and destroyed over the course of the tests. If any test fails mid-run, orphaned tournaments can be cleaned up as follows:

from challonge import Client

with Client(user="my_user", api_key="my_api_key") as client:
    for t in client.tournaments.index():
        if t.name.startswith("pychal"):
            client.tournaments.destroy(t.id)

Release files for pychallonge 3.0.0

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

Source distribution (sdist)

Source distribution for pychallonge 3.0.0
File Size Uploaded
pychallonge-3.0.0.tar.gz 30.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pychallonge 3.0.0
File Interpreter ABI Platform
pychallonge-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.0 kB

Release files / pychallonge-3.0.0.tar.gz

Download URL pychallonge-3.0.0.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8be51714c7209c33dd7b15d87612c1a00090aba04de8c09cfe348536ce007ab4
BLAKE2b-256 checksum
How to use checksums
db7e6dd376dfe2cdc1e5bd277c875d0a4b5b3a068eda465667c49ba9ab26a0bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 2, 2026.

Transparency log

Release files / pychallonge-3.0.0-py3-none-any.whl

Download URL pychallonge-3.0.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2af46e7fe38d1a5bf8210ac685766650b053cc18ab98fcddf231407107ce410a
BLAKE2b-256 checksum
How to use checksums
b9bb62336cdc389beb9ce58e44b0f1ce0932e9886fad94a4316e85efa1e78d75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.0.0

2 release files

1.11.5

1 release file

1.11.3

1 release file

1.0.1

1 release file

1.0

2 release files

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