Utilities to help make scripts
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 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()
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.1.0.tar.gz
(20.5 kB
view details)
Built Distribution
File details
Details for the file rv_script_utils-0.1.0.tar.gz
.
File metadata
- Download URL: rv_script_utils-0.1.0.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f40ba210c133aecc26f1bbc9fcfea2fc2fc0b801796a77815bcca44dfaab80c |
|
MD5 | 3fe00a136f4e1cabcd1f5db5b00a8b5a |
|
BLAKE2b-256 | 59a15d83f57efd3074b17d49adc4697d91c165beaa74a044803be3973c877ed7 |
Provenance
The following attestation bundles were made for rv_script_utils-0.1.0.tar.gz
:
Publisher:
python-package.yml
on rveachkc/rv-script-utils
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
rv_script_utils-0.1.0.tar.gz
- Subject digest:
8f40ba210c133aecc26f1bbc9fcfea2fc2fc0b801796a77815bcca44dfaab80c
- Sigstore transparency entry: 147451239
- Sigstore integration time:
- Predicate type:
File details
Details for the file rv_script_utils-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: rv_script_utils-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 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 | 82133bd1a4150ac3798fd0ff57df17857687dda082d3a96c066758c3c3e395b4 |
|
MD5 | 9fc39dd0b581e87475e4f7848064a796 |
|
BLAKE2b-256 | 118fabe273f26c26948036bcf0ec1f81d0432192ac8fcb3dad0b24862fa01f07 |
Provenance
The following attestation bundles were made for rv_script_utils-0.1.0-py3-none-any.whl
:
Publisher:
python-package.yml
on rveachkc/rv-script-utils
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
rv_script_utils-0.1.0-py3-none-any.whl
- Subject digest:
82133bd1a4150ac3798fd0ff57df17857687dda082d3a96c066758c3c3e395b4
- Sigstore transparency entry: 147451240
- Sigstore integration time:
- Predicate type: