Spotify Connector for Podcast Data
Project description
Spotify Connector
This is a simple library for connecting to the inofficial Spotify podcast API.
It can be used to export data from your dashboard at
https://podcasters.spotify.com/home.
Supported Data
- List of episodes
- Starts and streams
- Listeners
- Followers
- Gender
- Age
- Country
- Episode performance
Credentials
Before you can use the library you must extract your Spotify credentials from the dashboard; they are not exposed through your Spotify settings.
You can use our web-extension for that or take a look at the code to see how to do it manually.
Installation
pip install spotifyconnector
Usage as a library
from spotifyconnector import SpotifyConnector
# Set up the connector
connector = SpotifyConnector(
client_id="your_client_id",
client_secret="your_client_secret",
redirect_uri="your_redirect_uri",
refresh_token="your_refresh_token",
)
# Get podcast metadata
connector.metadata()
# Get the list of listeners of a podcast
listeners = connector.listeners()
# Get the list of followers
followers = connector.aggregate()
# Iterate over all episodes (supports pagination)
for episode in connector.episodes():
# Do something with episode
pass
# Get the performance of an episode
performance = connector.performance("episode_id")
# ...
See __main.py__ for all endpoints.
Development
We use Pipenv for virtualenv and dev dependency management. With Pipenv installed:
- Install your locally checked out code in development mode, including its dependencies, and all dev dependencies into a virtual environment:
pipenv sync --dev
- Create an environment file and fill in the required values:
cp .env.example .env
- Run the script in the virtual environment, which will automatically load
your
.env:
pipenv run spotifyconnector
To add a new dependency for use during the development of this library:
pipenv install --dev $package
To add a new dependency necessary for the correct operation of this library, add
the package to the install_requires section of ./setup.py, then:
pipenv install
To publish the package:
python setup.py sdist bdist_wheel
twine upload dist/*
or
make publish
Credits
This was inspired by the code at wdr-okr, extended and released to PyPi.
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 spotifyconnector-0.5.0.tar.gz.
File metadata
- Download URL: spotifyconnector-0.5.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6369340c7698515269a02f10788f34f48fe574eeb38d2d4b5d84c86a9ebe2d7f
|
|
| MD5 |
df33d1548a943b5ac9c18c8481e37695
|
|
| BLAKE2b-256 |
00dfd2592e1eb2a680cc072e3cebb95a32cebbb27ff7dc040c269cdf6f2d484e
|
File details
Details for the file spotifyconnector-0.5.0-py3-none-any.whl.
File metadata
- Download URL: spotifyconnector-0.5.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76e926feb1aa54c4b2848c6201dfa617922f4168cd11c5eab77a87fc35443b6b
|
|
| MD5 |
865453c6558b638b69f757524797b16a
|
|
| BLAKE2b-256 |
b4c0cfa86d101bf322e29395c2bc4845de8bb57f36019dd49e40e8a8a80a5824
|