Skip to content



Test Coverage Package version Supported Python versions

Xpresso is an ASGI web framework built on top of Starlette, Pydantic and di, with heavy inspiration from FastAPI.

Some of the standout features are:

  • ASGI support for high performance (within the context of Python web frameworks)
  • OpenAPI documentation generation
  • Automatic parsing and validation of request bodies and parameters, with hooks for custom extractors
  • Full support for OpenAPI parameter serialization
  • Highly typed and tested codebase with great IDE support
  • A powerful dependency injection system, backed by di


Python 3.7+


pip install xpresso

You'll also want to install an ASGI server, such as Uvicorn.

pip install uvicorn


Create a file named

from pydantic import BaseModel
from xpresso import App, Path, FromPath, FromQuery

class Item(BaseModel):
    item_id: int
    name: str

async def read_item(item_id: FromPath[int], name: FromQuery[str]) -> Item:
    return Item(item_id=item_id, name=name)

app = App(

Run the application:

uvicorn example:app

Navigate to in your browser. You will get the following JSON response:


Now navigate to to poke around the interactive Swagger UI documentation:

Swagger UI

For more examples, tutorials and reference materials, see our documentation.

Inspiration and relationship to other frameworks

Xpresso is mainly inspired by FastAPI. FastAPI pioneered several ideas that are core to Xpresso's approach:

  • Leverage Pydantic for JSON parsing, validation and schema generation.
  • Leverage Starlette for routing and other low level web framework functionality.
  • Provide a simple but powerful dependency injection system.
  • Use that dependency injection system to provide extraction of request bodies, forms, query parameters, etc.

Xpresso takes these ideas and refines them by: