Official Python client for the Songstats Enterprise API
Project description
Songstats Python SDK
Official Python client for the Songstats Enterprise API.
📚 API Documentation: https://docs.songstats.com
🔑 API Key Access: Please contact api@songstats.com
Requirements
- Python >= 3.10
Installation
Install from PyPI:
pip install songstats-sdk
For local development:
pip install -e ".[dev]"
Quick Start
from songstats_sdk import SongstatsClient
client = SongstatsClient(api_key="YOUR_API_KEY")
# API status
status = client.info.status()
# Track information
track = client.tracks.info(songstats_track_id="abcd1234")
# Artist statistics
artist_stats = client.artists.stats(
songstats_artist_id="abcd1234",
source="spotify",
)
Authentication
All requests include your API key in the apikey header.
You can generate an API key in your Songstats Enterprise dashboard.
We recommend storing your key securely in environment variables:
export SONGSTATS_API_KEY=your_key_here
Available Resource Clients
client.infoclient.tracksclient.artistsclient.collaboratorsclient.labels
Info endpoints:
client.info.sources()->/sourcesclient.info.status()->/statusclient.info.definitions()->/definitions
Error Handling
from songstats_sdk import SongstatsAPIError, SongstatsTransportError
try:
client.tracks.info(songstats_track_id="invalid")
except SongstatsAPIError as exc:
print(f"API error: {exc}")
except SongstatsTransportError as exc:
print(f"Transport error: {exc}")
Development
To work on the SDK locally:
git clone https://github.com/songstats/songstats-python-sdk.git
cd songstats-python-sdk
pip install -e ".[dev]"
pytest
Versioning
This SDK follows Semantic Versioning (SemVer).
License
MIT
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 songstats_sdk-0.1.1.tar.gz.
File metadata
- Download URL: songstats_sdk-0.1.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21df3d83fa3cad39a9625b98a31c0473dacdbafbd6798327ee5f45e6dc989e8d
|
|
| MD5 |
8e197d52575cd40922416c16fece0a00
|
|
| BLAKE2b-256 |
009030badb1b02fa3057c8fd72fd29a2ad98288b47d165aa7ede20e20d777dce
|
File details
Details for the file songstats_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: songstats_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b089b78389c9154cbb3e0f2bfa7bec5f95f90cea51230bb1e6764ea8bc782753
|
|
| MD5 |
6ac0548e169b2db475956331fe7bf828
|
|
| BLAKE2b-256 |
4d33efe85010a5b7902378e34cef050ee7a2bce094cfc979c60d630da8955589
|