Skip to main content

MUsic MEtadata Explorer

Project description

Mumee

Get metadata about your favorite songs and playlists !
Mumee stands for MUsic MEtadata Explorer

Features

  • Automatic metadata fetching from different services
    • Currently supported : Spotify, Youtube Music
  • Metadata fetching from an URL or a query
  • Supports playlist URLs
  • Easy to use, straightforward interface
  • Possible to use via DI integration

Installation

Pip

pip install mumee

Poetry

Poetry is a Python dependency management and packaging tool. I actually use it for this project.

poetry add mumee

Usage

There are 2 ways to use this library : using the SongMetadataClient object or via the DI.

Using SongMetadataClient

The library exposes the SongMetadataClient class. This class has 2 methods : fetch and search.

The fetch method fetches the metadata corresponding to the request you give it, whether it is an URL or a query. It returns the result as a SongMetadata object or a PlaylistMetadata object.

Example :

from mumee import SongMetadataClient

client = SongMetadataClient()
result = client.fetch("https://open.spotify.com/track/7AB0cUXnzuSlAnyHOqmrZr")

title = result.title # Faint
artists = result.artists # ['Linkin Park']

The search method expects a query (e.g.: {title} - {artists}) and a limit corresponding to the number of results you want. It returns a list of SongMetadata objects that fit closest to the query that was given. This list is sorted by closest fit per client.

Example :

from mumee import SongMetadataClient

client = SongMetadataClient()
results = client.search("in the end - linkin park")

title = results[0].title # In The End
artists = results[0].artists # ['Linkin Park']

Using DI

The library also exposes the BaseMetadataClient and BaseMetadataExplorer interfaces and a add_mumee function for Taipan-DI.

In this function, the clients and explorers are registered as a Pipeline. All you need to do is to resolve the pipelines and execute it.

Example 1 :

from mumee import BaseMetadataClient, add_mumee
from taipan_di import DependencyCollection

services = DependencyCollection()
add_mumee(services)

provider = services.build()
client = provider.resolve(BaseMetadataClient)

result = client.exec("https://open.spotify.com/track/7AB0cUXnzuSlAnyHOqmrZr")
title = result.title # Faint

Example 2 :

from mumee import BaseMetadataExplorer, add_mumee
from taipan_di import DependencyCollection

services = DependencyCollection()
add_mumee(services)

provider = services.build()
explorer = provider.resolve(BaseMetadataExplorer)

results = explorer.exec("in the end - linkin park")
title = results[0].title # In The End

Inspirations

This library is partially based on spotDL's spotify-downloader.

TODO

This library isn't stable yet and a lot of things can still be improved. If there is something you want to see added or if something does not work as you want it to, feel free to open an issue.

Here is a list of features I have in mind and will be working on :

  • Support for Amazon Music
  • More metadata in the SongMetadata class
  • Handle edge case in explorer_handler
  • Re-sort explorer results

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

mumee-0.0.5.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

mumee-0.0.5-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file mumee-0.0.5.tar.gz.

File metadata

  • Download URL: mumee-0.0.5.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1041-azure

File hashes

Hashes for mumee-0.0.5.tar.gz
Algorithm Hash digest
SHA256 40442387b38d37a2356ef2a5a428d0cdeb7b81f9caa32879f54537f5328a8d66
MD5 891ec57109f88d3923051a87e653119f
BLAKE2b-256 4028f2cf3a570ec8795d363f525521d0d88a97eb7415bd58c87460f5b87bb29e

See more details on using hashes here.

File details

Details for the file mumee-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: mumee-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1041-azure

File hashes

Hashes for mumee-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d04eeb73c27b4a7ed605a5c95008d8de05e44e34aa2b691dca850068199d36b3
MD5 a135d777a919b59017dfa9cd1c74d452
BLAKE2b-256 0bfd35198a19184113952d4a7458bce7d0d85a0ea5d0b721758a8d5dbcaca133

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