{ "info": { "author": "frozflame", "author_email": "frozflame@outlook.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "volkanic\n========\n\nA simple command runner. To install (add `sudo` if necessary)\n\n python3 -m pip install volkanic\n\n\n-------------------------------------------------------------------------\n### Accessories\n\nList sub-commands\n\n $ volk\n availabe commands:\n - a\n - o\n - runconf\n - where\n\nLocate a Python package directory with `volk where`:\n\n $ volk where requests\n requests\t/usr/local/lib/python3.6/site-packages/requests\n\n\nYou can open a file or URL with default application with `volk o`.\n\nTo open current directory with default file manager (Finder / explorer.exe / ...)\n\n $ volk o .\n\nShow `sys.argv`:\n\n $ volk a \\; \"hello world\" hello python\n 0\t'/usr/local/bin/volk'\n 1\t'a'\n 2\t';'\n 3\t'hello world'\n 4\t'hello'\n 5\t'python'\n\n-------------------------------------------------------------------------\n### Sub-command protocal\n\nSay you have a package named `newpkg`\n\n\n newpkg\n \u251c\u2500\u2500 MANIFEST.in\n \u251c\u2500\u2500 docs\n \u251c\u2500\u2500 newpkg\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 __init__.py\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 algors.py\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 formatters.py\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 main.py\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 parsers.py\n \u251c\u2500\u2500 requirements.txt\n \u251c\u2500\u2500 setup.py\n \u2514\u2500\u2500 test_newpkg\n\n\nIn one of your functional modules, e.g. `newpkg/newpkg/formatter.py`,\nprovide a entry function which takes exactly 2 arguments:\n\n\n```python\nimport argparse\n\ndef format_text(path):\n # actual code here\n return\n\n\ndef run(prog=None, args=None):\n desc = 'human readable formatter'\n parser = argparse.ArgumentParser(prog=prog, description=desc)\n parser.add_argument('-i', '--input-file', help='path to your input file')\n ns = parser.parse_args(args)\n format_text(ns.input_file)\n```\n\n\nSub-command registry in `newpkg/newpkg/main.py`:\n\n\n```python\nimport volkanic\n\nentries = {\n # shorthand for \"newpkg.formatter:run\": \"fmt\",\n \"newpkg.formatter\": \"fmt\",\n \"newpkg.parsers:run_yml_parser\": \"yml\",\n \"newpkg.parsers:run_ini_parser\": \"ini\",\n}\nregistry = volkanic.CommandRegistry(entries)\n```\n\nNote that `newpkg.formatter` is a shorthand for `newpkg.formatter:run`.\n\n\nConfigure top-command in `newpkg/setup.py`:\n\n```python\nfrom setuptools import setup\n\nsetup(\n name=\"newpkg\",\n entry_points={\"console_scripts\": [\"newcmd = newpkg.main:registry\"]},\n # more arguments\n)\n```\n\n\nInstall package `newpkg` or link with `python3 setup.py develop`.\n\nNow you have command `newcmd`:\n\n $ newcmd\n availabe commands:\n - fmt\n - ini\n - yml\n\nRun with sub-command `fmt`:\n\n $ newcmd fmt -h\n\n-------------------------------------------------------------------------\n### Run YAML\n\nCreate a YAML file, e.g. `print.yml`\n\n```yaml\ndefault:\n module: builtins\n call: print\n args:\n - volkanic\n - command\n kwargs:\n sep: \"-\"\n end: \"~\"\n ```\n\nRun\n\n```bash\n$ volk runconf print.yml\nvolkanic-command~\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/frozflame/volkanic", "keywords": "", "license": "GNU General Public License (GPL)", "maintainer": "", "maintainer_email": "", "name": "volkanic", "package_url": "https://pypi.org/project/volkanic/", "platform": "", "project_url": "https://pypi.org/project/volkanic/", "project_urls": { "Homepage": "https://github.com/frozflame/volkanic" }, "release_url": "https://pypi.org/project/volkanic/0.0.7/", "requires_dist": null, "requires_python": "", "summary": "a simple command runner", "version": "0.0.7" }, "last_serial": 5405395, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "e6c693913b28cf46a1818ae0aab28836", "sha256": "bb6aafaa7c329986fafbc6bb81d147ca0aa9018d02c6d3b1fee6c95366312a2b" }, "downloads": -1, "filename": "volkanic-0.0.2.tar.gz", "has_sig": false, "md5_digest": "e6c693913b28cf46a1818ae0aab28836", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3154, "upload_time": "2018-11-02T09:25:37", "url": "https://files.pythonhosted.org/packages/91/35/71ca923c459b3053cac3da132031e2cf6f34320d3328c2fb96eabd58d917/volkanic-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "7dffa91c2fd8b73d8fad5186a154e508", "sha256": "7ae9d67375741da4f7dbaab14a0803c741571207b26e24a6fe0374047a8b2b29" }, "downloads": -1, "filename": "volkanic-0.0.3.tar.gz", "has_sig": false, "md5_digest": "7dffa91c2fd8b73d8fad5186a154e508", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3150, "upload_time": "2018-11-02T11:51:09", "url": "https://files.pythonhosted.org/packages/ff/e5/c972623b8c8ba7ee20b38e10b7a6d98e3d7810388bae1cac04284c458487/volkanic-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "1f7aaab0c64042a0d59fad5558e2dfe5", "sha256": "779f0951e08e47b052981b65074b64933dca87876ae2158d88b1649a59caa2a9" }, "downloads": -1, "filename": "volkanic-0.0.4.tar.gz", "has_sig": false, "md5_digest": "1f7aaab0c64042a0d59fad5558e2dfe5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3470, "upload_time": "2019-01-21T14:06:53", "url": "https://files.pythonhosted.org/packages/90/f6/7c73bc03206dc309cd7d179aef398ec412dcc5cff6ff36e4b55e697f8988/volkanic-0.0.4.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "f601f9aa0652674b02c3d8fdd5565771", "sha256": "1c833eccfc60c57849c990bda96e553b97a60834684124d2d17c97fad0058e3b" }, "downloads": -1, "filename": "volkanic-0.0.6.tar.gz", "has_sig": false, "md5_digest": "f601f9aa0652674b02c3d8fdd5565771", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5083, "upload_time": "2019-06-15T11:23:29", "url": "https://files.pythonhosted.org/packages/f0/cb/03857528ba9a3293f70576a235e39084f1abaca2e7c65d3e9e08be24c206/volkanic-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "90f50cc826ce4df84ff9f98f2411c178", "sha256": "55acc45238d38be39222aafb00631baa3fc60e2b7d141ad69a26ef49f8c7658f" }, "downloads": -1, "filename": "volkanic-0.0.7.tar.gz", "has_sig": false, "md5_digest": "90f50cc826ce4df84ff9f98f2411c178", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5135, "upload_time": "2019-06-16T02:32:20", "url": "https://files.pythonhosted.org/packages/54/54/9dafb8f09d816b04315d48c37fc9dc77b9b22e134b88a7c65472438b2bf1/volkanic-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "90f50cc826ce4df84ff9f98f2411c178", "sha256": "55acc45238d38be39222aafb00631baa3fc60e2b7d141ad69a26ef49f8c7658f" }, "downloads": -1, "filename": "volkanic-0.0.7.tar.gz", "has_sig": false, "md5_digest": "90f50cc826ce4df84ff9f98f2411c178", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5135, "upload_time": "2019-06-16T02:32:20", "url": "https://files.pythonhosted.org/packages/54/54/9dafb8f09d816b04315d48c37fc9dc77b9b22e134b88a7c65472438b2bf1/volkanic-0.0.7.tar.gz" } ] }