asyncspotify
asyncspotify is an asynchronous, object-oriented python wrapper for the Spotify Web API.
Installation
Simply install the library from PyPI:
python -m pip install asyncspotify
Documentation
The documentation can be found at readthedocs.
Usage
To get going quickly, read the quickstart.
For complete examples, please check the documentation. Here’s some snippets:
Authenticating using the Client Credentials flow, and getting a playlist:
from asyncspotify import Client, ClientCredentialsFlow
auth = ClientCredentialsFlow(
client_id='your client id',
client_secret='your client secret',
)
async with Client(auth) as sp:
playlist = await sp.get_playlist('1MG01HhbCvVhH9NmXhd9GC')
async for track in playlist:
print(track.name)
Searching for and getting tracks:
results = await sp.search_tracks(q='involvers', limit=2)
# [<SimpleTrack id='5xoJhWwvzPJD9k8j8BE2xO' name='27'>, <SimpleTrack id='0WUTBejxPUhURFCFfSYbDc' name='Fighting My Fight'>]
track = await sp.get_track('0hqAWKZDhuOfFb6aK002Ph')
# <FullTrack id='0hqAWKZDhuOfFb6aK002Ph' name='Bone Dry'>
Fetching and creating playlists:
# get a playlist
playlist = await sp.get_playlist('1wPvaRtuI8mt10CpP2KnlO')
# <FullPlaylist id='1wPvaRtuI8mt10CpP2KnlO' name='my playlist'>
# iterate through playlist tracks
for track in playlist.tracks:
print(track)
# get current user
me = await sp.get_me()
# <PrivateUser id='runie13'>
# create new playlist
my_playlist = await me.create_playlist(name='My playlist!')
# <FullPlaylist id='0YTCnj0WE5gGb1lRqD6Ks9' name='My playlist!'>
# add tracks from previews playlist to the new playlist
await my_playlist.add_tracks(*playlist.tracks)
Reporting bugs
Please report issues here at GitHub.
Metadata
Release files for asyncspotify 0.12.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asyncspotify-0.12.1.tar.gz | 25.3 kB | Without provenance | Details for asyncspotify-0.12.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asyncspotify-0.12.1-py3-none-any.whl | Python 3 | none | any | Details for asyncspotify-0.12.1-py3-none-any.whl |
Total release size: 57.5 kB
Release files / asyncspotify-0.12.1.tar.gz
| Download URL | asyncspotify-0.12.1.tar.gz |
|---|---|
| Size | 25.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e469633d5e3974b67214a00e9689c61c6ff4ded64bbac2c42f81107d9042d50
|
|
BLAKE2b-256 checksum How to use checksums |
802028e7187e1a0e32414d17dce4c633992ca00b25087396b6a6931b042e77e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
|
Release files / asyncspotify-0.12.1-py3-none-any.whl
| Download URL | asyncspotify-0.12.1-py3-none-any.whl |
|---|---|
| Size | 32.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7fc166836a6a239ff761725de916b26b81c824f570bd1572490b5a7e23851de
|
|
BLAKE2b-256 checksum How to use checksums |
4b0c3c5c1c5f7816dd2636a56dc5a8ecb7c5d20924b61b3537922d10ce3448ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
|
Security for asyncspotify 0.12.1
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.