Bridge streaming services easily with advanced matching
Project description
downmixer is a library to support connecting between streaming services. It can match any song, from any streaming service (or any arbitrary library of files), with the same song or as close as possible when it straight up isn't available.
It's flexible, and provides a comprehensive API that can be extended for almost any use case. Making your own **provider ** (the bridge between services and downmixer) is as easy as...
import ... from ...
# Every provider needs a separate connection object
class MyProviderConnection(Connection):
def initialize(self) -> bool:
# Implement your APIs here
pass
# [...]
class MyProvider(BaseProvider):
def fetch_song(self, id: str) -> Song:
# Implement your APIs here
pass
def fetch_album(self, id: str) -> Album:
# Implement your APIs here
pass
# [...]
Providers inherit from a base class, which has only the basic skeleton of a downmixer Provider; the actual interface the class will have is determined by the Protocols it implements.
You can make your classes inherit all the protocols it uses, but duck typing is recommended.
With your own providers, you can then automate tasks easily with any other service:
from downmixer.matching import match
from downmixer.types.library import ResourceType
# Initialize your providers
conn_a = MyProviderConnection()
conn_a.initialize()
provider_a = MyProvider(conn_a)
conn_b = AnotherProviderConnection()
conn_b.initialize()
provider_b = AnotherProvider(conn_b)
# Fetch a song from one provider and find it on another
song = provider_a.fetch_song("some-id")
results = provider_b.search(song.name, [ResourceType.SONG])
best = match(song, results[0].result)
print(best.quality, best.sum)
The documentation is comprehensive and has a few guides to get you started.
Installation
# uv
uv add git+https://git.gay/neufter/downmixer.git
# pip
pip install git+https://git.gay/neufter/downmixer.git
Development
Work on dev (or a feature branch/fork) and open a PR into main. main branch is protected to keep it clean, and
keep commits mostly 1:1 with releases.
Releasing
We use the Release workflow on Forgejo to trigger an automatic release which does all the checks, bumps the version if
needed, and commits to main.
Building
Uses uv package manager. To build from source:
git clone https://git.gay/neufter/downmixer
cd downmixer
uv build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file downmixer-1.0.1.tar.gz.
File metadata
- Download URL: downmixer-1.0.1.tar.gz
- Upload date:
- Size: 156.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6812450162c90d8adb490d0a8e147548dc96402a56d6e83b4731fda53952ac8
|
|
| MD5 |
1d43332ce976a2d31d1efb443688bf76
|
|
| BLAKE2b-256 |
1e1d34bd0266548eb8751abe34251a3aac059ba7ed17736823389f6fad73a845
|
File details
Details for the file downmixer-1.0.1-py3-none-any.whl.
File metadata
- Download URL: downmixer-1.0.1-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45a4778ead74befe45a33760fad08ed5fa285e1b489ddf65d9cf14a6fe589cfc
|
|
| MD5 |
100758419a9655af4a12a9e70fa81857
|
|
| BLAKE2b-256 |
ced6dc4a3778056cdc03298f4ef4b64e0773f1f54d3e26002c3afeb3a628a640
|