Async typed Python client for Deezer's Pipe GraphQL API.
Project description
deezer-python-gql
Async typed Python client for Deezer's Pipe GraphQL API.
Built with ariadne-codegen — all
client methods and response models are generated from the GraphQL schema and
.graphql query files.
Installation
uv add deezer-python-gql
Quick Start
import asyncio
from deezer_python_gql import DeezerGQLClient
async def main():
client = DeezerGQLClient(arl="YOUR_ARL_COOKIE")
# Current user
me = await client.get_me()
print(me)
# Track with media URLs, lyrics, and contributors
track = await client.get_track(track_id="3135556")
print(track.title, track.duration)
# Album with paginated track list
album = await client.get_album(album_id="302127")
print(album.display_title, album.tracks_count)
# Artist with top tracks and discography
artist = await client.get_artist(artist_id="27")
print(artist.name, artist.fans_count)
# Playlist with tracks
playlist = await client.get_playlist(playlist_id="53362031")
print(playlist.title, playlist.estimated_tracks_count)
# Unified search across all entity types
results = await client.search(query="Daft Punk")
print(len(results.tracks.edges), "tracks found")
asyncio.run(main())
Available Queries
| Method | Description |
|---|---|
get_me() |
Current authenticated user |
get_track(track_id) |
Full track details — ISRC, media tokens, lyrics, contributors |
get_album(album_id) |
Album with cover, label, paginated tracks, fallback |
get_artist(artist_id) |
Artist with bio, top tracks, albums (ordered by release date) |
get_playlist(playlist_id) |
Playlist with owner, picture, paginated tracks |
search(query, ...) |
Unified search across tracks, albums, artists, playlists |
get_flow() |
User's default Flow with tracks |
get_flow_configs(moods_first, genres_first) |
Mood & genre flow config lists for discovery |
get_flow_config_tracks(flow_config_id) |
Tracks for a specific mood/genre flow config |
get_made_for_me(first) |
"Made For You" SmartTracklist & Flow items |
get_smart_tracklist(smart_tracklist_id, first) |
Smart tracklist with paginated tracks |
get_charts(country_code, ...) |
Country charts — tracks, albums, artists, playlists |
get_recommendations(playlists_first, ...) |
Personalized recommendations across categories |
get_recently_played(first) |
Recently played mixed content (albums, playlists, artists...) |
get_favorite_artists(first, after) |
Paginated favorite artists |
get_favorite_albums(first, after) |
Paginated favorite albums |
get_favorite_tracks(first, after) |
Paginated favorite tracks |
get_favorite_playlists(first, after) |
Paginated favorite playlists |
All methods return fully-typed Pydantic models generated from the GraphQL schema.
Development
Requires Python 3.12+ and uv.
# Install all dependencies (including codegen tooling)
make setup
# Re-generate the typed client from schema + queries
make generate
# Run linters and type checks
make lint
# Run tests
make test
Adding a new query
- Create a
.graphqlfile inqueries/. - Run
make generateto produce the typed client method and response models. - Add tests in
tests/.
Exploring the API
To run ad-hoc GraphQL queries against the live Pipe API during development:
-
Create a
.envfile (already gitignored) with your ARL cookie:echo 'DEEZER_ARL=your_arl_cookie_value' > .env
-
Run queries:
# Run a .graphql file uv run python scripts/explore.py queries/get_me.graphql # Run an inline query uv run python scripts/explore.py -q '{ me { id } }' # With variables uv run python scripts/explore.py -q 'query($id: String!) { track(trackId: $id) { title } }' \ -v '{"id": "3135556"}' # Via make make explore Q=queries/get_me.graphql
The script handles JWT auth automatically — no manual token management needed.
Authentication
The Pipe API uses short-lived JWTs obtained from an ARL cookie. The base client handles token acquisition and refresh automatically — you only need to supply a valid ARL value.
License
Apache-2.0
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deezer_python_gql-0.5.1.tar.gz.
File metadata
- Download URL: deezer_python_gql-0.5.1.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a723f1175dd3c6663d58be5a9791d57c8d9e4fd56d9e73ff747403e089c1f77f
|
|
| MD5 |
222a785b6dcfae25f4a7466b9421d947
|
|
| BLAKE2b-256 |
1bf2a555ea84989f200076c0739d5e68982d9c67c4a6836b48ae3a4e8c3285ea
|
Provenance
The following attestation bundles were made for deezer_python_gql-0.5.1.tar.gz:
Publisher:
publish-to-pypi.yml on music-assistant/deezer-python-gql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deezer_python_gql-0.5.1.tar.gz -
Subject digest:
a723f1175dd3c6663d58be5a9791d57c8d9e4fd56d9e73ff747403e089c1f77f - Sigstore transparency entry: 1191627033
- Sigstore integration time:
-
Permalink:
music-assistant/deezer-python-gql@bbba0899178184112b01d4025efe25cdf514d413 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/music-assistant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@bbba0899178184112b01d4025efe25cdf514d413 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file deezer_python_gql-0.5.1-py3-none-any.whl.
File metadata
- Download URL: deezer_python_gql-0.5.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
225b72610cedb109c5cba04fa49c5bdad8542c151a795e36e26d9e903a036eba
|
|
| MD5 |
bc1bbe0c0137e131a305bdc1215feee9
|
|
| BLAKE2b-256 |
6affcb30a9af89b9d6b9332ed652ee2e84b49930bed4696fcd07bb053f81e13c
|
Provenance
The following attestation bundles were made for deezer_python_gql-0.5.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on music-assistant/deezer-python-gql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deezer_python_gql-0.5.1-py3-none-any.whl -
Subject digest:
225b72610cedb109c5cba04fa49c5bdad8542c151a795e36e26d9e903a036eba - Sigstore transparency entry: 1191627036
- Sigstore integration time:
-
Permalink:
music-assistant/deezer-python-gql@bbba0899178184112b01d4025efe25cdf514d413 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/music-assistant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@bbba0899178184112b01d4025efe25cdf514d413 -
Trigger Event:
workflow_run
-
Statement type: