Skip to content

Examples Gallery

Example Description File
Hello World Basic GET and parameterized routes examples/01_hello_world.py
Path & Query Params URL parameters and query strings examples/02_path_query_params.py
Request Body JSON body validation with Pydantic examples/03_request_body.py
Example Description File
Dependencies Dependency injection with Depends examples/04_dependencies.py
Middleware Request/response interception examples/05_middleware.py
Error Handling Custom exception handlers examples/06_error_handling.py
File Uploads Multipart form data examples/07_file_uploads.py
Routers Modular APIRouter examples/08_routers.py
DB Integration Database read/write examples/09_db_integration.py
WebSockets Real-time bidirectional comms examples/10_websockets.py
Example Description File
Plugin System Custom plugin with caching examples/plugin_cache.py
Agent Demo MCP tools, sessions, streaming examples/agent_demo/app.py

The demo_shop is a complete e-commerce application with 23 endpoints:

  • Catalog (categories, products, sellers)
  • Customers (register, lookup)
  • Cart (add, remove, checkout)
  • Orders (create, list, status lifecycle)
  • Reviews (CRUD, analytics)

All examples are in the examples/ directory of the repository.