Welcome to Tatami! πŸŽ‹ΒΆ

Tatami is a modern Python web framework built on Starlette that makes building APIs a joy. With class-based routers, automatic dependency injection, and convention-based project structure, you can focus on what matters: your business logic.

Important

πŸ“ Documentation Notice: This documentation has been generated by Claude Sonnet 4 (AI) and is currently under human review. While the content aims to be accurate and helpful, there may be errors or inconsistencies.

I (the maintainer) am carefully reviewing all pages, but since documenting code is what most developers are lazy about πŸ˜…, this process will take some time.

Found an error? Please report it via GitHub Issues or submit a PR - your contributions are very welcome! πŸ™

Like traditional Japanese tatami mats that create order and harmony in a room, Tatami helps you structure your web applications with clean, modular design patterns.

Why Choose Tatami? 🌟¢

  • ✨ Clean & Organized: Class-based routers keep your code tidy and maintainable

  • πŸš€ Fast Development: CLI tools get you up and running in seconds

  • πŸ“š Auto Documentation: OpenAPI/Swagger docs generated automatically

  • 🧩 Modular Design: Separation of concerns through clear project structure

  • πŸ”§ Developer Experience: Great IDE support with type hints and autocomplete

  • ⚑ Convention over Configuration: Smart defaults, but you’re always in control

Important

🚧 Early Stage: Tatami is experimental and evolving rapidly. Perfect for new projects and learning, but check back regularly for updates!

Quick Taste πŸ‘¨β€πŸ³ΒΆ

Here’s what a simple Tatami API looks like:

# routers/users.py
from tatami import router, get, post
from pydantic import BaseModel

class User(BaseModel):
    name: str
    email: str

class Users(router('/users')):
    @get('/{user_id}')
    def get_user(self, user_id: int):
        return {"id": user_id, "name": "Alice"}

    @post('/')
    def create_user(self, user: User):
        return {"message": f"Created {user.name}"}

Run it with:

tatami run myproject

And you get automatic API docs at /docs/ (landing page) and /docs/swagger (interactive UI) plus a clean, testable codebase!

Philosophy: Explicit Routes, Smart Structure 🧠¢

Tatami believes in explicit routing (clear, obvious API definitions) combined with smart conventions (automatic discovery of services, middleware, and static files).

This means: - Your API routes are crystal clear and IDE-friendly - Your project structure follows sensible conventions - Less boilerplate, more focus on business logic - Easy to understand for new team members

Advanced Topics

Need Help? 🀝¢