# -*- coding: utf-8 -*-
from distutils.core import setup

package_dir = \
{'': 'src'}

packages = \
['aria2p']

package_data = \
{'': ['*']}

install_requires = \
['requests']

entry_points = \
{'console_scripts': ['aria2p = aria2p.cli:main']}

setup_kwargs = {
    'name': 'aria2p',
    'version': '0.2.0',
    'description': 'Command-line tool and library to interact with an aria2c daemon process with JSON-RPC.',
    'long_description': '# Aria2p\n[![pipeline status](https://gitlab.com/pawamoy/aria2p/badges/master/pipeline.svg)](https://gitlab.com/pawamoy/aria2p/commits/master)\n[![coverage report](https://gitlab.com/pawamoy/aria2p/badges/master/coverage.svg)](https://gitlab.com/pawamoy/aria2p/commits/master)\n[![documentation](https://img.shields.io/readthedocs/aria2p.svg?style=flat)](https://aria2p.readthedocs.io/en/latest/index.html)\n[![pypi version](https://img.shields.io/pypi/v/aria2p.svg)](https://pypi.org/project/aria2p/)\n\nCommand-line tool and Python library to interact with an `aria2c` daemon process through JSON-RPC.\n\n## Requirements\n`aria2p` requires Python 3.6 or above.\n\n<details>\n<summary>To install Python 3.6, I recommend using <a href="https://github.com/pyenv/pyenv"><code>pyenv</code></a>.</summary>\n\n```bash\n# install pyenv\ngit clone https://github.com/pyenv/pyenv ~/.pyenv\n\n# setup pyenv (you should also put these three lines in .bashrc or similar)\nexport PATH="${HOME}/.pyenv/bin:${PATH}"\nexport PYENV_ROOT="${HOME}/.pyenv"\neval "$(pyenv init -)"\n\n# install Python 3.6\npyenv install 3.6.8\n\n# make it available globally\npyenv global system 3.6.8\n```\n</details>\n\n## Installation\nWith `pip`:\n```bash\npython3.6 -m pip install aria2p\n```\n\nWith [`pipx`](https://github.com/cs01/pipx):\n```bash\n# install pipx with the recommended method\ncurl https://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py | python3\n\npipx install --python python3.6 aria2p\n```\n\n## Usage (as a library)\n**This library is still a work in progress. More examples will be added later.\nIn the meantime, you can read the [Reference section](https://aria2p.readthedocs.io/en/latest/reference.html) on the official documentation.**\n```python\nimport aria2p\n\n# initialization, these are the default values\naria2 = aria2p.API(\n    aria2p.Client(\n        host="http://localhost",\n        port=6800,\n        secret=""\n    )\n)\n\n# list downloads\ndownloads = aria2.get_downloads()\n\nfor download in downloads:\n    print(download.name, download.download_speed)\n    \n# add downloads\nmagnet_uri = "magnet:?xt=urn:..."\n\ndownload = aria2.add_magnet(magnet_uri)\n```\n\n## Usage (command-line)\n```\nusage: aria2p [GLOBAL_OPTS...] COMMAND [COMMAND_OPTS...]\n\nCommand-line tool and Python library to interact with an `aria2c` daemon\nprocess through JSON-RPC.\n\nGlobal options:\n  -h, --help            Show this help message and exit. Commands also accept\n                        the -h/--help option.\n  -p PORT, --port PORT  Port to use to connect to the remote server.\n  -H HOST, --host HOST  Host address for the remote server.\n  -s SECRET, --secret SECRET\n                        Secret token to use to connect to the remote server.\n\nCommands:\n  \n    show                Show the download progression.\n    call                Call a remote method through the JSON-RPC client.\n    add-magnet          Add a download with a Magnet URI.\n    add-torrent         Add a download with a Torrent file.\n    add-metalink        Add a download with a Metalink file.\n    pause               Pause downloads.\n    pause-all           Pause all downloads.\n    resume              Resume downloads.\n    resume-all          Resume all downloads.\n    remove (rm)         Remove downloads.\n    remove-all          Remove all downloads.\n    purge (clear)       Purge the completed/removed/failed downloads.\n```\n\nCalling `aria2p` without any arguments will by default call the `show` command,\nwhich displays the list of current downloads:\n```\nGID  STATUS  PROGRESS  DOWN_SPEED  UP_SPEED  ETA  NAME\n```\n\nThere is no interactive mode yet,\nbut you can use `watch` combined with the `show` subcommand\nto see how the downloads progress:\n\n```bash\nwatch -t -n1 aria2p show\n```\n\nCommands help:\n- [`show`](#show)\n- [`call`](#call)\n- [`add-magnet`](#add-magnet)\n- [`add-torrent`](#add-torrent)\n- [`add-metalink`](#add-metalink)\n- [`pause`](#pause)\n- [`pause-all`](#pause-all)\n- [`resume`](#resume)\n- [`resume-all`](#resume-all)\n- [`remove (rm)`](#remove)\n- [`remove-all`](#remove-all)\n- [`purge (clear)`](#purge)\n\n### `show`\n```\nusage: aria2p show [-h]\n\nShow the download progression.\n\noptional arguments:\n  -h, --help  Show this help message and exit.\n```\n\n### `call`\n```\nusage: aria2p call [-h] [-P PARAMS [PARAMS ...] | -J PARAMS] method\n\nCall a remote method through the JSON-RPC client.\n\npositional arguments:\n  method                The method to call (case insensitive). Dashes and\n                        underscores will be removed so you can use as many as\n                        you want, or none. Prefixes like \'aria2.\' or \'system.\'\n                        are also optional.\n\noptional arguments:\n  -h, --help            Show this help message and exit.\n  -P PARAMS [PARAMS ...], --params-list PARAMS [PARAMS ...]\n                        Parameters as a list of strings.\n  -J PARAMS, --json-params PARAMS\n                        Parameters as a JSON string. You should always wrap it\n                        at least once in an array \'[]\'.\n```\n\nAs explain in the help text,\nthe `method` can be the exact method name,\nor just the name without the prefix.\nIt is case-insensitive, and dashes and underscores will be removed.\n\nThe following are all equivalent:\n- `aria2.addUri`\n- `aria2.adduri`\n- `addUri`\n- `ADDURI`\n- `aria2.ADD-URI`\n- `add_uri`\n- `A-d_D-u_R-i` (yes it\'s valid)\n- `A---R---I---A---2.a__d__d__u__r__i` (I think you got it)\n- and even more ugly forms...\n\n#### Examples\nList all available methods.\n*This example uses [`jq`](https://github.com/stedolan/jq).*\n```console\n$ aria2p call listmethods | jq\n[\n  "aria2.addUri",\n  "aria2.addTorrent",\n  "aria2.getPeers",\n  "aria2.addMetalink",\n  "aria2.remove",\n  "aria2.pause",\n  "aria2.forcePause",\n  "aria2.pauseAll",\n  "aria2.forcePauseAll",\n  "aria2.unpause",\n  "aria2.unpauseAll",\n  "aria2.forceRemove",\n  "aria2.changePosition",\n  "aria2.tellStatus",\n  "aria2.getUris",\n  "aria2.getFiles",\n  "aria2.getServers",\n  "aria2.tellActive",\n  "aria2.tellWaiting",\n  "aria2.tellStopped",\n  "aria2.getOption",\n  "aria2.changeUri",\n  "aria2.changeOption",\n  "aria2.getGlobalOption",\n  "aria2.changeGlobalOption",\n  "aria2.purgeDownloadResult",\n  "aria2.removeDownloadResult",\n  "aria2.getVersion",\n  "aria2.getSessionInfo",\n  "aria2.shutdown",\n  "aria2.forceShutdown",\n  "aria2.getGlobalStat",\n  "aria2.saveSession",\n  "system.multicall",\n  "system.listMethods",\n  "system.listNotifications"\n]\n```\n\nList the GIDs (identifiers) of all active downloads.\n*Note that we must give the parameters as a JSON string.*\n```console\n$ aria2p call tellactive -J \'[["gid"]]\'\n[{"gid": "b686cad55029d4df"}, {"gid": "4b39a1ad8fd94e26"}, {"gid": "9d331cc4b287e5df"}, {"gid": "8c9de0df753a5195"}]\n```\n\nPause a download using its GID.\n*Note that when a single string argument is required, it can be passed directly with `-p`.*\n```console\n$ aria2p call pause -P b686cad55029d4df\n"b686cad55029d4df"\n```\n\nAdd a download using magnet URIs.\n*This example uses `jq -r` to remove the quotation marks around the result.*\n```console\n$ aria2p call adduri -J \'[["magnet:?xt=urn:..."]]\' | jq -r\n4b39a1ad8fd94e26f\n```\n\nPurge download results (remove completed downloads from the list).\n```console\n$ aria2p call purge_download_result\n"OK"\n```\n\n\n### `add-magnet`\n```\nusage: aria2p add-magnet [-h] uri\n\nAdd a download with a Magnet URI.\n\npositional arguments:\n  uri         The magnet URI to use.\n\noptional arguments:\n  -h, --help  Show this help message and exit.\n```\n\n### `add-torrent`\n```\nusage: aria2p add-torrent [-h] torrent_file\n\nAdd a download with a Torrent file.\n\npositional arguments:\n  torrent_file  The path to the torrent file.\n\noptional arguments:\n  -h, --help    Show this help message and exit.\n```\n\n### `add-metalink`\n```\nusage: aria2p add-metalink [-h] metalink_file\n\nAdd a download with a Metalink file.\n\npositional arguments:\n  metalink_file  The path to the metalink file.\n\noptional arguments:\n  -h, --help     Show this help message and exit.\n```\n\n### `pause`\n```\nusage: aria2p pause [-h] [-f] gids [gids ...]\n\nPause downloads.\n\npositional arguments:\n  gids         The GIDs of the downloads to pause.\n\noptional arguments:\n  -h, --help   Show this help message and exit.\n  -f, --force  Pause without contacting servers first.\n```\n\n### `pause-all`\n```\nusage: aria2p pause-all [-h] [-f]\n\nPause all downloads.\n\noptional arguments:\n  -h, --help   Show this help message and exit.\n  -f, --force  Pause without contacting servers first.\n```\n\n### `resume`\n```\nusage: aria2p resume [-h] gids [gids ...]\n\nResume downloads.\n\npositional arguments:\n  gids        The GIDs of the downloads to resume.\n\noptional arguments:\n  -h, --help  Show this help message and exit.\n```\n\n### `resume-all`\n```\nusage: aria2p resume-all [-h]\n\nResume all downloads.\n\noptional arguments:\n  -h, --help  Show this help message and exit.\n```\n\n### `remove`\n```\nusage: aria2p remove [-h] [-f] gids [gids ...]\n\nRemove downloads.\n\npositional arguments:\n  gids         The GIDs of the downloads to remove.\n\noptional arguments:\n  -h, --help   Show this help message and exit.\n  -f, --force  Remove without contacting servers first.\n```\n\n### `remove-all`\n```\nusage: aria2p remove-all [-h] [-f]\n\nRemove all downloads.\n\noptional arguments:\n  -h, --help   Show this help message and exit.\n  -f, --force  Remove without contacting servers first.\n```\n\n### `purge`\n```\nusage: aria2p purge [-h] [gids [gids ...]]\n\nPurge the completed/removed/failed downloads.\n\npositional arguments:\n  gids        The GIDs of the downloads to purge.\n\noptional arguments:\n  -h, --help  Show this help message and exit.\n```\n',
    'author': 'Timothée Mazzucotelli',
    'author_email': 'pawamoy@pm.me',
    'url': 'https://github.com/pawamoy/aria2p',
    'package_dir': package_dir,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.6,<4.0',
}


setup(**setup_kwargs)
