chessdotcom.client¶
- class chessdotcom.client.ChessDotComClient(aio: bool = False, user_agent: str = None, request_config: dict = None, rate_limit_handler: RateLimitHandler = None, verify_ssl: bool = True)¶
Client for Chess.com Public API. The client can be initialized withe following options.
- Variables:
request_config – Dictionary containing extra keyword arguments for requests to the API (headers, proxy, etc). This value will be set from Client if nothing is provided
aio – Determines if the functions behave asynchronously. Defaults to False
rate_limit_handler – A RateLimitHandler object. See
chessdotcom.client.RateLimitHandler.user_agent – A string that will be used as the User-Agent header in requests to the API. This value will override the value in request_config if provided.
- class chessdotcom.client.Client¶
Client for Chess.com Public API. The client is only responsible for making calls.
- Variables:
request_config – Dictionary containing extra keyword arguments for requests to the API (headers, proxy, etc).
aio – Determines if the functions behave asynchronously.
:rate_limit_handler – A RateLimitHandler object. See
chessdotcom.client.RateLimitHandler.
- Loop_callback:
Function that returns the current loop for aiohttp.ClientSession.
- class chessdotcom.client.RateLimitHandler(tts=0, retries=1)¶
Rate Limit Handler for handling 429 responses from the API.
- Tts:
The time the client will wait after a 429 response if there are tries remaining.
- Retries:
The number of times the client will retry calling the API after the first attempt.