{ "info": { "author": "Joris Gutjahr", "author_email": "joris.gutjahr@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "**This is documentation refering to [this Repository](https://github.com/CSDUMMI/cli_framework)**\n# cli_framework\nA Framework to make it easier for myself to develop small cli apps\n\n# Install\nThis project can be installed using\npip:\n```bash\npip3 install CLI-csdummi\n```\n\n# An example implementation\nTo implement your own CLI app\nwith this library you have to import the\nclass CLI like this:\n```python\nfrom CLI.CLI import CLI\n```\n\nThen you define a class that inherits\nfrom `CLI` and define `__init__` like this:\n\n```python\nclass App(CLI):\n def __init__(self):\n super().__init__('app.json','add','remove','list')\n```\nThe `__init__` Function from `CLI` takes one positional\nargument `file` or in this case `'app.json'`.\nThis is the file where the variable `self.state`\nis loaded from and saved to before and after execution.\nYou can thus modify `self.state` like any `dict` and\nthen it will be saved afterwards.\nThe other arguments are the names of methods\nyou want to be accessed from the command-line.\nThese names must be members of the class `App` in this case.\nThis means you now have to implement these functions:\n```python\n def add(self,args):\n name = args[0]\n balance = args[1]\n self.state[name] = balance\n\n def remove(self,args):\n name = args[0]\n del self.state[name]\n\n def list(self,*args):\n for i in self.state.keys():\n print(\"Name: {}\\nBalance: {}\".format(i,self.state[i]))\n```\nAs you can see the names of the methods and the arguments in\n`__init__`.\n\nYou can now use your CLI App like this:\n```bash\n$ python3 App.py add \n$ python3 App.py remove \n$ python3 App.py list\n$ python3 App.py help\n$ python3 App.py\n```\nYou can execute these commands right now,\nall code here was written in the file `App.py` in this Repository.\n\n### `help` == `''`\nIf there is no command, the `help` function, that was inherited from `CLI`\nis executed, it prints the docstring of `self`: `self.__doc__`.\nIf you want usage information for your CLI App to appear,\nyou just write the usage or help into the docstring like this:\n```python\nclass App(CLI):\n \"\"\"\n Usage:\n add \\t:Add new user\n remove \\t:Remove user\n list:\\tList all current users\n help:\\tDisplay this help\n \"\"\"\n ...\n```\nThen you can use execute the CLI with this:\n```python\nif __name__ == '__main__':\n app = App() # Create Instance of CLI App\n app.run() # Execute Commandline Parsing\n```\nI hope this helped you and you can implement your own CL Apps or interfaces\nsoon.\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/csdummi/cli_framework", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "CLI-csdummi", "package_url": "https://pypi.org/project/CLI-csdummi/", "platform": "", "project_url": "https://pypi.org/project/CLI-csdummi/", "project_urls": { "Homepage": "https://github.com/csdummi/cli_framework" }, "release_url": "https://pypi.org/project/CLI-csdummi/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "A framework to write CLI projects.", "version": "1.0.1" }, "last_serial": 5353268, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "51a2e32e68eda2a0d7898decd02370e7", "sha256": "ec2518a4b9e73211854ba2d3d75f96dbe0aba872704d2b1ed74b84b65aebcdfc" }, "downloads": -1, "filename": "CLI_csdummi-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "51a2e32e68eda2a0d7898decd02370e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15661, "upload_time": "2019-06-03T15:15:12", "url": "https://files.pythonhosted.org/packages/93/1e/e2a2146944681422491a33ebb4210c778e6a297dbb3f3936904c7880cd1a/CLI_csdummi-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "57ed4926a63363789fbe135f72bf99e6", "sha256": "96509b6dae95be252d4d769f5beec24477bddb6064cd20ab956288d6e5d54c5a" }, "downloads": -1, "filename": "CLI-csdummi-0.0.1.tar.gz", "has_sig": false, "md5_digest": "57ed4926a63363789fbe135f72bf99e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2848, "upload_time": "2019-06-03T15:15:14", "url": "https://files.pythonhosted.org/packages/16/bf/05be967f8e492dd68648bf004238ff78bd15889d30392b8bd86c8da7c569/CLI-csdummi-0.0.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "fb59551cbc82683c276174dd1dd333b4", "sha256": "06beda4ac013ba7e7505eeecb949a9c6fd771bb3ef66fa8fb59fba5b09a9d37d" }, "downloads": -1, "filename": "CLI_csdummi-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "fb59551cbc82683c276174dd1dd333b4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15676, "upload_time": "2019-06-03T15:30:07", "url": "https://files.pythonhosted.org/packages/61/dd/2ee10daef4e6539bbad13f585c6701124d7422ac825d2cf0b3289bb0d626/CLI_csdummi-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "37f34753c3d0412e4cccfe56cc43b3bf", "sha256": "d73b529337c60440c25c63af2f034be649fa4aeb1837f5edc8b9c6ac31b31529" }, "downloads": -1, "filename": "CLI-csdummi-1.0.0.tar.gz", "has_sig": false, "md5_digest": "37f34753c3d0412e4cccfe56cc43b3bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2866, "upload_time": "2019-06-03T15:30:09", "url": "https://files.pythonhosted.org/packages/6e/9f/cf9a9f6d9de8f7a3ff17cd53685ddb71e7f8b057349e14d755605b59cf5e/CLI-csdummi-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "808268294c26bb6159af61f97c0b4863", "sha256": "9fbf9976cc8e0bf0aeac9718e33c19c09c33d701d88db8569c713ee6656d824c" }, "downloads": -1, "filename": "CLI_csdummi-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "808268294c26bb6159af61f97c0b4863", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15708, "upload_time": "2019-06-03T15:39:35", "url": "https://files.pythonhosted.org/packages/e3/8a/db3ec3e96378bbbbf80a492105ac5c826c721fda05d6b1ee980e956654ef/CLI_csdummi-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c3ce6853bfad3fd2dfcbef51d094cfcc", "sha256": "d16496dc3c96d0a3477d548fb41c0da661cfa551794cbd5bdbaf28852dff9302" }, "downloads": -1, "filename": "CLI-csdummi-1.0.1.tar.gz", "has_sig": false, "md5_digest": "c3ce6853bfad3fd2dfcbef51d094cfcc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2930, "upload_time": "2019-06-03T15:39:37", "url": "https://files.pythonhosted.org/packages/b4/9f/d931e0aec3c3c27c81803b86b07b397aea9d2e01b657d476794dc6be993d/CLI-csdummi-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "808268294c26bb6159af61f97c0b4863", "sha256": "9fbf9976cc8e0bf0aeac9718e33c19c09c33d701d88db8569c713ee6656d824c" }, "downloads": -1, "filename": "CLI_csdummi-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "808268294c26bb6159af61f97c0b4863", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15708, "upload_time": "2019-06-03T15:39:35", "url": "https://files.pythonhosted.org/packages/e3/8a/db3ec3e96378bbbbf80a492105ac5c826c721fda05d6b1ee980e956654ef/CLI_csdummi-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c3ce6853bfad3fd2dfcbef51d094cfcc", "sha256": "d16496dc3c96d0a3477d548fb41c0da661cfa551794cbd5bdbaf28852dff9302" }, "downloads": -1, "filename": "CLI-csdummi-1.0.1.tar.gz", "has_sig": false, "md5_digest": "c3ce6853bfad3fd2dfcbef51d094cfcc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2930, "upload_time": "2019-06-03T15:39:37", "url": "https://files.pythonhosted.org/packages/b4/9f/d931e0aec3c3c27c81803b86b07b397aea9d2e01b657d476794dc6be993d/CLI-csdummi-1.0.1.tar.gz" } ] }