Skip to main content

使用 Chalonge API 的 python 库

项目描述

阿查朗日

Python 3.5+ 的异步挑战

构建状态 文件状态 覆盖状态

现代库不仅仅是 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]

用法

import challonge

async def foo():
    # Log in into Challonge with your CHALLONGE! API credentials (https://challonge.com/settings/developer).
    user = await challonge.get_user('your_challonge_username', 'your_api_key')

    # Retrieve your tournaments
    tournaments = await user.get_tournaments()

    # Tournaments, matches, and participants are all represented as Python classes
    for t in tournaments:
        print(t.id)  # 3272
        print(t.name)  # 'My Awesome Tournament'
        print(t.status)  # 'open'

    # Retrieve the participants for a given tournament.
    participants = await tournaments[0].get_participants()
    print(len(participants)) # 13

文档

完整的文档可以在阅读文档中找到

作者/许可证

在 MIT 许可下分发。详情见LICENSE_

Fabien Poupineau (fp12) - 2017-2019

推特:@fp12gaming

加入Discord 服务器并讨论这个库!

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

achallonge-1.9.0.tar.gz (15.7 kB 查看哈希

已上传 source

内置分布

achallonge-1.9.0-py3-none-any.whl (19.3 kB 查看哈希

已上传 py3