Skip to main content

ListenBrainz tools for matching metadata to and from MusicBrainz.

Project description

ListenBrainz matching tools

In the ListenBrainz project we've created a number of tools and techniques that allowed us to create the MBID Mapping sub-project. This project takes an artist name and a recording (track) name and attempts to find the best matching recording in MusicBrainz.

This library will contain code to facilitate matching non-MusicBrainz metadata to MusicBrainz (tag a music collection) and from MusicBrainz to non-MusicBrainz metadata (content resolution).

Metadata cleaner

One component in this toolkit is the metadata cleaner, which removes (often) useless gunk from a metadata recording string:

"Tabula Rasa (feat. Lorraine Weiss)" -> "Tabula Rasa"
"Don't Give up - 2001 remaster" -> "Don't Give up"

This library also supports artist name cleaning:

"Amy Winhouse, Lorraine Weiss" -> "Amy Winehouse"

When a piece of metadata fails to be identified the metadata should be run through the metadata cleaner in an effort to remove this useless gunk that might be preventing a match. If the cleaner sucessfully removes gunk, the cleaned metadata should be looked up again, hoping that a match will be found this time.

To use this class, instantiate the MetadataCleaner class and call the clean_recording or clean_artist methods:

from lb_matching_tools.cleaner import MetadataCleaner

mc = MetadataCleaner()
mc.clean_recording("Tabula Rasa (feat. Lorraine Weiss)")
mc.clean_artist("Amy Winhouse, Lorraine Weiss")

Installation

To install this python module, simply do:

pip install .

Development

Create virtual environment

python -m venv .venv

Install dependencies

pip install .

Running tests

To run the internal unit tests, run:

pip install .
./test.py

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

lb-matching-tools-2024.1.25.0rc1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

lb_matching_tools-2024.1.25.0rc1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file lb-matching-tools-2024.1.25.0rc1.tar.gz.

File metadata

File hashes

Hashes for lb-matching-tools-2024.1.25.0rc1.tar.gz
Algorithm Hash digest
SHA256 fdfe14608b36d3f58f25f7887ae522e20ff4eae1b07ec3e48444920742979309
MD5 1f071796664b7e92bd70f3eea53cc15f
BLAKE2b-256 c04fdbfc2f184dd0126a6ad3e95b2c5b56785650ef69695443691afe8c1d76cf

See more details on using hashes here.

File details

Details for the file lb_matching_tools-2024.1.25.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for lb_matching_tools-2024.1.25.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 8af16870e4dd588ccdb836399a2dd47ebcf80495c317d606ac24c44e19673782
MD5 5a6a8648e8ddbe66b794b00406fa6f58
BLAKE2b-256 25729ab50adda80638aa4aab9db60894e811d7d193d9cd2028523a61e9ace969

See more details on using hashes here.

Supported by

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