{ "info": { "author": "S. Lion", "author_email": "sonny.lion@laposte.net", "bugtrack_url": null, "classifiers": [], "description": "Declic\n======\n\nDeclic (DEcorator-oriented CLI Creator) is a tiny Python 3 package for\ncreating command line interfaces using decorators. It was inspired by\nthe `click`_ package and is based on `argparse`_.\n\nInstallation\n------------\n\n>From PyPI:\n\n::\n\n pip install declic\n\nor from Github:\n\n::\n\n pip install git+https://github.com/Septaris/declic.git\n\nUsage\n-----\n\nHere is an example of Declic usage:\n\n.. code:: python\n\n from declic import group, argument, command\n\n # on_before callbacks are executed if:\n # - the group itself is called\n # - if any of the child of the group is called\n def before_bar():\n print('before bar')\n\n def before_sub(tata):\n print('before sub: %s' % tata)\n\n # define the root command (a group)\n @group(description='my description', on_before=before_bar)\n @argument('--version', action='version', version='')\n @argument('--foo', type=int, default=1)\n def bar():\n print('bar')\n\n # define a sub-group\n @bar.group(invokable=True, on_before=before_sub)\n @argument('--toto', type=int, default=2)\n @argument('--tata', type=str, default='aaa')\n def sub(toto, tata):\n print('toto: %s' % toto)\n print('tata: %s' % tata)\n\n # define a sub-command of the sub-group\n # chain option allows to execute each parent group (if they are invokable) before the command call\n # each on_before functions will be executed anyway\n @sub.command(chain=True)\n def mop(toto, **kwargs):\n print('kwargs: %s' % kwargs)\n print('toto: %s' % toto)\n\n # define a sub-command of the root group\n @bar.command()\n @argument('-x', type=int, default=1)\n @argument('y', type=float)\n def foo(x, y):\n print(x, y)\n\n\n if __name__ == '__main__':\n import sys\n\n bar(sys.argv[1:])\n # or bar()\n\nRunning the cli:\n\n::\n\n $ python my_file.py --help\n\n usage: bar [-h] [--foo FOO] [--version] {sub_group,foo} ...\n\n my description\n\n positional arguments:\n {sub,foo}\n\n optional arguments:\n -h, --help show this help message and exit\n --foo FOO\n --version show program's version number and exit\n\n.. _click: http://click.pocoo.org/6/\n.. _argparse: https://docs.python.org/3/library/argparse.html\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Septaris/declic", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "declic", "package_url": "https://pypi.org/project/declic/", "platform": "", "project_url": "https://pypi.org/project/declic/", "project_urls": { "Homepage": "https://github.com/Septaris/declic" }, "release_url": "https://pypi.org/project/declic/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "Declic (DEcorator-oriented CLI Creator) is a tiny Python 3 package for creating command line interfaces", "version": "1.0.2" }, "last_serial": 3985822, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "b6bd3e15449cf2459bb08fba0a8bc992", "sha256": "4400a3d0f7cbef6b5be58c34ef74554d0ce9f96fc48bf48c39a33bad21f43118" }, "downloads": -1, "filename": "declic-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b6bd3e15449cf2459bb08fba0a8bc992", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4085, "upload_time": "2018-05-04T08:20:07", "url": "https://files.pythonhosted.org/packages/69/2b/2c79f647e0f532cce005f54bea25b436264e39e45f27dcdac7f26ce953d5/declic-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e716e731a2c8d6872959efcf608b1cdd", "sha256": "effc329f7920261634404a6f9414e44faf41755e871a619322eef27cc94c411b" }, "downloads": -1, "filename": "declic-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e716e731a2c8d6872959efcf608b1cdd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4063, "upload_time": "2018-05-04T08:20:08", "url": "https://files.pythonhosted.org/packages/52/93/9c8d542d47ccb58f2e6cc9379e940353c6ca09940d14847c8638fc47c1a8/declic-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "fc120f02d335f0ba2241214208136f04", "sha256": "98030c209f43fb97b72c83b07e8e97966fda80ba660d92967318be15244fcdac" }, "downloads": -1, "filename": "declic-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "fc120f02d335f0ba2241214208136f04", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6343, "upload_time": "2018-06-21T14:07:39", "url": "https://files.pythonhosted.org/packages/fb/25/8c8f7fdeed0f64986c4903535cb62b9dab9319349641fb9a0d7f70161987/declic-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "512255c7a01be9318f0b6424978773ec", "sha256": "a43c07911df2f4ca74a0cb8931fa7984462de92ddcbc90126644255cfaa72613" }, "downloads": -1, "filename": "declic-1.0.2.tar.gz", "has_sig": false, "md5_digest": "512255c7a01be9318f0b6424978773ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4703, "upload_time": "2018-06-21T14:07:40", "url": "https://files.pythonhosted.org/packages/da/c6/b60e5b00681713746c672688ba621e2e753e1701dcad3e6cad376809e0b3/declic-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fc120f02d335f0ba2241214208136f04", "sha256": "98030c209f43fb97b72c83b07e8e97966fda80ba660d92967318be15244fcdac" }, "downloads": -1, "filename": "declic-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "fc120f02d335f0ba2241214208136f04", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6343, "upload_time": "2018-06-21T14:07:39", "url": "https://files.pythonhosted.org/packages/fb/25/8c8f7fdeed0f64986c4903535cb62b9dab9319349641fb9a0d7f70161987/declic-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "512255c7a01be9318f0b6424978773ec", "sha256": "a43c07911df2f4ca74a0cb8931fa7984462de92ddcbc90126644255cfaa72613" }, "downloads": -1, "filename": "declic-1.0.2.tar.gz", "has_sig": false, "md5_digest": "512255c7a01be9318f0b6424978773ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4703, "upload_time": "2018-06-21T14:07:40", "url": "https://files.pythonhosted.org/packages/da/c6/b60e5b00681713746c672688ba621e2e753e1701dcad3e6cad376809e0b3/declic-1.0.2.tar.gz" } ] }