{"id":21447,"library":"hug","title":"Hug","description":"Hug is a Python 3+ framework for developing REST APIs as simply as possible. It supports both synchronous and asynchronous endpoints, automatic input validation, and built-in interactive documentation. Current version is 2.6.1 (released August 2019). The project is in maintenance mode (no releases since 2019).","status":"maintenance","version":"2.6.1","language":"python","source_language":"en","source_url":"https://github.com/hugapi/hug","tags":["api","framework","rest","falcon"],"install":[],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"API","correct":"from hug import API"},{"note":"Functions are attributes of the hug module, not a submodule.","wrong":"","symbol":"hug.get/post/put/delete","correct":"import hug\n@hug.get('/path')"},{"note":"","wrong":"","symbol":"route decorator","correct":"from hug import route"}],"quickstart":{"code":"import hug\n\n@hug.get('/hello')\ndef hello(name: str):\n    return {'hello': name}\n\nif __name__ == '__main__':\n    hug.API(__name__).http.serve()","lang":"python","description":"Create a simple GET endpoint and serve it on default port 8000."},"warnings":[{"fix":"Pin falcon <2.0 or test with `__hug__.future = True`","message":"Falcon 2.0+ changes broke hug. Hug forces Falcon <2.0 by default. If you need newer Falcon, set `__hug__.future = True` before importing hug endpoints, but expect breakage.","severity":"breaking","affected_versions":">=2.5.2"},{"fix":"Use Python >=3.6","message":"Python 3.5 support dropped as of 2.5.1.","severity":"deprecated","affected_versions":">=2.5.1"},{"fix":"Upgrade to hug >=2.5.1","message":"POST requests broke in 2.5.0 (fixed in 2.5.1). Ensure you are on at least 2.5.1 if using POST.","severity":"gotcha","affected_versions":"2.5.0 only"},{"fix":"Upgrade to hug >=2.5.1","message":"Empty query params are not ignored on 2.5.0 (fixed in 2.5.1).","severity":"gotcha","affected_versions":"2.5.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Pin falcon<2.0 or set `__hug__.future = True` before importing hug.","cause":"Using `hug.API(__name__).http.serve()` after upgrading Falcon without pinning.","error":"TypeError: 'NoneType' object is not callable"},{"fix":"Use `import hug` and then `@hug.route('/path')` or `from hug import route` (direct import from hug package).","cause":"Incorrect import path. 'route' is not a submodule.","error":"ImportError: cannot import name 'route' from 'hug'"},{"fix":"Ensure your response handlers return strings or use `hug.output_format.json` properly.","cause":"Using Python 3 with Falcon < 2.0 but passing non-bytes body.","error":"TypeError: a bytes-like object is required, not 'str'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}