Skip to main content

A Python HTTP superframework

Project description

uapi

Documentation Build status coverage Code style License: Apache2

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uapi-23.2.0.tar.gz (329.9 kB view hashes)

Uploaded Source

Built Distribution

uapi-23.2.0-py3-none-any.whl (42.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page