Skip to main content

Implementation of RFC9457 problems.

Project description

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",
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rfc9457-0.4.1.tar.gz (70.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rfc9457-0.4.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file rfc9457-0.4.1.tar.gz.

File metadata

  • Download URL: rfc9457-0.4.1.tar.gz
  • Upload date:
  • Size: 70.1 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for rfc9457-0.4.1.tar.gz
Algorithm Hash digest
SHA256 f754decf8cc42d93af40be455c77e0a1be19bef3826adf9feb91f849bcbd56a8
MD5 d4e05e20e57f657ef36647d2b5e04b82
BLAKE2b-256 6fbf9004fea8639bcbfdfa4f055a174520923dc151d7e2236fa00a62bf582009

See more details on using hashes here.

File details

Details for the file rfc9457-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: rfc9457-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for rfc9457-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67d68b2b3194eb268ad59b27fba3126705366ebaaa5fc182e84ce2437c4b7d37
MD5 3b17a2d484a627bd310826e63e30e13e
BLAKE2b-256 d9e282adc9e1b4b93e958220adbc2aab4e55de5bf4f795c86897a82f0a7df79a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page