Skip to main content

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",
)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charmarr_lib_core-0.18.0.tar.gz (49.5 kB view details)

Uploaded Source

Built Distribution

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

charmarr_lib_core-0.18.0-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file charmarr_lib_core-0.18.0.tar.gz.

File metadata

  • Download URL: charmarr_lib_core-0.18.0.tar.gz
  • Upload date:
  • Size: 49.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for charmarr_lib_core-0.18.0.tar.gz
Algorithm Hash digest
SHA256 88685199456a0de3e1aebdefada5c636ef5eb677a4480b05dcd33d4b8cdcd988
MD5 cadaa2762dd1d40be794eb7378d177c4
BLAKE2b-256 0eb3bcce848b712da8a7f31b7bc316a028a214f4ba2187fd2c4edc10d55c913e

See more details on using hashes here.

Provenance

The following attestation bundles were made for charmarr_lib_core-0.18.0.tar.gz:

Publisher: release.yml on charmarr/charmarr-lib

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

File details

Details for the file charmarr_lib_core-0.18.0-py3-none-any.whl.

File metadata

File hashes

Hashes for charmarr_lib_core-0.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5755855e4f43cfb4ee3d709653a4067511a5648c653ae2bc44addf25094503b6
MD5 6c436f6a6bac6d235f991fedc7640a14
BLAKE2b-256 a8c307c94763020211c03f9ddf2767c8756ec7f2f5bb3775c5887ff60104a757

See more details on using hashes here.

Provenance

The following attestation bundles were made for charmarr_lib_core-0.18.0-py3-none-any.whl:

Publisher: release.yml on charmarr/charmarr-lib

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

Release history Release notifications | RSS feed

This release

0.18.0 This release

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.1

2 files

0.14.0

2 files

0.13.0

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.5

2 files

0.1.0

2 files

Supported by

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