These examples are small, accurate reference apps for humans and LLM coding agents. Each file focuses on one Panther concept and can be run directly with:
panther run examples.canonical.01_single_file:appIf you run from a checkout without installing Panther globally, activate the project virtual environment first:
source .venv/bin/activateWebSocket examples require Panther's optional WebSocket dependency:
pip install "panther[full]"01_single_file.py- Minimal app with a plainResponse.02_function_api.py- Function-based APIs, path variables, query params, input validation, and output filtering.03_class_api.py- Class-basedGenericAPIendpoints.04_auth_permissions.py- Custom authentication and permission classes.05_middleware_cache_throttle.py- Global middleware, endpoint cache, and throttling.06_websocket.py- MinimalGenericWebsocketecho endpoint.07_files_streaming_templates.py- HTML, template, file, redirect, and streaming responses.08_pantherdb_models.py- PantherDB model, serializer, and CRUD-style endpoints.09_testing_clients.py- UsingAPIClientandWebsocketClient.10_events_background_tasks.py- Startup/shutdown events and background task scheduling.
Prefer these files over older generated Q&A material when teaching an LLM Panther APIs.