Skip to main content

Client for async communication with the iBroadcast api.

Project description

iBroadcastAIO

Upload the iBroadcastAIO Package to PyPI when a Release is created

A Python library inspired by ibroadcast-python for interacting with the iBroadcast API in an async manner. This library is initially built for usage in an iBroadcast music provider in Music Assistant.

Shortcomings of the Current API

While the iBroadcast API provides a robust set of features for interacting with the service, it has some shortcomings. One of the main issues is the lack of fine-grained control over data retrieval and manipulation, which can lead to higher memory usage. This library aims to address these issues by providing more efficient data handling in future updates, allowing for better memory management and performance.

For more info, see their documentation.

Installation

To see if you already have a virtual env (but poetry install should create this for you):

poetry env info --path
source venv/bin/activate

This project uses Poetry for dependency management. To install the dependencies and run the example script:

poetry install
poetry run example

To build and publish the package, use:

poetry build
poetry publish

To run the unit tests:

poetry run python -m unittest discover -s tests

Example Usage

Initialize the client and fetch albums

from ibroadcastaio import IBroadcastClient
from aiohttp import ClientSession

async with ClientSession() as session:
    client = IBroadcastClient(session)
    await client.login("your@email.com", "andyourpassword")
    await client.refresh_library()

    albums = await client.get_albums()
    for album in albums:
        print(album['name'])

Status object

The login() method returns a status object which contains valuable data. Just print the status object to get a good understanding, but these are the main fields:

{
   "messages":[ ],
   "message":"ok",
   "dropbox":{ },
   "lastfm":{ },
   "googledrive":{ },
   "settings":{ },
   "status":{ },
   "authenticated":true,
   "result":true,
   "user":{ }
}

Data Structures

For a very short and simplified example of the complete library JSON that the API provides, see example.json. Below you will find the fields of each main topic.

Tracks

{
    "trashed": 10,
    "track": 0,
    "artists_additional_map": {
        "type": 2,
        "phrase": 1,
        "artist_id": 0
    },
    "type": 17,
    "genre": 3,
    "year": 1,
    "enid": 8,
    "uploaded_time": 19,
    "length": 4,
    "size": 11,
    "uid": 13,
    "path": 12,
    "artwork_id": 6,
    "artists_additional": 20,
    "album_id": 5,
    "uploaded_on": 9,
    "rating": 14,
    "title": 2,
    "artist_id": 7,
    "icatid": 22,
    "genres_additional": 21,
    "plays": 15,
    "file": 16,
    "replay_gain": 18
}

Playlist

{
    "public_id": 4,
    "uid": 2,
    "sort": 8,
    "system_created": 3,
    "artwork_id": 7,
    "type": 5,
    "tracks": 1,
    "name": 0,
    "description": 6
}

Artist

{
    "tracks": 1,
    "trashed": 2,
    "artwork_id": 4,
    "rating": 3,
    "name": 0,
    "icatid": 5
}

Album

{
    "year": 6,
    "name": 0,
    "artists_additional": 7,
    "artists_additional_map": {
        "type": 2,
        "artist_id": 0,
        "phrase": 1
    },
    "tracks": 1,
    "rating": 4,
    "icatid": 8,
    "disc": 5,
    "trashed": 3,
    "artist_id": 2
}

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

ibroadcastaio-0.4.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

ibroadcastaio-0.4.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file ibroadcastaio-0.4.0.tar.gz.

File metadata

  • Download URL: ibroadcastaio-0.4.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for ibroadcastaio-0.4.0.tar.gz
Algorithm Hash digest
SHA256 95d795b660c3d5d3d3aa0c80fad0fe81ce479819bdcab404e3f96f75896d03a7
MD5 4ff3f4e511a30f702ae4570aa8651b9b
BLAKE2b-256 3fb753be6f68449316fdc6554dbe33901264fe3a6cd08083e44ddfdb86220065

See more details on using hashes here.

Provenance

The following attestation bundles were made for ibroadcastaio-0.4.0.tar.gz:

Publisher: publish.yml on robsonke/ibroadcastaio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ibroadcastaio-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ibroadcastaio-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for ibroadcastaio-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b23ff1a77ae54122a434714b4de1fbee69e508603f51567494fcaf1e110b1c6c
MD5 4c64a5aadfeb6ba97e99ceb264f951cd
BLAKE2b-256 3e3174b679049e4623493071100dfb16316502453bf44f0c87dfefc5f7e5cea8

See more details on using hashes here.

Provenance

The following attestation bundles were made for ibroadcastaio-0.4.0-py3-none-any.whl:

Publisher: publish.yml on robsonke/ibroadcastaio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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