This is the async version of pychal.
Why don't you submit this as a PR? What I did here was very simple. However it breaks compatibility with older versions of Python, which can be an issue. If you're going to use an async version of pychal, I think you're already aware of the reason why! apychal was initially made to work with ATOS (which is now here), a Discord bot relying on asynchronous tasks to be efficient.
Please note that it :
- Only supports Python 3.6+ (modern
asyncio, removed legacy code). - Replaces
requestswithaiohttp(which makes this module asynchronous).
That's it for the main differences, otherwise it should be the same to use as the original.
You can install apychal with PyPI :
pip install apychal
import asyncio
import achallonge
achallonge.set_credentials("user", "my_api_key")
async def main():
participants = await achallonge.participants.index('mytournament')
print(participants)
asyncio.run(main())