pycliarr


Namepycliarr JSON
Version 1.0.27 PyPI version JSON
download
home_pagehttps://github.com/vche/pycliarr
SummaryPython client for radarr and sonarr
upload_time2024-05-21 15:32:17
maintainerNone
docs_urlNone
authorVivien Chene
requires_python>=3.6
licenseNone
keywords python tool
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![GitHub](https://img.shields.io/github/license/vche/pycliarr) [![Codecov](https://img.shields.io/codecov/c/github/vche/pycliarr)](https://codecov.io/gh/vche/pycliarr) [![Read the Docs](https://img.shields.io/readthedocs/pycliarr)](https://pycliarr.readthedocs.io/en/latest/) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/vche/pycliarr)](https://github.com/vche/pycliarr/releases) [![PyPI](https://img.shields.io/pypi/v/pycliarr)](https://pypi.org/project/pycliarr/) [![Downloads](https://pepy.tech/badge/pycliarr)](https://pepy.tech/project/pycliarr)

## What's pycliarr

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

[Documentation homepage](https://pycliarr.readthedocs.io/en/latest/)

## Usage

Sonarr CLI
```sh
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
```sh
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
```python
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
```python
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:
```sh
pyvenv/bin/pycliarr --help
PyCliarr version 1.0.22
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
    config              use config 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:
```sh
pyvenv/bin/pycliarr radarr --help
PyCliarr version 1.0.21
usage: pycliarr radarr [-h]
                       {get,delete,add,edit,refresh,rescan,profiles,system-status,disk-space,queue,calendar,delete-queue,wanted,status,blocklist,delete-blocklist,notification,delete-notification,put-notification,tag,tag-detail,delete-tag,edit-tag,create-tag,tag-items,exclusion,delete-exclusion,create-exclusion,search-missing,root-folders}
                       ...

positional arguments:
  {get,delete,add,edit,refresh,rescan,profiles,system-status,disk-space,queue,calendar,delete-queue,wanted,status,blocklist,delete-blocklist,notification,delete-notification,put-notification,tag,tag-detail,delete-tag,edit-tag,create-tag,tag-items,exclusion,delete-exclusion,create-exclusion,search-missing,root-folders}
    get                 Get info on a of movie
    delete              Delete a movie
    add                 Add a movie from the imdb/tmdb id, or look for keywords
    edit                Push an updated item to the movie library
    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
    delete-queue        Get list of quality profiles
    wanted              List wanted/missing
    status              Get status of 1 or all currently running commands
    blocklist           Get blocklisted items
    delete-blocklist    Get list of quality profiles
    notification        Get notification(s)
    delete-notification
                        Delete the specified notification or all
    put-notification    Create the specified notification
    tag                 Get tag(s)
    tag-detail          Get tag(s) details
    delete-tag          Delete the specified tag
    edit-tag            Edit the specified tag
    create-tag          Create the specified tag
    tag-items           List items with specifed tag
    exclusion           Get exclusion(s)
    delete-exclusion    Delete the specified exclusion
    create-exclusion    Create the specified exclusion
    search-missing      Search missing movies
    root-folders        Get root folder list

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

Sonarr CLI:
```sh
pyvenv/bin/pycliarr sonarr --help
PyCliarr version 1.0.22
usage: pycliarr sonarr [-h]
                       {get,delete,add,refresh,rescan,get-episode,get-episode-file,delete-episode-file,profiles,system-status,disk-space,queue,calendar,delete-queue,wanted,status,blocklist,delete-blocklist,notification,delete-notification,put-notification,tag,tag-detail,delete-tag,edit-tag,create-tag,tag-items,exclusion,delete-exclusion,create-exclusion,search-missing,root-folders}
                       ...

positional arguments:
  {get,delete,add,refresh,rescan,get-episode,get-episode-file,delete-episode-file,profiles,system-status,disk-space,queue,calendar,delete-queue,wanted,status,blocklist,delete-blocklist,notification,delete-notification,put-notification,tag,tag-detail,delete-tag,edit-tag,create-tag,tag-items,exclusion,delete-exclusion,create-exclusion,search-missing,root-folders}
    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
    delete-queue        Get list of quality profiles
    wanted              List wanted/missing
    status              Get status of 1 or all currently running commands
    blocklist           Get blocklisted items
    delete-blocklist    Get list of quality profiles
    notification        Get notification(s)
    delete-notification
                        Delete the specified notification or all
    put-notification    Create the specified notification
    tag                 Get tag(s)
    tag-detail          Get tag(s) details
    delete-tag          Delete the specified tag
    edit-tag            Edit the specified tag
    create-tag          Create the specified tag
    tag-items           List items with specifed tag
    exclusion           Get exclusion(s)
    delete-exclusion    Delete the specified exclusion
    create-exclusion    Create the specified exclusion
    search-missing      Search missing episods
    root-folders        Get root folder list

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

Config CLI:

Allows storing default argument values for all commands. Note that while -t and -k arguments are mandatory, they are not used. so any value works.
The config values will be stored in `"/tmp/pycliarr_cfg.json"` and can be freely edited (all default will be reset) or edited manually.

To display all the possible arguments that can be set:
```sh
pycliarr -t "" -k "" config show
```

To change for instance the default value of the queue command page size:
```sh
pycliarr -t "" -k "" config config set -n "CliGetQueueCommand.--page-size" -v "3"
```

Before running the command above, running the following would use a default page size of 20. After running the command, the same command would use a default page size of 3:
```sh
pycliarr -t <url> -k <api key> sonarr queue
```

But specifying the argument works normally, only the defaults (when parameter is not specified) are affected:
```sh
pycliarr -t <url> -k <api key> sonarr queue --page-size 5
```

To clear all defaults and reset them to their orignal value:
```sh
pycliarr -t "" -k "" config clear
```

Help:
```sh
pyvenv/bin/pycliarr config --help
PyCliarr version 1.0.22
usage: pycliarr config [-h] {clear,set,show} ...

positional arguments:
  {clear,set,show}
    clear           Display current config
    set             Set a default value for the specified (Use 'show' to display available keys)
    show            Display current config

options:
  -h, --help        show this help message and exit


## Installation
From pip:
```sh
pip pycliarr
```

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

## Development

### Installing sources projects

Get the project:
```sh
git clone https://github.com/vche/pycliarr.git
cd pycliarr
```

#### Using [pixi](https://pixi.sh/)

```sh
# Install dependencies and pycliarr
pixi run build

# Run the binary
pixi run pycliarr

# Or start a term
pixi shell

# Run tests
pixi run test

#generate doc
pixi run doc
```

#### Using venv and pip
Create the virtual env:
```sh
virtualenv pyvenv
. pyvenv/bin/activate
pip install -e .
```

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

### Run tests

```sh
pip install tox
tox
```

If mypy fails due to missing import stubs:
```
.tox/checkers/bin/mypy --install-types
```

### Generate documentation:

```sh
pip install sphinx sphinx_rtd_theme m2r2
./setup.py doc
```

In case new classes/modules are added, update the autodoc list:
```sh
rm  docs/sphinx_conf/source/*
sphinx-apidoc -f -o docs/sphinx_conf/source/ src/pycliarr --separate
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/vche/pycliarr",
    "name": "pycliarr",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "python tool",
    "author": "Vivien Chene",
    "author_email": "viv@vivc.org",
    "download_url": "https://files.pythonhosted.org/packages/53/a0/9a27cbf6d2a6948fe29383ebdddc81baef437fb319fab76219df1b6705d7/pycliarr-1.0.27.tar.gz",
    "platform": null,
    "description": "![GitHub](https://img.shields.io/github/license/vche/pycliarr) [![Codecov](https://img.shields.io/codecov/c/github/vche/pycliarr)](https://codecov.io/gh/vche/pycliarr) [![Read the Docs](https://img.shields.io/readthedocs/pycliarr)](https://pycliarr.readthedocs.io/en/latest/) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/vche/pycliarr)](https://github.com/vche/pycliarr/releases) [![PyPI](https://img.shields.io/pypi/v/pycliarr)](https://pypi.org/project/pycliarr/) [![Downloads](https://pepy.tech/badge/pycliarr)](https://pepy.tech/project/pycliarr)\n\n## What's pycliarr\n\nPython client for radarr and sonarr apis.\nThe package provides python client and CLI to use in command line.\n\n[Documentation homepage](https://pycliarr.readthedocs.io/en/latest/)\n\n## Usage\n\nSonarr CLI\n```sh\npyvenv/bin/pycliarr -t \"http://192.168.0.199:8989\" -k \"2ac2d8f667524da3bx1849e81dba5a84\" -d sonarr get -i 65\npyvenv/bin/pycliarr -t \"http://192.168.0.199:8989\" -k \"2ac2d8f667524da3bax849e81dba5a84\" -d sonarr add -t \"the walking dead\"\n```\n\nRadarr CLI\n```sh\npyvenv/bin/pycliarr -t \"http://192.168.0.199:7878\" -k \"2ac2d8f667524da3bx1849e81dba5a84\" -d radarr get -i 65\npyvenv/bin/pycliarr -t \"http://192.168.0.199:7878\" -k \"2ac2d8f667524da3bax849e81dba5a84\" -d radarr add -t \"wonder woman\"\n```\n\nUsing radarr client\n```python\nfrom pycliarr.api import RadarrCli\nradarr_cli = RadarrCli('http://192.168.0.199:7878', '5f5e32qf3ff8463e9f3d2388af0fd3e8')\nradarr_cli.add_movie(imdb_id=\"tt1234\", quality=1)\nmovie = radarr_cli.get_movie(12)\nprint(movie.title)\n```\n\nUsing sonarr client\n```python\nfrom pycliarr.api import SonarrCli\nsonarr_cli = SonarrCli('http://192.168.0.199:8989', '2ac2d8f667524da3bx1849e81dba5a84')\nsonarr_cli.add_serie(imdb_id=\"tt1234\", quality=1)\nserie = sonarr_cli.get_serie(12)\nprint(serie.title)\n```\n\n## CLI help\n\nClients:\n```sh\npyvenv/bin/pycliarr --help\nPyCliarr version 1.0.22\nusage: pycliarr [-h] --host HOST --api-key API_KEY [--user USER] [--password PASSWORD] [--debug] {sonarr,radarr} ...\n\nRadarr/Sonarr client\n\npositional arguments:\n  {sonarr,radarr}\n    sonarr              use sonarr client\n    radarr              use radarr client\n    config              use config client\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --host HOST, -t HOST  Host url, e.g 'http://192.168.0.1'\n  --api-key API_KEY, -k API_KEY\n                        API key, e.g '5f5e32xf3ff8463d9f1d2u88ef0fd3e8'\n  --user USER, -u USER  Username if using basic authentication\n  --password PASSWORD, -p PASSWORD\n                        Password if using basic authentication\n  --debug, -d           Enable debug logging\n```\n\nRadarr CLI:\n```sh\npyvenv/bin/pycliarr radarr --help\nPyCliarr version 1.0.21\nusage: pycliarr radarr [-h]\n                       {get,delete,add,edit,refresh,rescan,profiles,system-status,disk-space,queue,calendar,delete-queue,wanted,status,blocklist,delete-blocklist,notification,delete-notification,put-notification,tag,tag-detail,delete-tag,edit-tag,create-tag,tag-items,exclusion,delete-exclusion,create-exclusion,search-missing,root-folders}\n                       ...\n\npositional arguments:\n  {get,delete,add,edit,refresh,rescan,profiles,system-status,disk-space,queue,calendar,delete-queue,wanted,status,blocklist,delete-blocklist,notification,delete-notification,put-notification,tag,tag-detail,delete-tag,edit-tag,create-tag,tag-items,exclusion,delete-exclusion,create-exclusion,search-missing,root-folders}\n    get                 Get info on a of movie\n    delete              Delete a movie\n    add                 Add a movie from the imdb/tmdb id, or look for keywords\n    edit                Push an updated item to the movie library\n    refresh             Refresh movies\n    rescan              Rescan movies\n    profiles            Get list of quality profiles\n    system-status       Get system status\n    disk-space          Get disk space\n    queue               Get current downloading queue\n    calendar            Get events from calendar\n    delete-queue        Get list of quality profiles\n    wanted              List wanted/missing\n    status              Get status of 1 or all currently running commands\n    blocklist           Get blocklisted items\n    delete-blocklist    Get list of quality profiles\n    notification        Get notification(s)\n    delete-notification\n                        Delete the specified notification or all\n    put-notification    Create the specified notification\n    tag                 Get tag(s)\n    tag-detail          Get tag(s) details\n    delete-tag          Delete the specified tag\n    edit-tag            Edit the specified tag\n    create-tag          Create the specified tag\n    tag-items           List items with specifed tag\n    exclusion           Get exclusion(s)\n    delete-exclusion    Delete the specified exclusion\n    create-exclusion    Create the specified exclusion\n    search-missing      Search missing movies\n    root-folders        Get root folder list\n\noptional arguments:\n  -h, --help            show this help message and exit\n```\n\nSonarr CLI:\n```sh\npyvenv/bin/pycliarr sonarr --help\nPyCliarr version 1.0.22\nusage: pycliarr sonarr [-h]\n                       {get,delete,add,refresh,rescan,get-episode,get-episode-file,delete-episode-file,profiles,system-status,disk-space,queue,calendar,delete-queue,wanted,status,blocklist,delete-blocklist,notification,delete-notification,put-notification,tag,tag-detail,delete-tag,edit-tag,create-tag,tag-items,exclusion,delete-exclusion,create-exclusion,search-missing,root-folders}\n                       ...\n\npositional arguments:\n  {get,delete,add,refresh,rescan,get-episode,get-episode-file,delete-episode-file,profiles,system-status,disk-space,queue,calendar,delete-queue,wanted,status,blocklist,delete-blocklist,notification,delete-notification,put-notification,tag,tag-detail,delete-tag,edit-tag,create-tag,tag-items,exclusion,delete-exclusion,create-exclusion,search-missing,root-folders}\n    get                 Get info on a of serie\n    delete              Delete a serie\n    add                 Add a serie from the tvdb id, or look for keywords\n    refresh             Refresh series\n    rescan              Rescan series\n    get-episode         Get info on an episode\n    get-episode-file    Get info on an episode file\n    delete-episode-file\n                        Get info on a of serie\n    profiles            Get list of quality profiles\n    system-status       Get system status\n    disk-space          Get disk space\n    queue               Get current downloading queue\n    calendar            Get events from calendar\n    delete-queue        Get list of quality profiles\n    wanted              List wanted/missing\n    status              Get status of 1 or all currently running commands\n    blocklist           Get blocklisted items\n    delete-blocklist    Get list of quality profiles\n    notification        Get notification(s)\n    delete-notification\n                        Delete the specified notification or all\n    put-notification    Create the specified notification\n    tag                 Get tag(s)\n    tag-detail          Get tag(s) details\n    delete-tag          Delete the specified tag\n    edit-tag            Edit the specified tag\n    create-tag          Create the specified tag\n    tag-items           List items with specifed tag\n    exclusion           Get exclusion(s)\n    delete-exclusion    Delete the specified exclusion\n    create-exclusion    Create the specified exclusion\n    search-missing      Search missing episods\n    root-folders        Get root folder list\n\noptional arguments:\n  -h, --help            show this help message and exit\n```\n\nConfig CLI:\n\nAllows storing default argument values for all commands. Note that while -t and -k arguments are mandatory, they are not used. so any value works.\nThe config values will be stored in `\"/tmp/pycliarr_cfg.json\"` and can be freely edited (all default will be reset) or edited manually.\n\nTo display all the possible arguments that can be set:\n```sh\npycliarr -t \"\" -k \"\" config show\n```\n\nTo change for instance the default value of the queue command page size:\n```sh\npycliarr -t \"\" -k \"\" config config set -n \"CliGetQueueCommand.--page-size\" -v \"3\"\n```\n\nBefore running the command above, running the following would use a default page size of 20. After running the command, the same command would use a default page size of 3:\n```sh\npycliarr -t <url> -k <api key> sonarr queue\n```\n\nBut specifying the argument works normally, only the defaults (when parameter is not specified) are affected:\n```sh\npycliarr -t <url> -k <api key> sonarr queue --page-size 5\n```\n\nTo clear all defaults and reset them to their orignal value:\n```sh\npycliarr -t \"\" -k \"\" config clear\n```\n\nHelp:\n```sh\npyvenv/bin/pycliarr config --help\nPyCliarr version 1.0.22\nusage: pycliarr config [-h] {clear,set,show} ...\n\npositional arguments:\n  {clear,set,show}\n    clear           Display current config\n    set             Set a default value for the specified (Use 'show' to display available keys)\n    show            Display current config\n\noptions:\n  -h, --help        show this help message and exit\n\n\n## Installation\nFrom pip:\n```sh\npip pycliarr\n```\n\nFrom git:\n```sh\ngit clone https://github.com/vche/pycliarr.git\npip install -e .\n```\n\n## Development\n\n### Installing sources projects\n\nGet the project:\n```sh\ngit clone https://github.com/vche/pycliarr.git\ncd pycliarr\n```\n\n#### Using [pixi](https://pixi.sh/)\n\n```sh\n# Install dependencies and pycliarr\npixi run build\n\n# Run the binary\npixi run pycliarr\n\n# Or start a term\npixi shell\n\n# Run tests\npixi run test\n\n#generate doc\npixi run doc\n```\n\n#### Using venv and pip\nCreate the virtual env:\n```sh\nvirtualenv pyvenv\n. pyvenv/bin/activate\npip install -e .\n```\n\nNote: Entry points will be installed in pyvenv/bin, libs with pyvenv libs\n\n### Run tests\n\n```sh\npip install tox\ntox\n```\n\nIf mypy fails due to missing import stubs:\n```\n.tox/checkers/bin/mypy --install-types\n```\n\n### Generate documentation:\n\n```sh\npip install sphinx sphinx_rtd_theme m2r2\n./setup.py doc\n```\n\nIn case new classes/modules are added, update the autodoc list:\n```sh\nrm  docs/sphinx_conf/source/*\nsphinx-apidoc -f -o docs/sphinx_conf/source/ src/pycliarr --separate\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python client for radarr and sonarr",
    "version": "1.0.27",
    "project_urls": {
        "Homepage": "https://github.com/vche/pycliarr"
    },
    "split_keywords": [
        "python",
        "tool"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25f441982c9c431e3baefc144e30fe86d6c450ff05a61c18bba4491a896a9bce",
                "md5": "05bd1047bd2b6775dfb7114af92718c2",
                "sha256": "f7cb1d2d9469ebaf9a329128bb0181f3bb363a1a85fe2baeada6c9dd49674194"
            },
            "downloads": -1,
            "filename": "pycliarr-1.0.27-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "05bd1047bd2b6775dfb7114af92718c2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 26983,
            "upload_time": "2024-05-21T15:32:16",
            "upload_time_iso_8601": "2024-05-21T15:32:16.214889Z",
            "url": "https://files.pythonhosted.org/packages/25/f4/41982c9c431e3baefc144e30fe86d6c450ff05a61c18bba4491a896a9bce/pycliarr-1.0.27-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53a09a27cbf6d2a6948fe29383ebdddc81baef437fb319fab76219df1b6705d7",
                "md5": "71072dd6036c5f07459de9c89d0e86db",
                "sha256": "cbf2daec0bf02cc37ba0f3f6c560147532a71b658dc48221bda97ea0e625c4a8"
            },
            "downloads": -1,
            "filename": "pycliarr-1.0.27.tar.gz",
            "has_sig": false,
            "md5_digest": "71072dd6036c5f07459de9c89d0e86db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 24558,
            "upload_time": "2024-05-21T15:32:17",
            "upload_time_iso_8601": "2024-05-21T15:32:17.513290Z",
            "url": "https://files.pythonhosted.org/packages/53/a0/9a27cbf6d2a6948fe29383ebdddc81baef437fb319fab76219df1b6705d7/pycliarr-1.0.27.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-21 15:32:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vche",
    "github_project": "pycliarr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pycliarr"
}
        
Elapsed time: 0.22694s