autocall


Nameautocall JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryCall function directly in command line and a well help tips generately automatically
upload_time2024-03-29 08:54:09
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseCopyright (c) 2016 The Python Packaging Authority (PyPA) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords command line call function
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Call function directly in cmd line

#### Features
1. Allow user call functions directly in command line.
2. Generate help tips automatically.

#### Code example
``` python
#!/bin/bash
from autocall import *

# The tar @cmdline is used to register the function.
@cmdline
def test1():
	pass
    
@cmdline
def test2(arg):
	pass
    
@cmdline
def test3(arg1, arg2: str = 'this is a string'):
	print(arg2)
    
@cmdline
def test4(arg1, arg2: int):
	'You can add some extra information here.'
	pass
    
# main function
parse_and_run()
```
#### Run the code
``` bash
$ ./main.py --help
Help Tips Provided by Autocall.
  option:
    --test1
    
    --test2     arg
    
    --test3     arg1  [arg2 = this is a string]
    
    --test4     arg1  arg2
	            You can add some extra information here.
    
    --help      [verbose = notverbose]
    		    Give the argument "verbose" instead of "notverbose" to print detail information.
    
$ ./main.py --help verbose
Help Tips Provided by Autocall.
  option:
    --test1
    
    --test2     arg
    
    --test3     arg1  [arg2(str) = this is a string]
    
    --test4     arg1  arg2(int)
	            You can add some extra information here.
    
    --help      [verbose(str) = notverbose]
    		    Give the argument "verbose" instead of "notverbose" to print detail information.

$ # call function test3 and pass arguments arg1=1
$ ./main.py --test3 1
this is a string

$ # call function test3 and pass arguments arg1=1, arg2="this will be showed."     
$ ./main.py --test3 1 "this will be showed."
this will be showed.
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "autocall",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "bajeer <z_bajer@yeah.net>",
    "keywords": "command, line, call, function",
    "author": null,
    "author_email": "bajeer <z_bajer@yeah.net>",
    "download_url": "https://files.pythonhosted.org/packages/fe/f5/65183429a7b1a0fad86c0330bc51a67717a9dae06ef0b3b69ce3226840c8/autocall-1.0.0.tar.gz",
    "platform": null,
    "description": "# Call function directly in cmd line\n\n#### Features\n1. Allow user call functions directly in command line.\n2. Generate help tips automatically.\n\n#### Code example\n``` python\n#!/bin/bash\nfrom autocall import *\n\n# The tar @cmdline is used to register the function.\n@cmdline\ndef test1():\n\tpass\n    \n@cmdline\ndef test2(arg):\n\tpass\n    \n@cmdline\ndef test3(arg1, arg2: str = 'this is a string'):\n\tprint(arg2)\n    \n@cmdline\ndef test4(arg1, arg2: int):\n\t'You can add some extra information here.'\n\tpass\n    \n# main function\nparse_and_run()\n```\n#### Run the code\n``` bash\n$ ./main.py --help\nHelp Tips Provided by Autocall.\n  option:\n    --test1\n    \n    --test2     arg\n    \n    --test3     arg1  [arg2 = this is a string]\n    \n    --test4     arg1  arg2\n\t            You can add some extra information here.\n    \n    --help      [verbose = notverbose]\n    \t\t    Give the argument \"verbose\" instead of \"notverbose\" to print detail information.\n    \n$ ./main.py --help verbose\nHelp Tips Provided by Autocall.\n  option:\n    --test1\n    \n    --test2     arg\n    \n    --test3     arg1  [arg2(str) = this is a string]\n    \n    --test4     arg1  arg2(int)\n\t            You can add some extra information here.\n    \n    --help      [verbose(str) = notverbose]\n    \t\t    Give the argument \"verbose\" instead of \"notverbose\" to print detail information.\n\n$ # call function test3 and pass arguments arg1=1\n$ ./main.py --test3 1\nthis is a string\n\n$ # call function test3 and pass arguments arg1=1, arg2=\"this will be showed.\"     \n$ ./main.py --test3 1 \"this will be showed.\"\nthis will be showed.\n```\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2016 The Python Packaging Authority (PyPA)  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Call function directly in command line and a well help tips generately automatically",
    "version": "1.0.0",
    "project_urls": {
        "Bug Reports": "https://gitee.com/z-bajer/autocall/issues",
        "Homepage": "https://gitee.com/z-bajer/autocall",
        "Source": "https://gitee.com/z-bajer/autocall"
    },
    "split_keywords": [
        "command",
        " line",
        " call",
        " function"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b94bda2a5a9a4171580b9acf3d8a28bbf26a3c6431d36dbbb92dbae8da831dc2",
                "md5": "f97b46a3d74827daf991c485522ba7b5",
                "sha256": "a490e2a07513d1727bf128e0c371436b96a2ec15ceed37eb3fe112a08cd0420e"
            },
            "downloads": -1,
            "filename": "autocall-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f97b46a3d74827daf991c485522ba7b5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4742,
            "upload_time": "2024-03-29T08:54:07",
            "upload_time_iso_8601": "2024-03-29T08:54:07.337826Z",
            "url": "https://files.pythonhosted.org/packages/b9/4b/da2a5a9a4171580b9acf3d8a28bbf26a3c6431d36dbbb92dbae8da831dc2/autocall-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fef565183429a7b1a0fad86c0330bc51a67717a9dae06ef0b3b69ce3226840c8",
                "md5": "a48e55cef518dac4886349a8bb8f980b",
                "sha256": "e3c4142b22898cd7c38b78fcf08426738501bcb5f9a8a512e7a86075833537c9"
            },
            "downloads": -1,
            "filename": "autocall-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a48e55cef518dac4886349a8bb8f980b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5835,
            "upload_time": "2024-03-29T08:54:09",
            "upload_time_iso_8601": "2024-03-29T08:54:09.024937Z",
            "url": "https://files.pythonhosted.org/packages/fe/f5/65183429a7b1a0fad86c0330bc51a67717a9dae06ef0b3b69ce3226840c8/autocall-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-29 08:54:09",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "autocall"
}
        
Elapsed time: 0.23175s