Automatic Configuration
Zero-config setup with intelligent defaults for development and production environments.
Zenith is a batteries-included Python web framework designed for building production-ready APIs quickly.
from zenith import Zenithfrom zenith.db import ZenithModelfrom sqlmodel import Fieldfrom typing import Optional
# Create application with automatic configurationapp = Zenith()
# Optional: Add built-in featuresapp.add_auth() # JWT authenticationapp.add_admin() # Admin dashboardapp.add_api("My API", "1.0.0") # Adds /docs and /redoc endpoints
# Define models with intuitive query methodsclass User(ZenithModel, table=True): id: Optional[int] = Field(primary_key=True) email: str = Field(unique=True, index=True) name: str
# Create endpoints with automatic session management@app.post("/users")async def create_user(email: str, name: str): user = await User.create(email=email, name=name) return {"user": user.model_dump()}
@app.get("/users")async def list_users(): users = await User.all() return {"users": [u.model_dump() for u in users]}Automatic Configuration
Zero-config setup with intelligent defaults for development and production environments.
ZenithModel
Enhanced SQLModel with chainable queries, automatic sessions, and intuitive database methods.
Built-in Features
One-line setup for authentication, admin dashboards, and API documentation.
Type Safety
Full type hints and Pydantic validation throughout the framework.
Zenith comes with everything you need for production APIs:
model_dump() methodapp.add_auth() for complete auth systemapp.add_admin() for system monitoring# Install Zenithpip install zenithweb
# Create a new projectzen new my-apicd my-api
# Start development serverzen devHere’s a complete task API with authentication:
from zenith import Zenithfrom zenith.db import ZenithModelfrom zenith import Authfrom sqlmodel import Fieldfrom typing import Optionalfrom datetime import datetime
app = Zenith()app.add_auth()app.add_admin()app.add_api("Task API", "1.0.0") # Interactive docs at /docs
class Task(ZenithModel, table=True): id: Optional[int] = Field(primary_key=True) title: str completed: bool = Field(default=False) user_id: int created_at: datetime = Field(default_factory=datetime.now)
@app.get("/tasks")async def list_tasks(user=Auth): """List tasks for authenticated user.""" tasks = await Task.where(user_id=user.id).all() return {"tasks": [t.model_dump() for t in tasks]}
@app.post("/tasks")async def create_task(title: str, user=Auth): """Create a new task.""" task = await Task.create(title=title, user_id=user.id) return {"task": task.model_dump()}
@app.patch("/tasks/{task_id}/complete")async def complete_task(task_id: int, user=Auth): """Mark task as completed.""" task = await Task.find_or_404(task_id) await task.update(completed=True) return {"task": task.model_dump()}This gives you:
/auth/loginuser=Auth/admin/docsZenith provides sensible defaults that work out of the box while remaining fully customizable when needed.
Every API is designed to be intuitive, with helpful error messages and excellent IDE support.
Built-in security, monitoring, and performance features ensure your APIs are ready for production.
While opinionated about structure, Zenith doesn’t lock you in - use any database, cache, or external service.
Ready to build your next API? Check out our Quick Start Guide or explore the Tutorial for a step-by-step walkthrough.