Skip to main content

Python HTTP client and mediavocab bridge for a Music Assistant server

Project description

py-music-assistant

Python HTTP client and mediavocab bridge for a Music Assistant server.

It is the single transport + conversion layer shared by the OVOS Music Assistant integrations:

Install

pip install py-music-assistant

Usage

from py_music_assistant import SimpleHTTPMusicAssistantClient, search_to_releases

api = SimpleHTTPMusicAssistantClient("http://192.168.1.100:8095")

# raw search (dict of buckets: tracks/albums/artists/radio/podcasts/audiobooks)
res = api.search_media("viagra boys", limit=10)

# mapped to typed mediavocab.Release objects (unranked; score them yourself)
releases = search_to_releases(res)
for r in releases:
    print(r.work.title, r.work.media_type, r.uri)   # e.g. "Worms" MUSIC library://track/9903

The client talks to the server's synchronous JSON /api endpoint (no WebSocket lifecycle). Item uris are library://<type>/<id> identifiers that the ovos-media-plugin-mass backend resolves and plays.

Docs

Tests

pip install -e .[test]
pytest test/                                   # network-free (mocked + fixtures)
MASS_SERVER_URL=http://<host>:8095 pytest test/live/   # opt-in, against a real server

License

Apache-2.0

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

py_music_assistant-0.0.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

py_music_assistant-0.0.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file py_music_assistant-0.0.1.tar.gz.

File metadata

  • Download URL: py_music_assistant-0.0.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for py_music_assistant-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a618f83c5fb6283c1b46bf25ae3e175ef043c2dbdce4aaaa7739d5fcae613d8b
MD5 7ce8bbca06c6d4d012f9df1110aa3578
BLAKE2b-256 828c7ec3a865301725064857e31c1fc4445ed7941586edb889b0458256914988

See more details on using hashes here.

File details

Details for the file py_music_assistant-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for py_music_assistant-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5d41c17135db68cfc086b6ca171aa0d75dc96b4aa744c0f10dfd204719f1741
MD5 3d6e34eaee9cedc24ac60c9ae6b52411
BLAKE2b-256 8a5222696d5fd7070a6a16ef50a3b0f81df6ef55c6e50a1c2b71fe8b6812bdae

See more details on using hashes here.

Supported by

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