Artanis Framework¶

A lightweight, minimalist ASGI web framework for Python built with simplicity and performance in mind.
Artanis provides a clean, intuitive API for building modern web applications and APIs using named routes and a powerful middleware system.
โจ Key Features¶
- Named Routes: Clean
app.get(path, handler)
andapp.post(path, handler)
syntax - Zero Dependencies: Uses only Python standard library for maximum compatibility
- ASGI Compliant: Works with Uvicorn, Hypercorn, and other ASGI servers
- Type Safe: Full type annotation support with mypy compatibility
- Path Parameters: Dynamic segments like
/users/{user_id}
- Multiple HTTP Methods: GET, POST, PUT, DELETE, PATCH, OPTIONS on the same path
- Subrouting: Mount routers at specific paths for modular applications
- Parameterized Mounts: Dynamic subrouter mounting at paths like
/users/{user_id}
- Express-Style: Intuitive
app.use()
API for middleware - Path-Based: Apply middleware to specific routes or paths
- Security Built-in: CORS, CSP, HSTS, rate limiting, security headers
- Request Logging: Structured logging with automatic request tracking
- Extensible Events: Custom business events with priority execution
- ASGI Lifecycle: Automatic startup and shutdown event handling
- Event Middleware: Cross-cutting concerns for all events
- Conditional Handlers: Execute only when specific conditions are met
Quick Example¶
from artanis import App
app = App()
# Simple route
async def hello():
return {"message": "Hello, World!"}
app.get("/", hello)
# Route with path parameter
async def get_user(user_id):
return {"user_id": user_id, "name": f"User {user_id}"}
app.get("/users/{user_id}", get_user)
# POST route with request body
async def create_user(request):
data = await request.json()
return {"message": "User created", "data": data}
app.post("/users", create_user)
Why Choose Artanis?¶
Perfect for Modern Python Development
- ๐ Python 3.8+: Built for modern Python with async/await support
- ๐ฆ Zero Dependencies: No external runtime dependencies to manage
- ๐ Security First: Comprehensive security middleware included
- ๐ Excellent Documentation: Detailed guides, tutorials, and API reference
- ๐งช Well Tested: 191+ comprehensive tests ensuring reliability
What's Next?¶
-
Get Started
Install Artanis and build your first application in minutes
-
Learn the Basics
Follow our comprehensive tutorial to build a complete blog API
-
API Reference
Explore the complete API documentation with examples
-
Examples
See working examples for common patterns and use cases
Community & Support¶
- GitHub Repository: nordxai/Artanis
- Issues & Bug Reports: GitHub Issues
- Discussions: GitHub Discussions
- PyPI Package: artanis
License¶
Artanis is open source software released under an open source license. Feel free to use, modify, and distribute.