Name | rv-script-utils JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | Utilities to help make scripts |
upload_time | 2024-11-07 23:34:43 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.12 |
license | MIT License Copyright (c) 2024 rveachkc 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 |
script
logging
healthchecks.io
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# rv-script-utils
Script utilities to add in structured logging and support for healthchecks.io.
See example of use in hello.py and in the example below.
```python
from typing import Self
from rv_script_lib import ScriptBase
class HelloWorld(ScriptBase):
PARSER_ARGPARSE_KWARGS = {
"description": "Hello World",
}
def extraArgs(self: Self):
self.parser.add_argument(
"-m",
"--message",
type=str,
dest="message",
default="you forgot to add a message with -m/--message",
help="What do you want to say?",
)
def runJob(self: Self):
self.log.info("Hello from rv-script-utils!")
try:
raise RuntimeError("This is just a test")
except Exception as e:
self.log.exception(e)
self.log.warning("Warning, just for fun")
self.log.info(self.args.message)
if __name__ == "__main__":
myscript = HelloWorld()
myscript.run()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "rv-script-utils",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "script, logging, healthchecks.io",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/59/a1/5d83f57efd3074b17d49adc4697d91c165beaa74a044803be3973c877ed7/rv_script_utils-0.1.0.tar.gz",
"platform": null,
"description": "# rv-script-utils\n\nScript utilities to add in structured logging and support for healthchecks.io.\nSee example of use in hello.py and in the example below.\n\n```python\nfrom typing import Self\n\nfrom rv_script_lib import ScriptBase\n\n\nclass HelloWorld(ScriptBase):\n\n PARSER_ARGPARSE_KWARGS = {\n \"description\": \"Hello World\",\n }\n\n def extraArgs(self: Self):\n\n self.parser.add_argument(\n \"-m\",\n \"--message\",\n type=str,\n dest=\"message\",\n default=\"you forgot to add a message with -m/--message\",\n help=\"What do you want to say?\",\n )\n\n def runJob(self: Self):\n\n self.log.info(\"Hello from rv-script-utils!\")\n\n try:\n raise RuntimeError(\"This is just a test\")\n except Exception as e:\n self.log.exception(e)\n\n self.log.warning(\"Warning, just for fun\")\n\n self.log.info(self.args.message)\n\n\nif __name__ == \"__main__\":\n\n myscript = HelloWorld()\n myscript.run()\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 rveachkc 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": "Utilities to help make scripts",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/rveachkc/rv-script-utils"
},
"split_keywords": [
"script",
" logging",
" healthchecks.io"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "118fabe273f26c26948036bcf0ec1f81d0432192ac8fcb3dad0b24862fa01f07",
"md5": "9fc39dd0b581e87475e4f7848064a796",
"sha256": "82133bd1a4150ac3798fd0ff57df17857687dda082d3a96c066758c3c3e395b4"
},
"downloads": -1,
"filename": "rv_script_utils-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9fc39dd0b581e87475e4f7848064a796",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 7943,
"upload_time": "2024-11-07T23:34:41",
"upload_time_iso_8601": "2024-11-07T23:34:41.209404Z",
"url": "https://files.pythonhosted.org/packages/11/8f/abe273f26c26948036bcf0ec1f81d0432192ac8fcb3dad0b24862fa01f07/rv_script_utils-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "59a15d83f57efd3074b17d49adc4697d91c165beaa74a044803be3973c877ed7",
"md5": "3fe00a136f4e1cabcd1f5db5b00a8b5a",
"sha256": "8f40ba210c133aecc26f1bbc9fcfea2fc2fc0b801796a77815bcca44dfaab80c"
},
"downloads": -1,
"filename": "rv_script_utils-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3fe00a136f4e1cabcd1f5db5b00a8b5a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 20481,
"upload_time": "2024-11-07T23:34:43",
"upload_time_iso_8601": "2024-11-07T23:34:43.015591Z",
"url": "https://files.pythonhosted.org/packages/59/a1/5d83f57efd3074b17d49adc4697d91c165beaa74a044803be3973c877ed7/rv_script_utils-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-07 23:34:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rveachkc",
"github_project": "rv-script-utils",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rv-script-utils"
}