checkopt


Namecheckopt JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/yixinNB/checkopt
Summary✨A powerful tool to replace getopt✨
upload_time2023-11-09 05:15:30
maintainer
docs_urlNone
authory
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # quick start
```
import checkopt  
print(checkopt.checkopt("g help m|module="))

(venv) PS D:\python> python .\test.py -m module_name --help -g project_name
({'m': 'module_name', 'help': None, 'g': None}, ['project_name'])
```

# argument format
`short_opts|long_opts=`
`=`means the flag receives an  argument

# advantages
**getopt**
```
getopt.getopt(args, "m:h", ["help", "module="])
(venv) PS D:\WorkSpace\python> python .\test.py -h file -o -m abc
([('-h', '')], ['file', '-o', '-m', 'abc'])
```
**checkopt**
```
checkopt.checkopt("m= h|help")
(venv) PS D:\WorkSpace\python> python .\test.py -h file -o -m abc
AssertionError: -o is not expected
```


```
print(getopt.getopt(sys.argv[1:], "m:h")) 
print(checkopt.checkopt("m= h|help"))

(venv) PS D:\WorkSpace\python> python .\container_update.py -h file -m abc   
([('-h', '')], ['file', '-m', 'abc']) # getopt
({'h': None, 'm': 'abc'}, ['file'])   # checkopt
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yixinNB/checkopt",
    "name": "checkopt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "y",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/f0/c7/e4682a14bb1023f3ccf8418d8f223a4ec5b7ca9de793fb131669c91129c7/checkopt-0.1.1.tar.gz",
    "platform": null,
    "description": "# quick start\r\n```\r\nimport checkopt  \r\nprint(checkopt.checkopt(\"g help m|module=\"))\r\n\r\n(venv) PS D:\\python> python .\\test.py -m module_name --help -g project_name\r\n({'m': 'module_name', 'help': None, 'g': None}, ['project_name'])\r\n```\r\n\r\n# argument format\r\n`short_opts|long_opts=`\r\n`=`means the flag receives an  argument\r\n\r\n# advantages\r\n**getopt**\r\n```\r\ngetopt.getopt(args, \"m:h\", [\"help\", \"module=\"])\r\n(venv) PS D:\\WorkSpace\\python> python .\\test.py -h file -o -m abc\r\n([('-h', '')], ['file', '-o', '-m', 'abc'])\r\n```\r\n**checkopt**\r\n```\r\ncheckopt.checkopt(\"m= h|help\")\r\n(venv) PS D:\\WorkSpace\\python> python .\\test.py -h file -o -m abc\r\nAssertionError: -o is not expected\r\n```\r\n\r\n\r\n```\r\nprint(getopt.getopt(sys.argv[1:], \"m:h\")) \r\nprint(checkopt.checkopt(\"m= h|help\"))\r\n\r\n(venv) PS D:\\WorkSpace\\python> python .\\container_update.py -h file -m abc   \r\n([('-h', '')], ['file', '-m', 'abc']) # getopt\r\n({'h': None, 'm': 'abc'}, ['file'])   # checkopt\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "\u2728A powerful tool to replace getopt\u2728",
    "version": "0.1.1",
    "project_urls": {
        "Code": "https://github.com/yixinNB/checkopt",
        "Documentation": "https://github.com/yixinNB/checkopt",
        "Homepage": "https://github.com/yixinNB/checkopt",
        "Issue tracker": "https://github.com/yixinNB/checkopt/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5b7378581ee4e4ac2dc04b59b8880752377d16214873a446d5926c732a6ad909",
                "md5": "8f10859ee8d711d46506198a23c549fe",
                "sha256": "5a912b3bd3cc5299da1162742b5cb547b79ca644727a9a78eaa72e928738f59f"
            },
            "downloads": -1,
            "filename": "checkopt-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8f10859ee8d711d46506198a23c549fe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6668,
            "upload_time": "2023-11-09T05:15:29",
            "upload_time_iso_8601": "2023-11-09T05:15:29.065939Z",
            "url": "https://files.pythonhosted.org/packages/5b/73/78581ee4e4ac2dc04b59b8880752377d16214873a446d5926c732a6ad909/checkopt-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0c7e4682a14bb1023f3ccf8418d8f223a4ec5b7ca9de793fb131669c91129c7",
                "md5": "194fdd8d6a8a9d17a2bc6344a9b7a1eb",
                "sha256": "f166cbe61ae2f42077b448783a98ed74bcda3ddc0e935dd22d9d297750134ec3"
            },
            "downloads": -1,
            "filename": "checkopt-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "194fdd8d6a8a9d17a2bc6344a9b7a1eb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6475,
            "upload_time": "2023-11-09T05:15:30",
            "upload_time_iso_8601": "2023-11-09T05:15:30.488927Z",
            "url": "https://files.pythonhosted.org/packages/f0/c7/e4682a14bb1023f3ccf8418d8f223a4ec5b7ca9de793fb131669c91129c7/checkopt-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-09 05:15:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yixinNB",
    "github_project": "checkopt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "checkopt"
}
        
y
Elapsed time: 0.14354s