--- id: hug version: "2.6.1" license: MIT license_treatment: permissive maintenance: dormant --- # hug — A Python framework that makes developing APIs as simple as possible, but no simpler. License: permissive · Maintenance: dormant · Downloads: 133.4K/mo ## 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 above — 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 pip install hug uv add hug poetry add hug ## Installing 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_current - Install friction: low - Maintenance: dormant - Downloads: 133.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python rest api framework, lightweight api development, python http decorators, api with type annotations, falcon-based web framework, python rpc framework, auto-documented api, rest-api, decorator-based, type-annotations [View on SkillFed](https://skillfed.io/packages/hug) · [View on PyPI](https://pypi.org/project/hug/)