Utilities to help make scripts
Reason this release was yanked:
broken release
Project description
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.
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 run(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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rv_script_utils-0.0.0.tar.gz
(6.3 kB
view details)
Built Distribution
File details
Details for the file rv_script_utils-0.0.0.tar.gz
.
File metadata
- Download URL: rv_script_utils-0.0.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9a1c63ca21f7bf7942345a5f0c4a918945231055ea0b11b53f6feb09fdf1bf2 |
|
MD5 | b21cd77cd1a5b5ad20002b77ff769906 |
|
BLAKE2b-256 | 86ea2f0cf2a8e22e17f811b14248d8c92fae88775ac79c7861184a9148478a8b |
File details
Details for the file rv_script_utils-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: rv_script_utils-0.0.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25cc37ad5e4eb12a76a851d79a32134c77fa3fa19e1fac32766efc5a276c5c21 |
|
MD5 | b3ca31df4dffa9c6c5b69a43b005116a |
|
BLAKE2b-256 | 1a5b8da9ccd5be3ba677db72f2f251f1bdfe222fbc82acbeab129dc849bbded7 |