Skip to content

Artanis Framework

Artanis Framework Logo

A lightweight, minimalist ASGI web framework for Python built with simplicity and performance in mind.

Tests Code Quality Python 3.8+ License

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) and app.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

    Quick Start

  • Learn the Basics


    Follow our comprehensive tutorial to build a complete blog API

    Tutorial

  • API Reference


    Explore the complete API documentation with examples

    API Docs

  • Examples


    See working examples for common patterns and use cases

    Examples

Community & Support

License

Artanis is open source software released under an open source license. Feel free to use, modify, and distribute.