Skip to main content

A simple wrapper for spotify api written in python!

Project description

Spotify-Api.py

Simple wrapper for Spotify api written in python by the @spotify-api Organization!

Quick Docs

Client Class

Client class will be the main class to access other classes!

from spotifyapi import Client

client = Client(
  token='your-token'
)

Now as the Spotify Token Regenerates for every 5 minutes you can get a new token by Client ID and Client Secret!

# You can use set interval if u want

from spotifyapi import Client

client = Client(
  token='NO TOKEN' # Leave it like this
)

my_auth = client.oauth.get(
  client_id='your-id',
  client_secret='your-secret'
)

print(my_auth['access_token']) # Will print token. If you find errors, you can create an issue in Github repo

Track Class

Track class will let you to find, get and configure your search with tracks. You have to load client. Example given above

First define tracks if needed

track = client.track

# or

from spotifyapi.Track import Track
track = Track('some-token')

Functions

Name Params Example
search query: str, limit: int track.search('some query', 5)
get trackID: str, advanced: bool track.get('some-id')
audio_features trackID: str track.audio_features('some-id')
audio_analysis trackID: str track.audio_analysis('some-id')

Artist Class

Artist class will let you to find, get and configure your search with artists. You have to load client. Example given above

First define artist if needed

artist = client.artist

# or

from spotifyapi.Artist import Artist
artist = Artist('some-token')

Functions

Name Params Example
search query: str, limit: int artist.search('some query', 5)
get artistID: str artist.get('some-id')
albums artistID: str, limit: int artist.albums('some-id',5)
top_tracks artistID: str artist.top_tracks('some-id')
related_artists artistID: str artist.related_artists('some id')

Album Class

Album class will let you to find, get and configure your search with albums. You have to load client. Example given above

First define album if needed

artist = client.album

# or

from spotifyapi.Album import Album
artist = Album('some-token')

Functions

Name Params Example
search query: str, limit: int album.search('some query', 5)
get albumID: str album.get('some-id', 5)
get_tracks albumID: str, limit: int album.get_tracks('some-id', 5)

User Class

Album class will let you to find, get and configure your search with users. You have to load client. Example given above

First define user if needed

user = client.user

# or

from spotifyapi.User import User
user = User('some-token')

Functions

Name Params Example
get userID: str user.get('some-id')

Support

So, hey facing troubles? We have some ways you to support you!

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

spotify-api.py-0.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

spotify_api.py-0.0.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file spotify-api.py-0.0.2.tar.gz.

File metadata

  • Download URL: spotify-api.py-0.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.5.0

File hashes

Hashes for spotify-api.py-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d519058906f73ac6919d0f86767a6b9736279b61561f648e18fb361bb11ac581
MD5 c8d3799ab59e673405b1cb1723cc097a
BLAKE2b-256 5f4af809e3f89acc95d4d8260cae52c13a2a1a669bef6c532d5d1da6f1143cba

See more details on using hashes here.

File details

Details for the file spotify_api.py-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: spotify_api.py-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.5.0

File hashes

Hashes for spotify_api.py-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eccd2b8c131453f8758bdd0188c3d0d53beefb512e99db9c66c6c3291494ec31
MD5 0bfc79ba502767ad12edf6a48455c70f
BLAKE2b-256 509ddeb38541626625082977b61dddad7e19a0f337d2c23927e64f167695d0fd

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