Challonge REST API wrappers
Project description
challonge-python-wrapper
A wrapper for Challonge's REST API. Its main objective is to provide the ability to create easy-to-read, fast-to-build tools for tournament organizing and analysis, which is also the reason why I decided to leave out fields that do not contribute towards that goal.
Features
- full support for Double Elimination brackets;
- tournament, match and partecipant classes are totally decoupled, allowing you to istantiate just what you need for your use case;
- ability to instantiate ChallongeTournament objects with or without attaching matches / participants;
- players in ChallongeMatch objects are named, despite the matches endpoint not providing names;
- round names are correctly assigned in Double Elimination brackets.
Installation
pip install challonge-wrapper
Usage
Make sure to generate an API key here. Then import the set_api_key()
function by typing
from challonge_wrapper import set_api_key
and using set_api_key()
with your API key as a parameter. Make sure to also import init_tournament()
,init_matches()
and / or init_partecipants()
. Then, call your desired function as follows:
t = init_tournament(
"evojap19kof14",
"evo"
)
you can just print this object to get:
id: 5316434, name: Evo Japan 2019 - The King of Fighters XIV, players: 192, game: The King of Fighters XIV, start: 2019-02-14
you can instantiate a tournament object and also retrieve matches and / or players for that tournament like that:
t = init_tournament(
"evojap19kof14",
"evo",
matches=False
participants=True
)
you can then access the object's attribute by simply calling his properties:
for p in t.participants:
print('{}, {}'.format(p.id, p.name))
Todo
- fully implement Single Elimination and Swiss brackets;
- implement ability to set timezone;
- implement POST operations;
- write docs;
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file challonge-wrapper-0.2.3.tar.gz
.
File metadata
- Download URL: challonge-wrapper-0.2.3.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb2035419f9abae8a43c48ebfc71cfea3a51b67b5355a4640e02800e4372e5a0 |
|
MD5 | 4b48437d1b7bdd27ddaa5cf10ee7003e |
|
BLAKE2b-256 | 636e15186df28111d30c5945403bb0d601d6e75266b8e964984543de95a9eb67 |