Asynchronous Python API client for accessing the lichess.org API.
Project description
This package is meant to be an unofficial Python API Client for lichess.org.
For information about the API please refer to https://lichess.org/api
Every API endpoint uses async Python methods (asyncio).
Installation
Pypi:
pip install async-lichess-sdk
Test Pypi:
pip install -i https://test.pypi.org/simple/ async-lichess-sdk
Documentation
Sample Notebook
Dependencies
To use this package you need to install all of the dependencies located under requirements.txt
.
pip install requirements.txt
Supported python versions: python >= 3.6
How to build
Building script is located under build.sh
.
Steps:
sh build.sh
pip install -U .
Implemented Lichess Endpoints
- account
- boards
- bots
- broadcast
- challenges
- games
- messages
- relations
- simulations
- studies
- teams
- tournaments
- users
Sample usage
Client initialization and usage
import asyncio
from lichess_client import APIClient
async def main():
client = APIClient(token="your_lichess_account_token")
response = await client.account.get_my_profile()
print(response)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
.....
{'metadata':
{'method': <RequestMethods.GET: 'GET'>,
'url': 'https://lichess.org/api/account/kid',
'content_type': 'application/json',
'timestamp': b'Fri, 13 Mar 2020 19:05:27 GMT'},
'entity':
{'code': 200,
'reason': 'OK',
'status': <StatusTypes.SUCCESS: 'success'>,
'content': {'kid': False}
}
}
Access to the response properties
print(response.metadata.timestamp)
b'Fri, 13 Mar 2020 19:11:32 GMT'
print(response.entity.content)
{'kid': False}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file async_lichess_sdk-1.1.0.7.tar.gz
.
File metadata
- Download URL: async_lichess_sdk-1.1.0.7.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0247c744c599568fc6eb5034740207e3c59527414c6d10e44bdbbe1f194b8ada |
|
MD5 | 2badb9ed5a0a75842d601e519c97d7c3 |
|
BLAKE2b-256 | 8f55437b2860692da552fa4f8d77ec9a35ce02e15387fb89f3f7df98bd3f6c12 |
File details
Details for the file async_lichess_sdk-1.1.0.7-py3-none-any.whl
.
File metadata
- Download URL: async_lichess_sdk-1.1.0.7-py3-none-any.whl
- Upload date:
- Size: 54.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b07c00ef8fc184e13bbb018c932484182c8784a5855aac11a16a6d3031548e94 |
|
MD5 | 818e4975d1351d7c36cef12b532bd1c1 |
|
BLAKE2b-256 | 1906d894ec76e85026a34f9776f1630c61b12fc2515a6681279232fd22c0386d |