Skip to main content

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()

Metadata

Release files for rv-script-utils 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rv-script-utils 0.2.1
File Size Uploaded
rv_script_utils-0.2.1.tar.gz 22.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rv-script-utils 0.2.1
File Interpreter ABI Platform
rv_script_utils-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 31.3 kB

Release files / rv_script_utils-0.2.1.tar.gz

Download URL rv_script_utils-0.2.1.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
81acaf7a692808b894386e911220541aadb12b4e17918f4c33e375c8aae9b4cd
BLAKE2b-256 checksum
How to use checksums
bc81b3588d3b00879e2de878cc9e8f45de7dcdf9c1a95165528ab5d3f85315b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 27, 2024.

Transparency log

Release files / rv_script_utils-0.2.1-py3-none-any.whl

Download URL rv_script_utils-0.2.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d770b9bc680dcbc7b6eb91a7137ad581f213019893a4f19837cb45c06eb6e78d
BLAKE2b-256 checksum
How to use checksums
197ddbc8a4bfbcaf9ed0015f283dfa520604dfe7b7450ae3efb9d7882013d0b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 27, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page