A simple ListenBrainz client library for Python
Project description
liblistenbrainz
liblistenbrainz is a simple Python library for the ListenBrainz Web API.
liblistenbrainz will help you start getting data from and submitting data to ListenBrainz very quickly.
Here's an example of getting the listening history of a ListenBrainz user::
import liblistenbrainz
client = liblistenbrainz.ListenBrainz()
listens = client.get_listens(username='iliekcomputers')
for listen in listens:
print("Track name:", listen.track_name)
print("Artist name:", listen.artist_name)
Here's another quick example of how to submit a listen to ListenBrainz::
import liblistenbrainz
import time
auth_token = input('Please enter your auth token: ')
listen = liblistenbrainz.Listen(
track_name="Fade",
artist_name="Kanye West",
release_name="The Life of Pablo",
listened_at=int(time.time()),
)
client = liblistenbrainz.ListenBrainz()
client.set_auth_token(auth_token)
response = client.submit_single_listen(listen)
More detailed documentation is available at Read The Docs.
Features
liblistenbrainz provides easy access to all ListenBrainz endpoints, handles ratelimits automatically and supports the ListenBrainz authorization flow.
For details on the API endpoints that can be used via liblistenbrainz, take a look at the ListenBrainz API Documentation.
Installation
Install or upgrade liblistenbrainz with:
pip install liblistenbrainz --upgrade
Support
You can ask questions about how to use liblistenbrainz on IRC (freenode #metabrainz).
You can also email me at iliekcomputers [at] gmail [dot] com
.
If you have found a bug or have a feature request, let me know by opening an issue (or a pull request).
License
liblistenbrainz - A simple client library for ListenBrainz
Copyright (C) 2020 Param Singh <iliekcomputers@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
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
File details
Details for the file liblistenbrainz-0.5.5rc0.tar.gz
.
File metadata
- Download URL: liblistenbrainz-0.5.5rc0.tar.gz
- Upload date:
- Size: 34.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d094274c8ef06c027627ea5aa40a3fccdb460b9585f723c85097eba2bcf7030 |
|
MD5 | 7d30de57b69f6e2fa8cc55722c496837 |
|
BLAKE2b-256 | bd006293314f127689a0bbc9806e40612e48929ed9c2b6e68b21da8067838b70 |
File details
Details for the file liblistenbrainz-0.5.5rc0-py3-none-any.whl
.
File metadata
- Download URL: liblistenbrainz-0.5.5rc0-py3-none-any.whl
- Upload date:
- Size: 33.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 036eaff9001188fca8f7a4cbec4baf4581ae28a31f45e55054f79501282ed9b5 |
|
MD5 | 249e510a7c0195f36c7defdd0cceab84 |
|
BLAKE2b-256 | 746b960e1e0a9130d3cdb26a0ab9998885aa0ddfb6f404f1ac1771e7967af7b8 |