Client for async communication with the iBroadcast api.
Project description
iBroadcastAIO
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
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 ibroadcastaio-0.3.1.tar.gz.
File metadata
- Download URL: ibroadcastaio-0.3.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b6dbcd91474112e9b10cdbe3129c7134dc2353fb8a6dde53c040a546c5e5581
|
|
| MD5 |
891e7f72be829ad17d7ada05b854c8d1
|
|
| BLAKE2b-256 |
be0c62732928b7b3c9b74398963b4d2aad4bf11cf1cdbcf243b613ac82a0f9c5
|
Provenance
The following attestation bundles were made for ibroadcastaio-0.3.1.tar.gz:
Publisher:
publish.yml on robsonke/ibroadcastaio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ibroadcastaio-0.3.1.tar.gz -
Subject digest:
6b6dbcd91474112e9b10cdbe3129c7134dc2353fb8a6dde53c040a546c5e5581 - Sigstore transparency entry: 152598969
- Sigstore integration time:
-
Permalink:
robsonke/ibroadcastaio@8c86306709f86e4a11a22a4c585511c10b0c9469 -
Branch / Tag:
refs/tags/0.3.1 - Owner: https://github.com/robsonke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c86306709f86e4a11a22a4c585511c10b0c9469 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ibroadcastaio-0.3.1-py3-none-any.whl.
File metadata
- Download URL: ibroadcastaio-0.3.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
317b03fa38985aa8cc6d1b6f823321b2a83268c8a61cbb2857ec2a195155c7bd
|
|
| MD5 |
0142483cad54fabde498dea7d5be8ea6
|
|
| BLAKE2b-256 |
1f87cb8ccababf072c55e384f75c78f1767dea24a0e89b32ae1653ed803e8d70
|
Provenance
The following attestation bundles were made for ibroadcastaio-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on robsonke/ibroadcastaio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ibroadcastaio-0.3.1-py3-none-any.whl -
Subject digest:
317b03fa38985aa8cc6d1b6f823321b2a83268c8a61cbb2857ec2a195155c7bd - Sigstore transparency entry: 152598970
- Sigstore integration time:
-
Permalink:
robsonke/ibroadcastaio@8c86306709f86e4a11a22a4c585511c10b0c9469 -
Branch / Tag:
refs/tags/0.3.1 - Owner: https://github.com/robsonke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c86306709f86e4a11a22a4c585511c10b0c9469 -
Trigger Event:
release
-
Statement type: