wyscoutapi
wyscoutapi is an extremely basic API client for the Wyscout API (v2 & v3).
Usage
Install with pip install wyscoutapi.
To connect to the Wyscout v3 api:
import wyscoutapi
client = wyscoutapi.WyscoutAPI(
username='myusername',
password='mypassword',
)
client.player(329061)
To use the v2 legacy API, or alter the rate-limit (defaults to 12 requests per second):
import wyscoutapi
client = wyscoutapi.WyscoutAPI(
username='myusername',
password='mypassword',
version='v2',
requests_per_second=10
)
client.player(329061)
API mocking
It can be useful to mock the API client for testing and local development.
To do this, create a custom "loader" to handle requests, and pass it to the APIClient constructor.
import wyscoutapi
class StubLoader:
def __init__(self):
pass
def get_route_json(self, *route, **params):
return {
'stub': 'This is a stub response'
}
client = wyscoutapi.APIClient(loader=StubLoader())
client.player(329061)
Other options
Wyscout provides an OpenAPI specification for their v3 API (see https://apidocs.wyscout.com/). You may prefer to create a more sophisticated API Client using code-generation tools such as openapi-generator or openapi-python-client, although as of 2021-10-01, I had some issues getting this to work with both of the generators linked above.
Metadata
Release files for wyscoutapi 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wyscoutapi-0.0.2.tar.gz | 4.8 kB | Details |
Release files / wyscoutapi-0.0.2.tar.gz
| Download URL | wyscoutapi-0.0.2.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0dc9692c9de43e61908315157e2bd9c39c501c92f99774a4bbcfd25a2fd4f700
|
|
BLAKE2b-256 checksum How to use checksums |
74c54e1666804ca07314a34dafc3963a9e570973395083e43f10534dd9f30622
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|