{ "info": { "author": "Aleksandar Buza", "author_email": "aleksandar.buza@consulteer.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: ISC License (ISCL)", "Operating System :: POSIX", "Operating System :: POSIX :: BSD", "Operating System :: POSIX :: Linux", "Operating System :: Unix", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries" ], "description": "# getopt-ng\n###### Pythonic Unix C-style parser for command line options in few LOC\n\nSimplified Unix-like **getopt** command line parser\n\n## Usage example\n\n```python\n# Simple example\n\nimport sys\n\nfrom typing import List\nfrom typing import Tuple\n\nfrom getopt2 import getopt2\n\n\nUSAGE = \"\"\"\nsimple-getopt2 [-options]\n\noptions:\n -h Help menu\n -v Verbose mode\n -i Input file path (required)\n -o Output file path (required)\n\"\"\"\n\n\ndef usage():\n sys.exit(USAGE)\n\n\n@getopt2(sys.argv[1:], \"hvo:i:\")\ndef main(opts: List[Tuple]):\n\n if len(opts) == 0:\n usage()\n\n in_file = None\n out_file = None\n verbose = False\n verbose_level = 0\n\n for opt, arg in opts:\n if opt == '-h':\n usage()\n\n elif opt == '-v':\n verbose_level += 1\n verbose = True\n\n elif opt == '-i':\n in_file = arg\n\n elif opt == '-o':\n out_file = arg\n \n else:\n usage()\n\n\n if None in (in_file, out_file):\n usage()\n\n print('Everything is good - call your code here . happy coding')\n\n\nif __name__ == \"__main__\":\n main()\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/alekbuza/getopt-ng", "keywords": "", "license": "License :: OSI Approved :: ISC License (ISCL)", "maintainer": "", "maintainer_email": "", "name": "getopt2", "package_url": "https://pypi.org/project/getopt2/", "platform": "", "project_url": "https://pypi.org/project/getopt2/", "project_urls": { "Homepage": "https://github.com/alekbuza/getopt-ng" }, "release_url": "https://pypi.org/project/getopt2/0.0.3/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Pythonic Unix C-style parser for command line options in few LOC", "version": "0.0.3" }, "last_serial": 5223480, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "3f524802d8ffcd21c50042397e298a58", "sha256": "47af4adb0235255f67b025c8a876fe6089ea87c66fc38ff501f0a427b3a751b9" }, "downloads": -1, "filename": "getopt2-0.0.2.tar.gz", "has_sig": false, "md5_digest": "3f524802d8ffcd21c50042397e298a58", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3504, "upload_time": "2019-05-02T22:39:23", "url": "https://files.pythonhosted.org/packages/34/8d/d5eb2fecf23c9a800590a35d1518ce7c9ac4a5737dd5d7da4c5dd4610d59/getopt2-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "1eabad093bf688699a083bed8bfb7825", "sha256": "ea3ea9d22ee65d285f79a1e907681c189ecb7797611fbd505cc00373bd809ca7" }, "downloads": -1, "filename": "getopt2-0.0.3.tar.gz", "has_sig": false, "md5_digest": "1eabad093bf688699a083bed8bfb7825", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3262, "upload_time": "2019-05-03T19:54:30", "url": "https://files.pythonhosted.org/packages/88/bc/4d54270c47eea6c7968187183a191a663f379483acbe27b995f4d5217a90/getopt2-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1eabad093bf688699a083bed8bfb7825", "sha256": "ea3ea9d22ee65d285f79a1e907681c189ecb7797611fbd505cc00373bd809ca7" }, "downloads": -1, "filename": "getopt2-0.0.3.tar.gz", "has_sig": false, "md5_digest": "1eabad093bf688699a083bed8bfb7825", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3262, "upload_time": "2019-05-03T19:54:30", "url": "https://files.pythonhosted.org/packages/88/bc/4d54270c47eea6c7968187183a191a663f379483acbe27b995f4d5217a90/getopt2-0.0.3.tar.gz" } ] }