Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

liblistenbrainz-0.6.1.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

liblistenbrainz-0.6.1-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file liblistenbrainz-0.6.1.tar.gz.

File metadata

  • Download URL: liblistenbrainz-0.6.1.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for liblistenbrainz-0.6.1.tar.gz
Algorithm Hash digest
SHA256 039de0c58c6620b0973af785f6da4f9e14fcdc961c19344adbf7fed643ebd3ff
MD5 be90edb2a1410bff53a2aacc33e1da50
BLAKE2b-256 369bfb607cb412200202e5cea6bd9b99e5062ddc5049409e35e5c65d296e6d4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for liblistenbrainz-0.6.1.tar.gz:

Publisher: cd.yaml on metabrainz/liblistenbrainz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file liblistenbrainz-0.6.1-py3-none-any.whl.

File metadata

File hashes

Hashes for liblistenbrainz-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1cece3f297a8ebb7ca1ee8704c61289550f8ef73ea246ca1c75584cd24b25dff
MD5 df2fb713621930abd87d67d679047ea4
BLAKE2b-256 6fd410ec34f40cbe3f6bbc4027b637835acfa2c8cd23e1b8cea0e294fcf6691b

See more details on using hashes here.

Provenance

The following attestation bundles were made for liblistenbrainz-0.6.1-py3-none-any.whl:

Publisher: cd.yaml on metabrainz/liblistenbrainz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page