This API supports multiple streaming services through a unified interface:
- Spotify - Full OAuth2 implementation with user authorization
- Deezer - Public API access with OAuth2 for user features
- Apple Music - JWT-based authentication for catalog access
The Apple Music client implements the StreamingServiceInterface and provides:
Set the following environment variables:
APPLE_MUSIC_TEAM_ID=your_team_id
APPLE_MUSIC_KEY_ID=your_key_idfrom digster_api.apple_music_controller import AppleMusicController
# Initialize client
client = AppleMusicController(
client_id="your_team_id",
client_secret="your_key_id"
)
# Get developer token
token = client.get_unauth_token()
# Search for tracks, albums, artists
tracks = client.get_tracks_info(token, ["track_id_1", "track_id_2"])
albums = client.get_albums_info(token, ["album_id_1"])
artists = client.get_artists_info(token, ["artist_id_1"])- User-specific operations (current playback, saved albums) require user authorization
- Audio features are not available through Apple Music API
- JWT tokens are generated locally for catalog access
Use the factory function to switch between services:
from digster_api.main import get_streaming_service
# Get different services
spotify = get_streaming_service("spotify")
apple_music = get_streaming_service("apple_music")
deezer = get_streaming_service("deezer")poetry shell
code .make start-localmake start-dev-dockermake test-localmake test-cov-localmake migrate-db- Check post to put endpoints
- change sql request to extract tracks using timestamp strategy
- Review typings on
spotify_controller.py - Integration tests
- multiple environments compose files: dev - ci - prod