A Python HTTP superframework
Project description
uapi
uapi is an elegant, high-level, extremely low-overhead Python microframework for writing HTTP APIs, either synchronously or asynchronously.
uapi uses a lower-level HTTP framework to run. Currently supported frameworks are aiohttp, Django, Flask, Quart, and Starlette. An uapi app can be easily integrated into an existing project based on one of these frameworks, and a pure uapi project can be easily switched between them when needed.
Using uapi enables you to:
- write either async or sync styles of handlers, depending on the underlying framework used.
- use and customize a function composition (dependency injection) system, based on incant.
- automatically serialize and deserialize data through attrs and cattrs.
- generate and use OpenAPI descriptions of your endpoints.
- optionally type-check your handlers with Mypy.
- write and use reusable and powerful middleware, which integrates into the OpenAPI schema.
- integrate with existing apps based on Django, Starlette, Flask, Quart or aiohttp.
Here's a simple taste (install Flask and gunicorn first):
from uapi.flask import App
app = App()
@app.get("/")
def index() -> str:
return "Index"
app.serve_openapi()
app.serve_elements()
app.run(__name__) # Now open http://localhost:8000/elements
Project Information
License
uapi is written by Tin Tvrtković and distributed under the terms of the Apache-2.0 license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file uapi-23.3.0.tar.gz
.
File metadata
- Download URL: uapi-23.3.0.tar.gz
- Upload date:
- Size: 340.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a75ce2adb30d9839993c556b24fb6f15ef000878470b16dfd61cf1a2a559ea8 |
|
MD5 | 2c77af53cc84f9d64adc6ec73e6b85b5 |
|
BLAKE2b-256 | 471db8965bf974c6b286e26c1167612cc58db95dc7859c6d3d2a48f25bc698b0 |
File details
Details for the file uapi-23.3.0-py3-none-any.whl
.
File metadata
- Download URL: uapi-23.3.0-py3-none-any.whl
- Upload date:
- Size: 47.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0380f10560757407e1f25daca495d01e38497b3904fc84fdc7de7d5866604ea7 |
|
MD5 | 82705d7e670f6691a5b2916e20c1aae9 |
|
BLAKE2b-256 | e7be9e0eafd19a1398f26a6cb26f4ff9512e8e7577d3b4a68966d7ad06fd06ee |