Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Alpha PyPI py.typed CI License: MIT

Checked exceptions for Python. Declare what your functions raise, and let saferaise enforce it - using your existing try/except blocks.

CAUTION: Alpha: The API may change between releases, and using this right now might very well break your code in weird ways, so don't use it in production.

Quick Start

# entrypoint.py
import saferaise

saferaise.register("app")   # instrument app's try/except blocks before importing it

import app
with saferaise.enable():    # activate checking for this scope
    app.main()
# app.py
from saferaise import raises

@raises(ValueError)
def parse_input(raw: str) -> int:
    return int(raw)

def main():
    try:
        parse_input("abc")  # ValueError is caught here - @raises is satisfied
    except ValueError:
        print("bad input")

register must be called before importing the package it instruments, and in a separate file from the code being instrumented.

Documentation

Full documentation is available at https://paillat.dev/saferaise

License

MIT License. See LICENSE for details.

Metadata

Release files for saferaise 0.0.1a12

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

Source distribution (sdist)

Source distribution for saferaise 0.0.1a12
File Size Uploaded Provenance Actions
saferaise-0.0.1a12.tar.gz 9.6 kB Without provenance Details for saferaise-0.0.1a12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for saferaise 0.0.1a12
File Interpreter ABI Platform Actions
saferaise-0.0.1a12-py3-none-any.whl Python 3 none any Details for saferaise-0.0.1a12-py3-none-any.whl

Total release size: 21.1 kB

Release files / saferaise-0.0.1a12.tar.gz

Download URL saferaise-0.0.1a12.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
061ad487b74accc2bcde7c57754b8d1d5380ec5c85c4240b32c7a9739d4c6099
BLAKE2b-256 checksum
How to use checksums
ded5ba965f8ea2e6b97d3d6d66c8245ed9dcf8d30d0766302e648147ea2f2248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.26.6 CPython/3.13.12 Linux/6.14.0-1017-azure

Release files / saferaise-0.0.1a12-py3-none-any.whl

Download URL saferaise-0.0.1a12-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
875f0cc8d4aa0e078584c9976b1f80a551378fcf41e68a37aa67035cf113dd16
BLAKE2b-256 checksum
How to use checksums
f2b15bc620190982f822345deaebdc87e86509dd5e112462370fb2bf568462ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.26.6 CPython/3.13.12 Linux/6.14.0-1017-azure

Security for saferaise 0.0.1a12

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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