Skip to content

Adamkoda2306/httpstatusx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

httpstatusx is a semantic, bidirectional, and framework-agnostic Python library for working with HTTP status codes. (Published in pypi.org)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages