Catzilla Documentationο

The fastest Python web framework with C-accelerated routing and async/sync hybrid support
Catzilla is a modern Python web framework that delivers exceptional performance through its C-accelerated routing engine powered by libuv. Built for developers who demand both speed and simplicity.
π Key Featuresο
ποΈ C-Accelerated Routing - Ultra-fast trie-based routing with O(log n) performance
β‘ Async/Sync Hybrid - Seamlessly mix async and sync handlers with automatic detection
π¦ Zero-Copy Operations - Memory-efficient request handling with minimal allocations
π Auto-Validation - Pydantic-compatible models with C-accelerated validation
π Advanced DI System - Powerful dependency injection with multiple scopes
ποΈ Multi-Layer Caching - Memory, Redis, and disk caching with intelligent fallbacks
π‘ Streaming Support - Server-sent events and chunked responses
π File Handling - Optimized upload/download with image processing
π§ Background Tasks - Async task scheduling and monitoring
π‘οΈ Production Ready - Built-in security, monitoring, and error handling
Quick Startο
Installationο
pip install catzilla
Hello Worldο
from catzilla import Catzilla, JSONResponse
app = Catzilla()
@app.get("/")
def home(request):
return JSONResponse({"message": "Hello, World!"})
if __name__ == "__main__":
app.listen(port=8000)
Async/Sync Hybrid Exampleο
from catzilla import Catzilla, JSONResponse, BaseModel
import asyncio
app = Catzilla()
# Sync handler (runs in thread pool)
@app.get("/sync")
def sync_handler(request):
return JSONResponse({"type": "sync"})
# Async handler (runs in event loop)
@app.get("/async")
async def async_handler(request):
await asyncio.sleep(0.1) # Non-blocking I/O
return JSONResponse({"type": "async"})
class User(BaseModel):
name: str
email: str
# Auto-validation with BaseModel
@app.post("/users")
def create_user(request, user: User):
return JSONResponse({
"user": {
"name": user.name,
"email": user.email
}
})
if __name__ == "__main__":
app.listen(port=8000)
Documentation Structureο
Getting Started
Core Concepts
Features
Examples
- Basic Routing Examples
- Hello World
- Async/Sync Hybrid Example
- URL Parameters with Auto-Validation
- Query Parameters with Auto-Validation
- Request Body Validation with BaseModel
- HTTP Methods
- Header and Form Validation
- Advanced Routing Patterns
- Error Handling Examples
- Complete CRUD Example with Router Groups
- Performance Comparison Example
- Testing Your Catzilla Routes
- Summary
- Key Features Demonstrated
- Next Steps
- Whatβs Next?
Community & Supportο
π Documentation: This comprehensive guide
π Issues: GitHub Issues
π¬ Discussions: GitHub Discussions
π Releases: GitHub Releases
Licenseο
Catzilla is released under the MIT License. See the LICENSE file for details.
Why Choose Catzilla?ο
πββοΈ Migrate from FastAPI in Minutes
Catzillaβs API is designed for seamless FastAPI migration:
# FastAPI code works with minimal changes
from catzilla import Catzilla, BaseModel, JSONResponse # Just change the import
app = Catzilla() # Instead of FastAPI()
# Everything else works the same!
π Get Exceptional Performance Instantly
No code changes needed - just install Catzilla and watch your API fly!
π§ Production-Grade Features Out of the Box
Built-in caching
Background task processing
Advanced dependency injection
File upload handling
Streaming responses
Authentication patterns
Performance monitoring
Ready to supercharge your Python API? Letβs get started! π