OpenViper Documentation
OpenViper is a production-ready, async-first Python web framework designed to be both flexible and batteries-included. It gives you the freedom of a minimal, unopinionated core when you want control, while also providing a rich, fully integrated stack when you want to move fast.
Out of the box it includes a powerful ORM with model lifecycle and events, built-in authentication and authorization, an Admin UI, background task processing, a pluggable AI provider registry, and automatic OpenAPI documentation.
Whether you’re building lean APIs or full-scale platforms, OpenViper scales with you — without forcing you into rigid architectural constraints.
Quick Example
The examples/flexible/app.py or examples/todoapp/ in the repo is the minimal way to get started:
# examples/flexible/app.py
from openviper import OpenViper, JSONResponse
from openviper.http.request import Request
app = OpenViper(title="Standard Example API", version="1.0.0")
@app.get("/")
async def index(request: Request) -> JSONResponse:
return JSONResponse({"message": "Hello, OpenViper!"})
@app.get("/users/{user_id}")
async def get_user(request: Request, user_id: int) -> JSONResponse:
# ... fetch from DB
return JSONResponse({"id": user_id})
# Run it
openviper run app --reload # from examples/flexible/, --reload to watch file changes and hot reload
# Open: http://localhost:8000
# Swagger: http://localhost:8000/open-api/docs
For a full example with auth, admin, templates, and ORM see examples/todoapp/. For a production-grade multi-app example with AI moderation see examples/ai_moderation_platform/.
Key highlights
Async-first — every request handler, ORM query, and lifecycle hook is
async/awaitnative.Models and ORM — models with full async support and model lifecycle.
Protected ORM — role-based access enforcement at the query level, not just at the view level.
AI-native — a unified AI Integration abstracts OpenAI, Anthropic, Gemini, Ollama, Grok and custom providers behind a single async API.
Admin panel — automatic CRUD interface, auto-discovery, and role-based visibility.
Background tasks — task queue with retry policies, priorities.
Periodic scheduler — cron and interval scheduling built into the framework.
OpenAPI — live Swagger and ReDoc UIs generated automatically from your routes.
Getting Started
Tutorial
- Tutorial: Building a Blog
- Step 1 — Create the Project
- Step 2 — Create the Users App
- Step 3 — Create the Blog App
- Define the Post Model
- Create the Serializer (Optional)
- Step 4 — Write the Views
- Step 5 — Register Routes
- Step 6 — Register with the Admin Panel
- Step 7 — Task and Events
- Step 8 — Optional: AI Content Generator
- Explore the Tools
- Testing with Swagger UI (OpenAPI)
- Well Done!
Framework Reference
Configuration & Operations
Indices and tables