Metadata-Version: 2.1
Name: lb-matching-tools
Version: 2024.1.30.1
Summary: ListenBrainz tools for matching metadata to and from MusicBrainz.
Author-email: Robert Kaye <rob@metabrainz.org>
Project-URL: Homepage, https://github.com/metabrainz/listenbrainz-matching-tools
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: regex
Provides-Extra: tests
Requires-Dist: pytest==7.1.2; extra == "tests"
Requires-Dist: pytest-cov==4.1.0; extra == "tests"
Provides-Extra: build
Requires-Dist: build; extra == "build"
Requires-Dist: twine; extra == "build"

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

