Skip to main content

Songstats Python SDK

Official Python client for the Songstats Enterprise API.

📚 API Documentation: https://developers.stats.company/songstats
🔑 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.info
  • client.tracks
  • client.artists
  • client.collaborators
  • client.labels

Info endpoints:

  • client.info.sources() -> /sources
  • client.info.status() -> /status
  • client.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

Metadata

Release files for songstats-sdk 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for songstats-sdk 0.1.2
File Size Uploaded Provenance
songstats_sdk-0.1.2.tar.gz 8.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for songstats-sdk 0.1.2
File Interpreter ABI Platform
songstats_sdk-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / songstats_sdk-0.1.2.tar.gz

Download URL songstats_sdk-0.1.2.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0e7e585bfe1bb8392262283623be7d929041c76db1afe8857379e0cba2d91587
BLAKE2b-256 checksum
How to use checksums
e3bf9f2989cb33fceae4bd5d14be0e6bd16a0a9132b4d4e51c072f185d2770f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / songstats_sdk-0.1.2-py3-none-any.whl

Download URL songstats_sdk-0.1.2-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfd1aedc7d3e1be1b24bd52aa38e6a71f9de01c64832133b91cde66d9d103cff
BLAKE2b-256 checksum
How to use checksums
1a1eee67cc529d4ca98369061f17aca52d834e20a68b036dee17acce435abf84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for songstats-sdk 0.1.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page