Skip to main content

🎵 FetchTune

Universal music metadata resolver for Python.

FetchTune is a lightweight Python library and CLI for resolving music URLs into clean, structured metadata.

It provides a unified interface for working with music data across different platforms, including tracks, artists, albums, artwork, release dates, durations, and platform information.

Supported: Spotify · Apple Music


✨ Features

Feature Status
Track metadata
Artist metadata
Album metadata
Artwork & images
Release date
Duration
Explicit status
Platform IDs & URLs
JSON serialization
Cross-provider enrichment
CLI
Interactive URL input

🧱 Architecture

FetchTune uses a provider-based architecture. Each platform has its own provider responsible for resolving and normalizing platform-specific data.

                         FetchTune
                            │
                         Resolver
                            │
                ┌───────────┴───────────┐
                │                       │
        SpotifyProvider          AppleProvider
                │                       │
                └───────────┬───────────┘
                            │
                          Models
                     ┌──────┼──────┐
                     │      │      │
                   Artist  Album  Track

The core models remain platform-independent, making it possible to add new providers without changing the rest of the library.


📦 Installation

pip install fetchtune

🚀 Usage

CLI

Pass a supported music URL:

fetchtune "https://open.spotify.com/track/4a0yULThaKQTm0hYPGEMOc"

For JSON output:

fetchtune --json "https://open.spotify.com/track/4a0yULThaKQTm0hYPGEMOc"

Python

from fetchtune import resolve

track = resolve(
    "https://open.spotify.com/track/4a0yULThaKQTm0hYPGEMOc"
)

print(track.title)
print(track.to_json(indent=2))

🎵 Example

FetchTune resolving a real Spotify track:

Fooroodgah - HEEN's Reinterpretation

Fooroodgah - HEEN's Reinterpretation

Mehrad Hidden · HEEN

Open on Spotify ↗

Metadata

Field Value
Title Fooroodgah - HEEN's Reinterpretation
Artists Mehrad Hidden, HEEN
Platform Spotify
Track ID 4a0yULThaKQTm0hYPGEMOc
Release Date 2026-08-28
Duration 3:27
Duration (ms) 207875
Explicit No
Album null

Artists

Artist Spotify ID
Mehrad Hidden 0jCVTRvQkILbJvpviTpvd1
HEEN 3dt8LORgsqjLP8hAYsFKdY

Artwork

Size URL
640 × 640 https://image-cdn-ak.spotifycdn.com/image/ab67616d0000b2739a1801fbe63582bc1b0678d9
300 × 300 https://image-cdn-ak.spotifycdn.com/image/ab67616d00001e029a1801fbe63582bc1b0678d9
64 × 64 https://image-cdn-ak.spotifycdn.com/image/ab67616d000048519a1801fbe63582bc1b0678d9

JSON

{
  "title": "Fooroodgah - HEEN's Reinterpretation",
  "artists": [
    {
      "name": "Mehrad Hidden",
      "id": "0jCVTRvQkILbJvpviTpvd1",
      "url": "https://open.spotify.com/artist/0jCVTRvQkILbJvpviTpvd1"
    },
    {
      "name": "HEEN",
      "id": "3dt8LORgsqjLP8hAYsFKdY",
      "url": "https://open.spotify.com/artist/3dt8LORgsqjLP8hAYsFKdY"
    }
  ],
  "album": null,
  "cover_url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d0000b2739a1801fbe63582bc1b0678d9",
  "images": [
    {
      "url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d00001e029a1801fbe63582bc1b0678d9",
      "width": 300,
      "height": 300
    },
    {
      "url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d000048519a1801fbe63582bc1b0678d9",
      "width": 64,
      "height": 64
    },
    {
      "url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d0000b2739a1801fbe63582bc1b0678d9",
      "width": 640,
      "height": 640
    }
  ],
  "release_date": "2026-08-28T00:00:00Z",
  "duration_ms": 207875,
  "is_explicit": false,
  "platform": "spotify",
  "platform_id": "4a0yULThaKQTm0hYPGEMOc",
  "url": "https://open.spotify.com/track/4a0yULThaKQTm0hYPGEMOc"
}

🔄 Album Enrichment

FetchTune can enrich incomplete track metadata using other providers.

For example:

{
  "album": null
}

can potentially become:

{
  "album": {
    "name": "Innerlight EP",
    "id": "1582831419",
    "release_date": "2021-07-30T12:00:00Z",
    "total_tracks": 4
  }
}

This keeps the final Track model useful even when the original platform doesn't provide complete release information.


🧪 Testing

FetchTune includes tests for providers, models, resolver behavior, URL parsing, artwork handling, matching, enrichment, and serialization.

Run the test suite:

pytest

Current status:

18 passed

🛠️ Development

git clone https://github.com/momalekiii/fetchtune.git
cd fetchtune

python3 -m venv .venv
source .venv/bin/activate

pip install -e .
pytest

Build the package:

python -m build

Check the distribution:

python -m twine check dist/*

📄 License

MIT License


FetchTune
Music metadata, resolved.

© @momalekiii · 2026

```

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fetchtune-0.1.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fetchtune-0.1.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file fetchtune-0.1.0.tar.gz.

File metadata

  • Download URL: fetchtune-0.1.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for fetchtune-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a59802dd08ffcd8194e40239771ddc0d747754014f31c027ccd6b5428fde08c3
MD5 d258d43b59771a7346cdba3369355456
BLAKE2b-256 7db068977a64f2e33417fbf148b2301fa2e8f2fa4e5cee9a5a2d74edbd255b45

See more details on using hashes here.

File details

Details for the file fetchtune-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fetchtune-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for fetchtune-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 636615a573bdffad63cec2e96ba0d7bd559adf05a5f8ebfbdd0a89d0f2853357
MD5 2c7d894ca76dd5b4599ac64ef5224aa0
BLAKE2b-256 c13239ab40908230ac13e58f669f556a9215e0d143df280c8447c34d6384f13b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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