Skip to main content

Minder

Vercel deployment PyPI pdm-managed pre-commit.ci status Supported Python versions

Exception guard capture utility library.

Installation

pip install minder

Demo

The Minder context manager keeps failure modes contained with minimal legibility cost:

from minder import Minder


def succeed() -> dict:
    with Minder() as guard:
        with guard.duty("winning"):
            guard.result = 100
    return guard.report()


response = succeed()
print(response)
{'result': 100, 'success': True}

When an error is encountered, we get the same interface.

from minder import Minder


def fail() -> dict:
    with Minder() as guard:
        with guard.duty("greet"):
            print("Hello world")
        with guard.duty("division"):
            guard.result = 1 / 0
    return guard.report()


response = fail()
print(response)
Hello world
{'result': {'error': 'division by zero', 'where': 'division'}, 'success': False}

In this example we expose a reliable interface of a result and success boolean.

We could also return guard (the Minder instance) and handle success/failure at the call site, but the assumption is we would rather have this prepared for us.

Metadata

Release files for minder 0.0.2

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

Source distribution (sdist)

Source distribution for minder 0.0.2
File Size Uploaded
minder-0.0.2.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minder 0.0.2
File Interpreter ABI Platform
minder-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / minder-0.0.2.tar.gz

Download URL minder-0.0.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
928c48a83744a2e68846c7b1b5d6e53e3d56740584e61936c70ac636ef38c80c
BLAKE2b-256 checksum
How to use checksums
a88cdf1327d97897ba81d619095731761c7cee40fb92732e46676e0350edc442
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.12.3 CPython/3.11.5

Release files / minder-0.0.2-py3-none-any.whl

Download URL minder-0.0.2-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d97777f08ba7088abeabf50ad8863dc299a801cff0bfc242f23540eb29a9eb6
BLAKE2b-256 checksum
How to use checksums
6c315b019178f908516756305717bd072b51ad985f0afac26836c9e2f661db3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.12.3 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

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