Expanse
A modern, asynchronous-ready Python web framework designed for developer experience, featuring powerful dependency injection, seamless SQLAlchemy integration, and native support for modern web standards.
Expanse is a modern, elegant, and asynchronous-ready Python web framework designed with a primary focus on developer experience. It provides a robust set of intuitive tools that help developers build high-performance, scalable web applications efficiently. By prioritizing clear architecture and powerful abstractions, Expanse aims to stay out of the developer's way while offering deep capabilities for complex requirements. The framework supports both synchronous and asynchronous implementations for its components, giving developers the flexibility to choose the approach that best fits their project needs without sacrificing performance or maintainability.
At the core of the framework is a powerful service container that facilitates automatic dependency injection. This system orchestrates every service your application needs, allowing for clean code and modular design. Expanse offers seamless integration with SQLAlchemy for database management, supporting SQLite, PostgreSQL, and MySQL natively. It includes advanced features such as route definition via functions or decorators, composable views powered by Jinja2, native data validation, and built-in security utilities like encrypted cookies and CSRF protection.
Some of the key features are:
- Dependency Injection: A powerful system that resolves and injects dependencies automatically into route functions and controller constructors.
- Flexible Database Management: Seamless integration with SQLAlchemy supporting raw queries, ORM models, migrations, and multiple database connections.
- Intuitive Routing: Define routes using simple function declarations or decorators with support for parameters, regex validation, and named routes.
- Composable Views: Native integration with the Jinja2 templating engine for powerful and flexible information display.
- Native Data Validation: Easily validate form data, JSON payloads, or query parameters using model-based validation.
- Security Built-in: Includes native support for encryption and CSRF protection right out of the box.
- Middleware Support: An intuitive middleware system that works seamlessly with the framework's dependency injection capabilities.
- Powerful CLI: Includes the Beam command-line tool for tasks such as migration management, controller generation, and server administration.
Developers interact with Expanse primarily through standard Python structures, leveraging type-hinting to enable the framework's automatic injection features. The project provides an official CLI for scaffolding new applications and managing the development lifecycle. When defining routes, users can choose between simple function handlers or structured controller classes. Database interactions are handled through the database manager or via direct injection of connections, with the framework handling resource management such as connection closing automatically.
Some common use cases include:
- RESTful API Development: Building high-performance, validated JSON APIs with ease using typed models.
- Standard Web Applications: Creating full-stack web platforms with Jinja2-rendered views and robust database integration.
- Microservices: Leveraging the framework's modular dependency injection and performance-oriented design to build efficient microservices.
- Data-Driven Dashboards: Quickly connecting to multiple databases to aggregate and display information through secure, encrypted interfaces.
Comments
0Markdown is supported.