Skip to main content

A Python wrapper to interact the Spotify web API

Project description

spotifyapi

PyPI PyPI Black

spotifyapi is a modern Python wrapper to interact with the Spotify web API. spotifyapi attempts to stay as close as possible to the original API calls while implementing more Pythonic features.

Installation

spotifyapi supports Python 3.6 and higher and can be installed through Pip.

pip install spotifyapi

Example

The easiest way to use spotifyapi is using the SpotifyEndpoint which implements all methods of the package. However, it is still possible to use the individual endpoints such as AlbumEndpoint, PlayerEndpoint, etc.

from spotifyapi import SpotifyEndpoint

spotify = SpotifyEndpoint(token)

# Get the currently playing track
playing = spotify.get_currently_playing().item

# Get the track's features using Spotify's machine learning
features = spotify.get_audio_features(playing)

# Time to party!
if features.danceability > 0.75:
    spotify.volume(100)

Contributing

spotifyapi is open to contributions! Either take a look at the list of issues or submit your own. In order to develop on spotifyapi, follow this guide:

  1. Fork and clone the repository locally
  2. Setup a virtual environment
    • python3.6 -m venv venv
    • source venv/bin/activate
    • pip install -r requirements-dev.txt
    • cd .git & pre-commit install
  3. Develop following the Spotify API guide
  4. Commit changes and submit a pull request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotifyapi-0.1.1.tar.gz (21.1 kB view details)

Uploaded Source

File details

Details for the file spotifyapi-0.1.1.tar.gz.

File metadata

  • Download URL: spotifyapi-0.1.1.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.2

File hashes

Hashes for spotifyapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0ee925680c869a524de005057f498de14f6bb762b81fb1ac1eb02308440bd972
MD5 ddecaa950b3ff39443cd6d03db4c8e63
BLAKE2b-256 b9f89070daece271f7e996930195892e1b9942819d0bdbfeaf5f3602656745db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page