An API library for the spotify client and the Spotify Web API written in Python.
Spotify.py is an, primarily, asyncronous library (everything down to the HTTP client is asyncio friendly).
The library also supports syncronous usage with spotify.sync
import spotify.sync as spotify # Nothing requires async/await now!
- Top tracks (drake)
import spotify
client = spotify.Client('someid', 'sometoken')
async def example():
drake = await client.get_artist('3TVXtAsR1Inumwj472S9r4')
for track in await drake.top_tracks():
print(repr(track))
To install the library simply clone it and run setup.py
git clone https://github.com/mental32/spotify.py
python3 setup.py install
or use pypi
pip3 install spotify
(latest stable)pip3 install -U git+https://github.com/mental32/spotify.py
(nightly)