Skip to main content

pylistenbrainz

pylistenbrainz is a simple Python library for the ListenBrainz Web API.

pylistenbrainz 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 pylistenbrainz

client = pylistenbrainz.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 pylistenbrainz
import time

auth_token = input('Please enter your auth token: ')

listen = pylistenbrainz.Listen(
    track_name="Fade",
    artist_name="Kanye West",
    release_name="The Life of Pablo",
    listened_at=int(time.time()),
)

client = pylistenbrainz.ListenBrainz()
client.set_auth_token(auth_token)
response = client.submit_single_listen(listen)

More detailed documentation is available at Read The Docs.

Features

pylistenbrainz 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 pylistenbrainz, take a look at the ListenBrainz API Documentation.

Installation

Install or upgrade pylistenbrainz with:

pip install pylistenbrainz --upgrade

Support

You can ask questions about how to use pylistenbrainz 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

pylistenbrainz - 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/>.

Metadata

Release files for pylistenbrainz 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylistenbrainz 0.5.1
File Size Uploaded
pylistenbrainz-0.5.1.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pylistenbrainz 0.5.1
File Interpreter ABI Platform
pylistenbrainz-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 40.2 kB

Release files / pylistenbrainz-0.5.1.tar.gz

Download URL pylistenbrainz-0.5.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
20f4649bad2e5d5e949ad0bf9238c4e632a8df0a0b2b2220bd055506fb95ab48
BLAKE2b-256 checksum
How to use checksums
e31124ca2dcec2be635728521610274088888fbf721e5cc0e2302d658fe8ebf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.10

Release files / pylistenbrainz-0.5.1-py3-none-any.whl

Download URL pylistenbrainz-0.5.1-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d56c281898f0ff3a75ade720a09fbfe56832e277fd0c2b5cc0949848c46dfc2
BLAKE2b-256 checksum
How to use checksums
17071af138c78dafcea3d1e5262b148cdf589593ff00cdf6db34effc69a89012
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page