Python client for JSON API provided by Sonarr and its derivatives (Radarr, etc.)
This package targets 100% coverage of the API (GET, POST, PUT, DELETE), with close alignment between the Python syntax and the JSON API.
downloadcarr
requires Python version 3.7+, and depends only on the standard
libary (no external dependencies).
import dataclasses
from downloadcarr import SonarrClient, RadarrClient
SONARR_HOST = "192.168.1.100"
SONARR_API_KEY = "deadbeefdeadbeefdeadbeefdeadbeef"
RADARR_HOST = "192.168.1.100"
RADARR_API_KEY = "cafebabecafebabecafebabecafebabe"
sonarr_client = SonarrClient(SONARR_HOST, SONARR_API_KEY)
all_series = sonarr_client.get_all_series()
series = all_series[5]
series_unmonitored = dataclasses.replace(series, monitored=False)
sonarr_client.update_series(series_unmonitored)
radarr_client = RadarrClient(RADARR_HOST, RADARR_API_KEY)
movies = radarr_client.get_movies()
movie = movies[-1]
radarr_client.refresh_movie(movie.id)
radarr_client.search_cutoff_unmet_movies()