Core charm libraries for Charmarr media automation
Project description
charmarr-lib-core
Core charm libraries for Charmarr media automation.
Features
- Juju relation interfaces for media automation
- API clients for *arr applications (Radarr, Sonarr, Prowlarr, etc.)
- Reconcilers for managing application configuration
- Pydantic models for type-safe data validation
- K8s storage utilities for StatefulSet patching
Installation
pip install charmarr-lib-core
Usage
Interfaces
from charmarr_lib.core.interfaces import (
# Media Indexer (Prowlarr <-> Radarr/Sonarr/Lidarr)
MediaIndexerProvider,
MediaIndexerRequirer,
MediaIndexerProviderData,
MediaIndexerRequirerData,
# Download Client (qBittorrent/SABnzbd <-> Radarr/Sonarr/Lidarr)
DownloadClientProvider,
DownloadClientRequirer,
DownloadClientProviderData,
DownloadClientRequirerData,
# Media Storage (shared PVC <-> all apps)
MediaStorageProvider,
MediaStorageRequirer,
MediaStorageProviderData,
MediaStorageRequirerData,
# Media Manager (Radarr/Sonarr <-> Overseerr/Jellyseerr)
MediaManagerProvider,
MediaManagerRequirer,
MediaManagerProviderData,
MediaManagerRequirerData,
QualityProfile,
)
API Clients
from charmarr_lib.core import (
# Radarr/Sonarr/Lidarr client (v3 API)
ArrApiClient,
# Prowlarr client (v1 API)
ProwlarrApiClient,
# Errors
ArrApiError,
ArrApiConnectionError,
ArrApiResponseError,
)
# Connect to Radarr
with ArrApiClient("http://radarr:7878", api_key) as client:
profiles = client.get_quality_profiles()
client.add_root_folder("/movies")
Reconcilers
from charmarr_lib.core import (
reconcile_download_clients,
reconcile_media_manager_connections,
reconcile_root_folder,
reconcile_external_url,
)
# Sync download clients from relations to Radarr
reconcile_download_clients(
api_client=arr_client,
desired_clients=download_client_data_from_relations,
category="radarr",
media_manager=MediaManager.RADARR,
get_secret=lambda sid: model.get_secret(id=sid).get_content(),
)
Storage Utilities
from charmarr_lib.core import (
reconcile_storage_volume,
is_storage_mounted,
K8sResourceManager,
ReconcileResult,
)
manager = K8sResourceManager()
result = reconcile_storage_volume(
manager=manager,
statefulset_name="radarr",
container_name="radarr", # from charmcraft.yaml
namespace="media",
pvc_name="media-storage",
mount_path="/data",
)
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 charmarr_lib_core-0.13.0.tar.gz.
File metadata
- Download URL: charmarr_lib_core-0.13.0.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f18314f9abd9b1ce5094b78ae30617f765421de8e3c6ea8c0bbfa1e1ba6b4e5f
|
|
| MD5 |
904fb34de17cbe0c567993485ed13738
|
|
| BLAKE2b-256 |
f8031353db23f8afb991b4d6a609e5903a57ad37b2f14c50dc8f331198945f13
|
Provenance
The following attestation bundles were made for charmarr_lib_core-0.13.0.tar.gz:
Publisher:
release.yml on charmarr/charmarr-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
charmarr_lib_core-0.13.0.tar.gz -
Subject digest:
f18314f9abd9b1ce5094b78ae30617f765421de8e3c6ea8c0bbfa1e1ba6b4e5f - Sigstore transparency entry: 1108738740
- Sigstore integration time:
-
Permalink:
charmarr/charmarr-lib@7e1ce24b3e6c1289e331ce5deaa0b1ff9f9dea63 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/charmarr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7e1ce24b3e6c1289e331ce5deaa0b1ff9f9dea63 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file charmarr_lib_core-0.13.0-py3-none-any.whl.
File metadata
- Download URL: charmarr_lib_core-0.13.0-py3-none-any.whl
- Upload date:
- Size: 42.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
839939e080729fbb03757731bb7049daf28983b650888120db611db95a8c1c2c
|
|
| MD5 |
68b8fc4c8427f3b270c48ec3836aa7f2
|
|
| BLAKE2b-256 |
186f4d0dafea837932517ae4ee39b8b5c230a5c8ee78fed0507914b162330924
|
Provenance
The following attestation bundles were made for charmarr_lib_core-0.13.0-py3-none-any.whl:
Publisher:
release.yml on charmarr/charmarr-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
charmarr_lib_core-0.13.0-py3-none-any.whl -
Subject digest:
839939e080729fbb03757731bb7049daf28983b650888120db611db95a8c1c2c - Sigstore transparency entry: 1108738758
- Sigstore integration time:
-
Permalink:
charmarr/charmarr-lib@7e1ce24b3e6c1289e331ce5deaa0b1ff9f9dea63 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/charmarr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7e1ce24b3e6c1289e331ce5deaa0b1ff9f9dea63 -
Trigger Event:
workflow_run
-
Statement type: