Skip to main content

esporifai

PyPI Changelog Tests License

A modern CLI for collecting Spotify listening data from the Spotify Web API.

Installation

Install this tool using pip:

pip install esporifai

For development:

python -m pip install -e '.[dev]'

Usage

For help, run:

esporifai --help

You can also use:

python -m esporifai --help

Recently played tracks

To retrieve recently played tracks, run:

esporifai get-recently-played

For help,

esporifai get-recently-played --help

Authentication

esporifai uses Spotify authorization code flow and stores auth artifacts in your app config directory.

Required environment variables:

SPOTIFY_CLIENT_ID=...
SPOTIFY_AUTH_STRING=...
REDIRECT_URI=...
USERNAME=...  # or SPOTIFY_USERNAME
PASSWORD=...  # or SPOTIFY_PASSWORD

For stable automation, prefer a long-lived refresh token:

SPOTIFY_REFRESH_TOKEN=...

Useful auth commands:

esporifai auth --check
esporifai auth --status
esporifai auth --url
esporifai auth --code <authorization-code>
esporifai auth --force

esporifai will use auth in this order:

1. cached access token
2. cached refresh token
3. SPOTIFY_REFRESH_TOKEN from the environment
4. browser login flow

Optional runtime tuning:

ESPORIFAI_REQUEST_TIMEOUT_SECONDS=30
ESPORIFAI_BROWSER_SLOW_MO_MS=300
ESPORIFAI_LOGIN_TIMEOUT_MS=30000
ESPORIFAI_CONSENT_TIMEOUT_MS=5000
ESPORIFAI_REDIRECT_TIMEOUT_MS=90000

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd esporifai
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

python -m pip install -e '.[dev]'

To run the tests:

python -m pytest -m "not integration"

To run the live Spotify integration tests:

python -m pytest -m integration

Metadata

Release files for esporifai 0.3.0

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

Source distribution (sdist)

Source distribution for esporifai 0.3.0
File Size Uploaded Provenance
esporifai-0.3.0.tar.gz 19.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for esporifai 0.3.0
File Interpreter ABI Platform
esporifai-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.0 kB

Release files / esporifai-0.3.0.tar.gz

Download URL esporifai-0.3.0.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6b15a689aa942123e8efc7fbf221a3c03d8730787a4a52fa471e6b18dedb833d
BLAKE2b-256 checksum
How to use checksums
a0126b292448d21c7a14ad0db7ede80580f9464096b835a9f4421a6dfcfde90f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / esporifai-0.3.0-py3-none-any.whl

Download URL esporifai-0.3.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8337d209102975eb940c816af6f874349fa2da3c58ef9120c5c1e6aa01865f8
BLAKE2b-256 checksum
How to use checksums
cd21ed1dbbf27377d947cb1d3f3336ac8746b2d1857cea0e629e9effd57c72a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for esporifai 0.3.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.

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