Skip to main content

Python module to submit listens to the ListenBrainz service

Simple python module to submit listens to the ListenBrainz server.

Supports submitting single listens, now playing notifications and import of multiple listens. Automatically honors the ListenBrainz server's rate limits.

Usage

import time
from listenbrainz_submit import ListenBrainzClient, Track


# The user's personal ListenBrainz token obtained from https://listenbrainz.org/profile/
user_token = "..."
client = ListenBrainzClient(user_token=user_token)

# Prepare a track to submit
track = Track(
    artist_name="Dool",
    track_name="Vantablack",
    release_name="Here Now, There Then",
    additional_info={
        "listening_from": "My great music player",
        "recording_mbid": "e225fb84-dc9a-419e-adcd-9890f59ec432",
        "release_mbid": "aa1ea1ac-7ec4-4542-a494-105afbfe547d",
        "artist_mbids": "24412926-c7bd-48e8-afad-8a285b42e131",
        "tracknumber": 1,
    }
)

# Inform ListenBrainz that this track is playing right now. ListenBrainz
# will display this track on the user's listens page as being currently played.
client.playing_now(track)

To actually submit a track as has been listened to call:

# Submit the listen with a current timestamp
client.listen(int(time.time()), track)

For details on the API usage please refer to the ListenBrainz API documentation, especially the Payload JSON details which describes the metadata that can be submitted.

License

listenbrainz-submit © 2018-2023 Philipp Wolfer ph.wolfer@gmail.com

Published under the MIT license, see LICENSE for details.

Metadata

Release files for listenbrainz-submit 1.0.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 listenbrainz-submit 1.0.1
File Size Uploaded
listenbrainz_submit-1.0.1.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for listenbrainz-submit 1.0.1
File Interpreter ABI Platform
listenbrainz_submit-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / listenbrainz_submit-1.0.1.tar.gz

Download URL listenbrainz_submit-1.0.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
29090908c2b00aba2b073104a4f2dcebd5af11509dc1ca48d8fa1c0ddb6fe9c6
BLAKE2b-256 checksum
How to use checksums
d464b96c5733f68b9712833117d0bc25261368f27736a3c2f9616ca303204f96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / listenbrainz_submit-1.0.1-py3-none-any.whl

Download URL listenbrainz_submit-1.0.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11cccc23de493dcfcd9374abb34951ffa43aded26b7251891ad6849755ad951f
BLAKE2b-256 checksum
How to use checksums
daac0254cec7e7a84131d61109e2cef406718b56457b375c842336779d266af3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

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