Quickstart
Install
Section titled “Install”uv add lexigram-weblexigram (core) and lexigram-contracts are pulled in automatically.
Minimal Web API
Section titled “Minimal Web API”A single-file prototype with the quickstart app:
from lexigram.web import app, get, singleton
@singletonclass Greeter: def hello(self, name: str) -> str: return f"Hello, {name}"
@get("/hello/{name}")async def hello(name: str, greeter: Greeter) -> dict: return {"message": greeter.hello(name)}Run with any ASGI server:
uv run uvicorn main:appThe app object is a standard ASGI application. OpenAPI docs are auto-generated at /docs (Swagger UI) and /redoc.
Production Pattern
Section titled “Production Pattern”Use Application + WebProvider for explicit control:
from lexigram import Applicationfrom lexigram.web import WebProvider
def create_app() -> Application: app = Application(name="my-api") app.add_provider(WebProvider()) return appuv run uvicorn app:create_app --factoryNext Steps
Section titled “Next Steps”- Guide — mental model, workflows, best practices
- How-Tos — task-oriented recipes
- Configuration — every config key