waku¶
waku [ๆ or ใใ] means framework in Japanese.
Overview¶
waku
is a modern Python framework designed for building scalable, maintainable applications with a focus on clean architecture and developer experience. It's particularly well-suited for:
- Enterprise applications requiring clear boundaries and maintainability
- Microservices architectures needing consistent patterns
- Teams looking for standardized approaches to common problems
- Projects that value testability and loose coupling
The framework draws inspiration from NestJS and Tramvai,
adapting their best ideas to the Python ecosystem. Here's list of some waku
key features:
- ๐งฉ Modularity: Build applications as a set of loosely coupled modules with clear boundaries, automatic dependency validation, and controlled visibility
- ๐ Powerful Dependency Injection System: Manage dependencies with built-in DI framework-agnostic IoC-container, multiple lifetime scopes, and automatic resolution
- ๐ง Extensions: Extend
waku
with custom plugins that can hook into application lifecycle, add new providers, and integrate with external systems - ๐ Lifespan: Automatic manage application and IoC-container lifecycle with built-in hooks and event system
- โ๏ธ Command/Query handling (CQRS): Use mediator abstraction heavily inspired by C# MediatR library to handle commands, queries, and events
- ๐ค Integrations:
waku
comes with built-in integrations for popular web frameworks like FastAPI or Litestar and allows you to easily create your own integrations with any other frameworks
Motivation¶
While Python offers excellent web frameworks, they often lack robust architectural patterns for building complex applications. The challenge of managing dependencies and maintaining clean boundaries between components becomes increasingly difficult as applications grow.
waku
addresses these challenges through its core concepts:
๐งฉ Modular Architecture¶
Break down complex applications into self-contained modules with clear boundaries and responsibilities. Each module encapsulates its own providers, making the codebase more maintainable and easier to understand.
๐ Dependency Injection¶
Manage dependencies explicitly through a powerful DI system that supports different lifetime scopes (singleton, scoped, transient). This enables:
- ๐ Loose coupling between components
- ๐งช Easier testing through dependency substitution
- ๐ Clear dependency graphs
- โก Automatic lifecycle management
- ๐ ๏ธ Framework-agnostic dependency resolution
By combining these concepts, waku
provides a structured approach to building Python applications that scales from small services to large enterprise systems.
Quick Start¶
Prerequisites¶
- Python 3.11 or higher
- Basic understanding of dependency injection and modular architecture
- Familiarity with async/await syntax
Installation¶
Install the waku
package using your preferred tool.
We recommend uv
for managing project dependencies due to its speed and simplicity.
You also need to install some additional dependencies for the DI system to work.
You can explore all available providers in our documentation.
Basic Example¶
For our example we stick with aioinject as DI provider.
Install it directly using your preferred package manager or as extra dependency of waku
:
For explanations of the code above and more realistic examples, see the Getting Started guide.
Documentation¶
Explore detailed documentation on our official site.
Key topics include:
Contributing¶
We'd love your contributions! Check out our Contributing Guide to get started.
Development Setup¶
Learn how to set up a development environment in the Contributing Guide.