listenbrainz_export
Export your scrobbling history form ListenBrainz. ListenBrainz is a public/open-source alternative to RateYourMusic
Since the data is public, no API key/Authentication is required.
Installation
Requires python3.10+
To install with pip, run:
pip install listenbrainz_export
Usage
Provide your listenbrainz username -- prints results to STDOUT
listenbrainz_export export purarue > ./data.json
Can also only request a few pages:
listenbrainz_export export purarue --pages 3
Or can request only recent listens:
listenbrainz_export export purarue --days 30
listenbrainz_export.parse includes a model of the data and some functions to parse them into python objects, like:
>>> from listenbrainz_export.parse import iter_listens
>>> listens = list(iter_listens("data.json"))
>>> listens[12]
Listen(track_name='Skate', artist_name='Bruno Mars, Anderson .Paak & Silk Sonic', listened_at=datetime.datetime(2021, 11, 6, 19, 10, 49), inserted_at=datetime.datetime(2021, 11, 7, 2, 12, 31), recording_id='e60b9417-acfe-4796-a048-76208fb4a9ad', release_name='Skate - Single', metadata={'artist_msid': 'df6f6937-5de3-4e3c-bd74-1991ed92abd5', 'recording_msid': 'e60b9417-acfe-4796-a048-76208fb4a9ad', 'release_msid': 'dcf6d703-1e95-4e9c-8218-bb7c3b3bfa0b'}, username='purarue')
I use this almost exclusively through my HPI; that locates my exports on disks and removes any duplicate scrobbles
This also includes a playing-now command, which prints the currently playing track, if any:
listenbrainz_export playing-now purarue
That returns a JSON list, since you can have multiple songs playing at the same time).
The return code is 0 if there is a song playing, 1 if there is no song playing.
Tests
git clone 'https://github.com/purarue/listenbrainz_export'
cd ./listenbrainz_export
pip install '.[testing]'
mypy ./listenbrainz_export
flake8 ./listenbrainz_export
Metadata
Release files for listenbrainz-export 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| listenbrainz_export-0.2.2.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| listenbrainz_export-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.6 kB
Release files / listenbrainz_export-0.2.2.tar.gz
| Download URL | listenbrainz_export-0.2.2.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36a91b2720ab6a393eb7f1bea971bb02bc031e64f66d2c7bfd99c341d31354e0
|
|
BLAKE2b-256 checksum How to use checksums |
52523b4f1ae29c371183dcfdbb73d98fefd189404577a04450a6d63b7e82553d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / listenbrainz_export-0.2.2-py3-none-any.whl
| Download URL | listenbrainz_export-0.2.2-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a604a402ab2b5590fa404f84b422199dd688dd4e1ad88c220f43c2d3a5bc1eff
|
|
BLAKE2b-256 checksum How to use checksums |
701d5e3fc0cd050715c1ec3a223f620ba165aed138946f5c36c9a5916beab5c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|