PlayerDataPy
A python package for interacting with the PlayerData GraphQL API.
Folder Structure
playerdata_api: The main package for interacting with the PlayerData API.gqlauth: The main package for authenticating with the PlayerData API.gqlclient: The main package for interacting with the PlayerData GraphQL API.custom_queries: Custom queries for the PlayerData GraphQL API.custom_mutations: Custom mutations for the PlayerData GraphQL API.custom_fields: Custom fields for the PlayerData GraphQL API.input_types: Input types for the PlayerData GraphQL API.enums: Enums for the PlayerData GraphQL API.custom_typing_fields: Custom typing fields for the PlayerData GraphQL API.custom_responses: Custom responses for the PlayerData GraphQL API.
Installation
uv is the tool we use to build and manage the playerdatapy Python package.
Make sure you install uv using pipx or the official installer. Installing with pip or other methods will lead to unexpected behavior.
We recommend using the official installer.
Then you can install the required dependencies, in a virtual environment if required.
uv sync
Usage
To use the GraphqlClient, you need to provide your client id, this will be provided to you by PlayerData. To request API credentials, please contact the PlayerData team at support@playerdata.co.uk.
Option 1: Use generated types with PlayerDataAPI
Example usage of this option is provided in the examples/pydantic/ folder.
The basic flow is to create a PlayerDataAPI instance, build the query objects using the code-generated Pydantic models (generated by ariadne-codegen), and then call the run_queries method.
For more detailed documentation, see examples/pydantic/README.md.
To run an example of this option, you can use the following command:
python examples/pydantic/quick_start.py
To run this you will need to set the following environment variables or hardcode them in the file:
export CLIENT_ID=your_client_id
export CLIENT_SECRET=your_client_secret
export CLUB_ID=your_club_id
For a more in-depth example, please see the examples/pydantic/example_use.ipynb notebook.
This notebook demonstrates how to use the PlayerData API with Pydantic to query specifics such as session details, session metrics, and raw data.
Option 2: Use the GraphqlClient class directly
Example usage of this option is provided in the examples/direct/ folder.
The basic flow is to create a GraphqlClient instance, build the query string, and then call the query method.
For more detailed documentation, see examples/direct/README.md.
To run an example of this option, you can use the following command:
python examples/direct/quick_start.py
To run this you will need to set the following environment variables or hardcode them in the file:
export CLIENT_ID=your_client_id
export CLIENT_SECRET=your_client_secret
export CLUB_ID=your_club_id
Authentication Types
These authentication types are set out in the playerdatapy.gqlauth.AuthenticationType enum.
The default authentication type is AuthenticationType.AUTHORISATION_CODE_FLOW.
These authentication types are used to set the authentication type in the GraphqlAuth class.
Authorisation Code Flow (PKCE)
Authorisation code flow with PKCE is used to authenticate users with non_confidential credentials.
Authorisation Code Flow
Authorisation code flow is used to authenticate users with confidential credentials.
Client Credentials Flow
Client credentials flow is used to authenticate backend to backend communication.
Updates to the API Fields and Mutations
To update the API fields and mutations, you need to set an AUTH_TOKEN environment variable.
This code is auto-generated by Ariadne, so any changes to the API fields and mutations will be reflected in the code.
export AUTH_TOKEN=f"Bearer {your_auth_token}"
python -m ariadne-codegen
This will generate code and update files in the playerdatapy package.
Metadata
Release files for playerdatapy 1.23.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| playerdatapy-1.23.0.tar.gz | 389.0 kB | Without provenance | Details for playerdatapy-1.23.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| playerdatapy-1.23.0-py3-none-any.whl | Python 3 | none | any | Details for playerdatapy-1.23.0-py3-none-any.whl |
Total release size: 587.8 kB
Release files / playerdatapy-1.23.0.tar.gz
| Download URL | playerdatapy-1.23.0.tar.gz |
|---|---|
| Size | 389.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0f92f3faabe86781719cd43db6f494e9d639f1febab45480e4d0afc0484fe94
|
|
BLAKE2b-256 checksum How to use checksums |
fc1482570094c6a7679be84de6c9d672b2d32b63e0d03648d84f4ad4a1fa8587
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / playerdatapy-1.23.0-py3-none-any.whl
| Download URL | playerdatapy-1.23.0-py3-none-any.whl |
|---|---|
| Size | 198.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a8846e3db8285427b53c8084b53212e170dd13c80cf06514d35576182b1dae0
|
|
BLAKE2b-256 checksum How to use checksums |
59d2f39bd1f43bbaee747801d6ef779bbe8d059cb4c9b441e24ffe7a1aec65ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for playerdatapy 1.23.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.