{ "info": { "author": "Pierre Penninckx", "author_email": "ibizapeanut@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "\n# Table of Contents\n\n1. [Json Dispatch](#org1ebd606)\n 1. [Use Cases](#orgd2b20aa)\n 1. [Send file to aria2 and set download dir based on category](#orgb7f7725)\n 2. [Install & Use](#org902adaf)\n 1. [Server](#org5b297f7)\n 2. [Browser extension](#orgdb0ace7)\n 3. [Develop](#orgc64c5ed)\n 1. [Files Layout](#orgdc9d277)\n 4. [License](#org80ce1fa)\n\n\n\n\n# Json Dispatch\n\nServer program written in python that accepts HTTP POST requests with a JSON\npayload and forwards the request to another program, after transforming it in a\nconfigurable way. Quite generic, but that's the goal. See [1.1](#orgd2b20aa) for concrete\nexamples.\n\n`Python 3.6` supported only, although other `Python 3.X` versions should work\ntoo.\n\nAlso provides a Firefox and Chrome extension that talks to the server and allows\nyou to right click on a URL/link in your browser and \"send it to\" the server.\n\n\n\n\n## Use Cases\n\n\n\n\n### Send file to aria2 and set download dir based on category\n\nConfig file `/etc/jsondispatch/jsondispatch.conf`:\n\n cors:\n domain: '*'\n \n commands:\n aria2:\n url: http://localhost:6800/jsonrpc\n rpc_secret: mYs3Cr3t\n \n triggers:\n download_program_uri:\n - command: aria2\n method: addUri\n arguments:\n url: {url}\n dir: /srv/backups/programs\n\nJSON payload to send to the server with URL ending with\n`/trigger/download_program_uri` with POST request:\n\n {\n \"url\": \"magnet:?xt=urn:btih:204a1789dd04e4d8f5a4e098e8f777794888f4ad&dn=archlinux-2017.12.01-x86_64.iso&tr=udp://tracker.archlinux.org:6969&tr=http://tracker.archlinux.org:6969/announce\"\n }\n\nWhen sending the above POST request, jsondispatch will call the `addUri` RPC\nmethod of aria2 with the given magnet URL and the hardcoded `dir` argument.\n\nOr just use the browser extension which does this for you with a right click on\na magnet URL (or any link for that matter).\n\n\n\n\n## Install & Use\n\n\n\n\n### Server\n\nTo install the server, clone this repo, `cd` in the repo and run:\n\n pip install -e \".\"\n\nCreate a configuration file in `/etc/jsondispatch/jsondispatch.conf` (by\ndefault, `--config` option lets you setup a custom file location). See [1.1](#orgd2b20aa)\nfor example configurations.\n\nTo run the server, `cd` in the repo and run:\n\n python . \n\nYou can change the default port and config file location, give the `--help`\nargument for detailed instructions.\n\n\n\n\n### Browser extension\n\nFor Firefox, go to `about:debugging` and click on `Load Temporary Add-On`.\nBrowse to the `browserextension/` folder in this repo and select the\n`manifest.json` file. Now that the addon is added, go to the addons settings\npage `about:addons` and fill-in the server URL.\n\nIf you're running the server locally with default port, then the URL is\n`http://127.0.0.1:8850`.\n\nFor Chrome, go to `chrome://extensions/`, enable `Developer mode`, click on\n`Load unpacked extension`. Browse to the `firefox/` folder in this repo and\nclick on `open`. Now that the addon is added, click on the addon's `option`\nbutton and fill-in the server URL.\n\nNow you can just right click on a link and go in the submenu `Send to Json\nDispatch`, then choose one of the options which correspond to the configured\ntriggers. Of course, first make sure you installed and started the server as\nexplained in [1.2.1](#org5b297f7).\n\n\n\n\n## Develop\n\n pip install -e \".[dev,test]\"\n\n\n\n\n### Files Layout\n\n\n\n\n## License\n\nThe icon was taken from , it's under MIT License.\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/ibizaman/jsondispatch/archive/0.1.4.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ibizaman/jsondispatch", "keywords": "json", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "jsondispatch", "package_url": "https://pypi.org/project/jsondispatch/", "platform": "", "project_url": "https://pypi.org/project/jsondispatch/", "project_urls": { "Download": "https://github.com/ibizaman/jsondispatch/archive/0.1.4.tar.gz", "Homepage": "https://github.com/ibizaman/jsondispatch" }, "release_url": "https://pypi.org/project/jsondispatch/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "Dispatch commands with JSON HTTP requests", "version": "0.1.4" }, "last_serial": 3890002, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "de4bb98a6d31c3d5d67c0a39c842043c", "sha256": "da0b2814a6b96fd597ab006436766bef968500a49c36723b8d24605379a3e187" }, "downloads": -1, "filename": "jsondispatch-0.1.0.tar.gz", "has_sig": false, "md5_digest": "de4bb98a6d31c3d5d67c0a39c842043c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3791, "upload_time": "2018-05-22T04:47:21", "url": "https://files.pythonhosted.org/packages/ee/7d/8676c10b1c04e65866c5bc51e46f19bff80bf36fd83898404172584cf53b/jsondispatch-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f97dfe97182f209549faacfc1b94fe2d", "sha256": "e440faabf75322a2589b42b963fb7b73c54ab0ee8be7be1a5fb20810de39de44" }, "downloads": -1, "filename": "jsondispatch-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f97dfe97182f209549faacfc1b94fe2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3459, "upload_time": "2018-05-22T05:26:43", "url": "https://files.pythonhosted.org/packages/51/9c/341c902c53a2f0aae8716fa3cf092a0098d80b30765f7e35bfa015257b84/jsondispatch-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "dff60dd8103fab4a4e0d99b54bde6a86", "sha256": "2a55b85704164c1a8377ba42afd97bbe200d794a27de69f10145fb4aa5cbea72" }, "downloads": -1, "filename": "jsondispatch-0.1.2.tar.gz", "has_sig": false, "md5_digest": "dff60dd8103fab4a4e0d99b54bde6a86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5509, "upload_time": "2018-05-22T07:30:29", "url": "https://files.pythonhosted.org/packages/f3/bb/a6771d86cc4d0b32c36db1eca437bd75e84954af31a2508605c294484b06/jsondispatch-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "3131d17fe2bc015248bd5aa6708f1718", "sha256": "75e85213679ce92c901447bf4235f6b27f54f739af366c4389fc3b54eeec2b45" }, "downloads": -1, "filename": "jsondispatch-0.1.3.tar.gz", "has_sig": false, "md5_digest": "3131d17fe2bc015248bd5aa6708f1718", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5522, "upload_time": "2018-05-22T21:16:16", "url": "https://files.pythonhosted.org/packages/e3/36/18ff317b436887b8fdb2f7109223e5d111514bd306f9c45152cd465779a3/jsondispatch-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "5aea7bce25400ff836e60a64e5313172", "sha256": "87ea35cb84d45969504a89ea5a3ba2382c18caaab632ae8e2917284b1f2b8c0f" }, "downloads": -1, "filename": "jsondispatch-0.1.4.tar.gz", "has_sig": false, "md5_digest": "5aea7bce25400ff836e60a64e5313172", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5499, "upload_time": "2018-05-23T04:00:06", "url": "https://files.pythonhosted.org/packages/61/6b/0c8d141479e89107f14a88d2404b874eeb640b94de6c94d88b913812b3e0/jsondispatch-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5aea7bce25400ff836e60a64e5313172", "sha256": "87ea35cb84d45969504a89ea5a3ba2382c18caaab632ae8e2917284b1f2b8c0f" }, "downloads": -1, "filename": "jsondispatch-0.1.4.tar.gz", "has_sig": false, "md5_digest": "5aea7bce25400ff836e60a64e5313172", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5499, "upload_time": "2018-05-23T04:00:06", "url": "https://files.pythonhosted.org/packages/61/6b/0c8d141479e89107f14a88d2404b874eeb640b94de6c94d88b913812b3e0/jsondispatch-0.1.4.tar.gz" } ] }