skillfed

hug

A Python framework that makes developing APIs as simple as possible, but no simpler.

hug v2.6.1 133.4K downloads/30d#11,514 on PyPI6,884
Permissive license MIT DORMANT released

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 hug

uv

uv add hug

poetry

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 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

Development Status :: 6 - MatureEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Software Development :: LibrariesTopic :: Utilities

Tags

python rest api frameworklightweight api developmentpython http decoratorsapi with type annotationsfalcon-based web frameworkpython rpc frameworkauto-documented api
rest-apidecorator-basedtype-annotations

More Libraries packages