Request
Awaiting run()
The repository ships three examples that progress across the current public surface. Clone the repository and prepare its development environment:
git clone https://github.com/tugrulguner/dexpot.gitcd dexpotuv sync --all-extrasexamples/minimal.py demonstrates a typed integer path capture and msgspec response.
uv run python examples/minimal.pycurl -s http://127.0.0.1:8000/items/7{"id":7,"name":"item-7","price":7.0}examples/typed_crud.py demonstrates typed JSON bodies, compiled response encoders, status/payload returns, and thread-safe shared application state.
uv run python examples/typed_crud.pycurl -s -X POST http://127.0.0.1:8000/items \ -H 'Content-Type: application/json' \ -d '{"name":"keyboard","price":79.0}'The lock in this example belongs to the application. It protects the mutable dictionary when handlers execute concurrently.
The browser-local playground below computes request/response examples from bounded inputs and session-only state. It follows the example’s starter item and response statuses/bodies; it is not a Python runtime or benchmark.
BROWSER-LOCAL CONTRACT NO SERVER REQUESTS
Use the actual typed CRUD example as a guide, then run a bounded request locally.
@app.post("/items", body=ItemIn, response=Item)
def create_item(item: ItemIn) -> tuple[int, Item]:
global _next_id
with _lock:
created = Item(id=_next_id, name=item.name, price=item.price)
_items[_next_id] = created
_next_id += 1
return 201, createdOpen complete example ↗— Browser-local processing only. Excludes Dexpot Python/server and network latency.
Local contract preview, not a Python server. No network calls. Starts with the example item; maximum 20 live items. Editing clears the last result. Only Run executes. State changes persist if result presentation fails; use an explicit follow-up operation (such as GET) to inspect state—there is no automatic rollback.
Awaiting run()
No response yet.
examples/bounded_api.py customizes HttpLimits and exercises 413, 422, and 405 responses plus typed Request injection.
uv run python examples/bounded_api.pycurl -s http://127.0.0.1:8000/healthcurl -s http://127.0.0.1:8000/contextThe test suite launches every example as a subprocess and validates its public HTTP behavior. Set DEXPOT_EXAMPLE_PORT when port 8000 is occupied.
Read the complete examples guide and source files in the repository.