使用challonge api的python库
achallonge的Python项目详细描述
achallonge
python 3.5+的异步challonge
不仅仅是challonge web api包装器的现代库
要求
aiohttp
可选:
cchardet
更快地替换chardet,如aiohttp页所述aiodns
对于加速dns解析,aiohttp强烈推荐
python版本支持
3.5
3.6
3.7
安装
pip install achallonge
如果您想拥有aiohttp的可选依赖项,可以:
pip install achallonge[speed]
用法
importchallongeasyncdeffoo():# Log in into Challonge with your CHALLONGE! API credentials (https://challonge.com/settings/developer).user=awaitchallonge.get_user('your_challonge_username','your_api_key')# Retrieve your tournamentstournaments=awaituser.get_tournaments()# Tournaments, matches, and participants are all represented as Python classesfortintournaments:print(t.id)# 3272print(t.name)# 'My Awesome Tournament'print(t.status)# 'open'# Retrieve the participants for a given tournament.participants=awaittournaments[0].get_participants()print(len(participants))# 13
文档
完整的文档可以在Read the docs
作者/许可证
在麻省理工学院许可下发行。有关详细信息,请参见LICENSE
。
Fabien Poupenau(FP12)-2017-2019年
推特:@fp12gaming
加入Discord Server并讨论这个库!