Skip to main content

Python client for radarr and sonarr

Project description

GitHub Codecov Read the Docs GitHub release (latest by date) PyPI Downloads

What's pycliarr

Python client for radarr and sonarr apis. The package provides python client and CLI to use in command line.

Documentation homepage

Usage

Sonarr CLI

pyvenv/bin/pycliarr -t "http://192.168.0.199:8989" -k "2ac2d8f667524da3bx1849e81dba5a84" -d sonarr get -i 65
pyvenv/bin/pycliarr -t "http://192.168.0.199:8989" -k "2ac2d8f667524da3bax849e81dba5a84" -d sonarr add -t "the walking dead"

Radarr CLI

pyvenv/bin/pycliarr -t "http://192.168.0.199:7878" -k "2ac2d8f667524da3bx1849e81dba5a84" -d radarr get -i 65
pyvenv/bin/pycliarr -t "http://192.168.0.199:7878" -k "2ac2d8f667524da3bax849e81dba5a84" -d radarr add -t "wonder woman"

Using radarr client

from pycliarr.api import RadarrCli
radarr_cli = RadarrCli('http://192.168.0.199:7878', '5f5e32qf3ff8463e9f3d2388af0fd3e8')
radarr_cli.add_movie(imdb_id="tt1234", quality=1)
movie = radarr_cli.get_movie(12)
print(movie.title)

Using sonarr client

from pycliarr.api import SonarrCli
sonarr_cli = SonarrCli('http://192.168.0.199:8989', '2ac2d8f667524da3bx1849e81dba5a84')
sonarr_cli.add_serie(imdb_id="tt1234", quality=1)
serie = sonarr_cli.get_serie(12)
print(serie.title)

CLI help

Clients:

pyvenv/bin/pycliarr --help
PyCliarr version 0.0.1
usage: pycliarr [-h] --host HOST --api-key API_KEY [--user USER] [--password PASSWORD] [--debug] {sonarr,radarr} ...

Radarr/Sonarr client

positional arguments:
  {sonarr,radarr}
    sonarr              use sonarr client
    radarr              use radarr client

optional arguments:
  -h, --help            show this help message and exit
  --host HOST, -t HOST  Host url, e.g 'http://192.168.0.1'
  --api-key API_KEY, -k API_KEY
                        API key, e.g '5f5e32xf3ff8463d9f1d2u88ef0fd3e8'
  --user USER, -u USER  Username if using basic authentication
  --password PASSWORD, -p PASSWORD
                        Password if using basic authentication
  --debug, -d           Enable debug logging

Radarr CLI:

pyvenv/bin/pycliarr radarr --help
PyCliarr version 0.0.1
usage: pycliarr radarr [-h] {get,delete,add,refresh,rescan,profiles,system-status,disk-space,queue,calendar,delqueue,wanted} ...

positional arguments:
  {get,delete,add,refresh,rescan,profiles,system-status,disk-space,queue,calendar,delqueue,wanted}
    get                 Get info on a of movie
    delete              Delete a movie
    add                 Add a movie from the imdb/tmdb id, or look for keywords
    refresh             Refresh movies
    rescan              Rescan movies
    profiles            Get list of quality profiles
    system-status       Get system status
    disk-space          Get disk space
    queue               Get current downloading queue
    calendar            Get events from calendar
    delqueue            Get list of quality profiles
    wanted              List wanted/missing

optional arguments:
  -h, --help            show this help message and exit

Sonarr CLI:

pyvenv/bin/pycliarr sonarr --help
PyCliarr version 0.0.1
usage: pycliarr sonarr [-h] {get,delete,add,refresh,rescan,get-episode,get-episode-file,delete-episode-file,profiles,system-status,disk-space,queue,calendar,delqueue,wanted} ...

positional arguments:
  {get,delete,add,refresh,rescan,get-episode,get-episode-file,delete-episode-file,profiles,system-status,disk-space,queue,calendar,delqueue,wanted}
    get                 Get info on a of serie
    delete              Delete a serie
    add                 Add a serie from the tvdb id, or look for keywords
    refresh             Refresh series
    rescan              Rescan series
    get-episode         Get info on an episode
    get-episode-file    Get info on an episode file
    delete-episode-file
                        Get info on a of serie
    profiles            Get list of quality profiles
    system-status       Get system status
    disk-space          Get disk space
    queue               Get current downloading queue
    calendar            Get events from calendar
    delqueue            Get list of quality profiles
    wanted              List wanted/missing

optional arguments:
  -h, --help            show this help message and exit

Installation

From pip:

pip pycliarr

From git:

git clone https://github.com/vche/pycliarr.git
pip install -e .

Development

Installing sources projects

Get the project and create the virtual env:

git clone https://github.com/vche/pycliarr.git
virtualenv pyvenv
. pyvenv/bin/activate
pip install -e .

Note: Entry points will be installed in pyvenv/bin, libs with pyvenv libs

Run tests

pip install tox
tox

If mypy fails due to missing import stubs:

.tox/checkers/bin/mypy --install-types

Generate documentation:

pip install sphinx sphinx_rtd_theme m2r
./setup.py doc

In case new classes/modules are added, update the autodoc list:

rm  docs/sphinx_conf/source/*
sphinx-apidoc -f -o docs/sphinx_conf/source/ src/pycliarr --separate

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

pycliarr-1.0.15.tar.gz (17.9 kB view hashes)

Uploaded Source

Built Distribution

pycliarr-1.0.15-py3-none-any.whl (20.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page