{ "info": { "author": "Iuliaa Volkova", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "### clifier\n\nClifier is a simple, tiny script to generate Argparse commands and subparsers\nfrom yaml config file.\n\nAll arguments and parameters names same like in Argparser module, \nso you do not need to know new lexic.\n\nWhan you use clifier you don't need to create separate documentation for your users - \nyou can just use config.yaml file as doc. \n\n\n#### Install\n\nTo install clifier - use pip:\n\n pip install clifier \n\n#### Examples\n\nIn folder clifier/examples you can find the example cli with config file. \nJust copy it to you local env and test.\n\n\nSimple example of yaml config:\n\n parser:\n prog: 'Clifier Example'\n description: Example for Clifier\n\n commands:\n - keys: ['-v', '--version']\n help: \"show Clifier Example version\"\n action: show_version()\n default: True\n\n subparsers:\n play:\n - keys: ['game']\n help: Write a name of the gave, what you want to play\n\n - keys: ['-c', '--count']\n help: Put number how much times you want to play\n default: 2\n\n sleep:\n - keys: ['-t', '--time']\n help: Put how much second you want to sleep\n\n### Sections in config file\n#### \"parser\" section \n\nUsed to define args equal to args of argparse.ArgumentParser() \n__init__ method, for example:\n\n - prog\n - description\n - usage\n - epilog and etc \n\n to know more, look at official Argparse documentation:\n https://docs.python.org/3.6/library/argparse.html#argparse.ArgumentParser\n\n#### \"commands\" section\n\n commands properties equal to add_argument method\n https://docs.python.org/3.6/library/argparse.html#argparse.ArgumentParser.add_argument \n\n\n\n#### \"subparsers\" section\n\n name of subparser section element - it's a name, what equals to \n add_parser() argument \"name\" of object what returned by \n add_subparser_method\n\n https://docs.python.org/3.6/library/argparse.html#argparse.ArgumentParser.add_subparsers\n\n it's a Subparser name and it's not showed as argument in parser\n\n#### To use Clifier in your code\n\nPrepare variable with path to your config file with cli:\n\n config_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), \"cli.yaml\")\n\n\nInitialise clifier\n\n cli = clifier.Clifier(config_path, prog_version=\"0.0.1\")\n\nAnd get parser like standart Argparse parser\n\n parser = cli.create_parser()\n args = parser.parse_args()\n\n\nThat's it!\n\n#### Adding custom actions\n\nYou can add to Clifier Custom Argparser Actions with method add_actions():\n\n cli = clifier.Clifier(config_path)\n cli.add_actions((your_custom_action_1, your_custom_action_2)\n\nTo use those actions in Cli, define them in command line config file with \"action\" property, for example:\n\n\n#### Custom actions defined from box in Clifier\n\n##### show_version\n\nmethod to create command -v, --version to show program version \nfor usage: \n\n 1. provide arg prog_version to Clifier() or define \"version\" param in config\n\n example in config.yaml:\n\n parser:\n prog: 'your prog name'\n version: \"0.0.1\"\n\n or \n\n cli = clifier.Clifier(config_path, prog_version=\"0.0.1\")\n\n 2. define -v, --version command in cli config:\n\n commands:\n - keys: ['-v', '--version']\n help: \"show Clifier Example version\"\n action: show_version()\n default: True\n\n\n##### check_path_action\n\nThis action check exist or not file_path that was provided by user to command line.\n\n\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/xnuinside/clifier", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "clifier", "package_url": "https://pypi.org/project/clifier/", "platform": "", "project_url": "https://pypi.org/project/clifier/", "project_urls": { "Homepage": "https://github.com/xnuinside/clifier" }, "release_url": "https://pypi.org/project/clifier/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.0.1" }, "last_serial": 4476849, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0141c9cbd687863281e8a4861e9dca26", "sha256": "551fc2182b6a2e823cccf50a28e98a0ea98cf3c338fa8a83f3b27cda1df015e6" }, "downloads": -1, "filename": "clifier-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0141c9cbd687863281e8a4861e9dca26", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6314, "upload_time": "2018-11-12T10:03:18", "url": "https://files.pythonhosted.org/packages/ec/35/81c48fc2e5c79b4e14e58de113e9580c7a24c2bb06467a61c4db33584205/clifier-0.0.1-py2.py3-none-any.whl" } ], "0.0.1.dev41": [ { "comment_text": "", "digests": { "md5": "0e30f5d99b48eb88151091a1c58c305c", "sha256": "0a27a90824005aed039fbdc2563a0028e72727b2dffdc7f307fc1c87415911e0" }, "downloads": -1, "filename": "clifier-0.0.1.dev41-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0e30f5d99b48eb88151091a1c58c305c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2830, "upload_time": "2018-08-24T14:36:41", "url": "https://files.pythonhosted.org/packages/a5/e6/c349212f55b9e3ef6f146473267dc487fdb7e4d6d45b638776296ec725b3/clifier-0.0.1.dev41-py2.py3-none-any.whl" } ], "0.0.1.dev88": [ { "comment_text": "", "digests": { "md5": "da601e57c63a45447c5698d27d9f40ce", "sha256": "b05faccc5872bde08fbc6cffcfa8546d34f9ea8498aa4b0153c03fdb68d168f4" }, "downloads": -1, "filename": "clifier-0.0.1.dev88-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "da601e57c63a45447c5698d27d9f40ce", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6139, "upload_time": "2018-09-03T09:12:29", "url": "https://files.pythonhosted.org/packages/f6/38/f708f4fa8db72ceef9a2ec77c90bb21d590960554bb2a1e9e99227c889b5/clifier-0.0.1.dev88-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0141c9cbd687863281e8a4861e9dca26", "sha256": "551fc2182b6a2e823cccf50a28e98a0ea98cf3c338fa8a83f3b27cda1df015e6" }, "downloads": -1, "filename": "clifier-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0141c9cbd687863281e8a4861e9dca26", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6314, "upload_time": "2018-11-12T10:03:18", "url": "https://files.pythonhosted.org/packages/ec/35/81c48fc2e5c79b4e14e58de113e9580c7a24c2bb06467a61c4db33584205/clifier-0.0.1-py2.py3-none-any.whl" } ] }