Skip to main content

RFC9457 implementation for Python

uv ruff image image image style tests codecov

rfc9457 is a set of exceptions to support easy error management and responses in web based apis.

Each exception easily marshals to JSON based on the RFC9457 spec for use in api errors.

This library is currently used to support problem details in both Starlette and FastAPI.

starlette-problem fastapi-problem

Custom Errors

Subclassing the convenience classes provides a simple way to consistently raise the same error with details/extras changing based on the raised context.

from rfc9457 import NotFoundProblem


class UserNotFoundError(NotFoundProblem):
    title = "User not found."


UserNotFoundError(
    detail="details",
    custom_key="value",
).marshal()
{
    "type": "user-not-found",
    "title": "User not found",
    "status": 404,
    "detail": "details",
    "custom_key": "value",
}

Metadata

Release files for rfc9457 0.4.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 rfc9457 0.4.1
File Size Uploaded
rfc9457-0.4.1.tar.gz 70.1 kB Details

Built distribution (wheel)

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

Total release size: 78.9 kB

Release files / rfc9457-0.4.1.tar.gz

Download URL rfc9457-0.4.1.tar.gz
Size 70.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f754decf8cc42d93af40be455c77e0a1be19bef3826adf9feb91f849bcbd56a8
BLAKE2b-256 checksum
How to use checksums
6fbf9004fea8639bcbfdfa4f055a174520923dc151d7e2236fa00a62bf582009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / rfc9457-0.4.1-py3-none-any.whl

Download URL rfc9457-0.4.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67d68b2b3194eb268ad59b27fba3126705366ebaaa5fc182e84ce2437c4b7d37
BLAKE2b-256 checksum
How to use checksums
d9e282adc9e1b4b93e958220adbc2aab4e55de5bf4f795c86897a82f0a7df79a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.6

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

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