Skip to main content

Semantic, bidirectional HTTP status abstraction with CLI and framework support

Project description

PyPI version CI Python versions

httpstatusx 🚦

httpstatusx is a semantic, bidirectional, and framework-agnostic Python library for working with HTTP status codes.

It removes the need to memorize numeric HTTP codes and helps backend developers write clean, readable, and maintainable APIs.


✨ Features

  • Full IANA HTTP status code coverage
  • Name → Code and Code → Name lookup
  • Semantic categories (success, client_error, server_error, etc.)
  • Fuzzy matching for shorthand queries
  • FastAPI & Flask integrations
  • Command-line interface (CLI)
  • Fully tested & open-source

📦 Installation

pip install httpstatusx

For development:

pip install -e .

🚀 Quick Start

from httpstatusx import HTTP

HTTP["ok"]                 # 200
HTTP["created"]            # 201
HTTP["unauth"]             # 401
HTTP.name(404)             # "not_found"
HTTP.category(503)         # "server_error"
HTTP.is_error(400)         # True

⚡ Framework Integrations

FastAPI

from httpstatusx import fastapi

raise fastapi("not_found", "User not found")

Flask

from httpstatusx import flask

flask("unauthorized")

🖥️ CLI Usage

httpstatusx ok
httpstatusx 404
httpstatusx service_unavailable

🧪 Testing

pytest
pytest --cov=httpstatusx

📄 License

MIT License © 2025 Adam Koda

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

httpstatusx-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

httpstatusx-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file httpstatusx-0.1.0.tar.gz.

File metadata

  • Download URL: httpstatusx-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for httpstatusx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0fee428cfb3ffe1d543f94fc23a0234ebe344423e6690e10b20b78745076f8bf
MD5 eff75b966b2ed019c957af5cae483d02
BLAKE2b-256 3c9f12c43063a2da68dea2a2a72a7270c8f7119bd70a19f1b5882e625fa183b6

See more details on using hashes here.

File details

Details for the file httpstatusx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: httpstatusx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for httpstatusx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8737a33b0693485de871a788f83450f7ffca418e4c6a5cd9c43c6ea576019010
MD5 446948dd677e29919f1f0c6d74b96231
BLAKE2b-256 6436bd3cd5f25ba34b1d598bf1ac304a5583869f1a3a14186931221e031855fd

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