hug
A Python framework that makes developing APIs as simple as possible, but no simpler.
What it is and what it does
hug is a Python web framework built on top of Falcon that simplifies REST API development by letting you decorate plain Python functions to expose them as HTTP endpoints. It uses type annotations to automatically validate and convert request parameters, and generates API documentation without requiring separate specification files. The framework is designed to keep your Python code clean and testable—decorators don't modify the underlying functions, so you can call them directly in tests or other Python code.
The framework handles HTTP method routing (GET, POST, etc.), URL path parameters, query strings, and request/response lifecycle management through Falcon's high-performance HTTP library. It also supports API versioning, custom directives for dependency injection, and output formatters for different content types. hug aims to reduce boilerplate while encouraging self-documenting code through its use of Python's native type system.
Use it for:
- Build a simple REST API with minimal setup—decorate functions and run hug to serve them over HTTP.
- Create microservices where type annotations double as both validation and API documentation.
- Write testable API code by keeping endpoint functions as plain Python callables.
- Prototype or migrate from RPC-style services to HTTP APIs without rewriting core logic.
- Develop APIs that automatically expose interactive documentation at a /documentation endpoint.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
hug is a Python framework for building REST APIs and RPC services with minimal boilerplate, using decorators and type annotations to expose Python functions as HTTP endpoints.
Yes, if you need a lightweight, decorator-based REST framework and are comfortable with its dormant maintenance status. hug is mature (Development Status 6), has no known vulnerabilities, and low install friction. However, the last release was 2020-02-06 and no active development is evident; for new projects, consider whether a more actively maintained alternative (such as one with recent releases) better fits your long-term support needs.
Install
hug on PyPI
pip
pip install huguv
uv add hugpoetry
poetry add hugInstalling hug
Before you install
Installation is straightforward with low friction. The project is dormant (last release 2020-02-06, last commit 2024-07-04), but remains archived as false and has accumulated 6884 stars. Depends only on falcon and requests, both stable libraries.
License in practice
MIT license is permissive; you can use hug freely in commercial and private projects with minimal restrictions, provided you include the license notice.
Quickstart
pip install hug
import hug
@hug.get('/greet')
def greet(name: str):
return f'Hello {name}'
# Run: hug -f myfile.py
Requires Python 3.5 or later; hug is Python 3+ only.
Verify before relying
- Whether the framework remains actively maintained or receives security updates despite dormant status.
- Compatibility with modern Python versions beyond 3.7 (classifiers list up to 3.7).
- Performance characteristics compared to contemporary frameworks like FastAPI or Starlette.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — falcon, requests |
| Maintenance | dormant — 2,381 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 133,435/month — #11,514 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hug-2.6.1-py2.py3-none-any.whl
Keywords: Web, Python, Python3, Refactoring, REST, Framework, RPC
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
falconFalcon is a minimalist ASGI/WSGI framework for…
permissive · top 5,000 on PyPI
webargswebargs parses and validates HTTP request…
permissive · top 5,000 on PyPI
CherryPyCherryPy is an object-oriented HTTP framework…
permissive · top 5,000 on PyPI
wraptwrapt provides a Python module for building…
permissive · top 100 on PyPI
appierAppier is a lightweight Python web framework…
permissive · top 5,000 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
crowdstrike-falconpyFalconPy is the official CrowdStrike Falcon SDK…
permissive · top 5,000 on PyPI
spectreeGenerates OpenAPI documents and validates HTTP…
permissive · top 15,000 on PyPI
djangorestframeworkBuilds web APIs on top of Django with…
permissive · top 1,000 on PyPI
jaraco.classesProvides utility functions for working with…
permissive · top 1,000 on PyPI