PyEchoNext
EchoNext is a lightweight, fast and scalable web framework for Python
Install / Use
/learn @alexeev-prog/PyEchoNextREADME
🌟 EchoNext: The Future of Web 🚀
<a id="readme-top"></a>
<div align="center"> <p align="center"> EchoNext is a lightweight, fast and scalable web framework for Python <br /> <a href="https://alexeev-prog.github.io/pyEchoNext/"><strong>Explore the docs »</strong></a> <br /> <br /> <a href="#-why-choose-pyechonext">Why Choose pyEchoNext</a> · <a href="#-key-features">Key Features</a> · <a href="#-getting-started">Getting Started</a> · <a href="#-usage-examples">Basic Usage</a> · <a href="#-specifications">Specification</a> · <a href="https://alexeev-prog.github.io/pyEchoNext/">Documentation</a> · <a href="https://github.com/alexeev-prog/pyEchoNext/blob/main/LICENSE">License</a> </p> </div> <br> <p align="center"> <img src="https://img.shields.io/github/languages/top/alexeev-prog/pyEchoNext?style=for-the-badge"> <img src="https://img.shields.io/github/languages/count/alexeev-prog/pyEchoNext?style=for-the-badge"> <img src="https://img.shields.io/github/license/alexeev-prog/pyEchoNext?style=for-the-badge"> <img src="https://img.shields.io/github/stars/alexeev-prog/pyEchoNext?style=for-the-badge"> <img src="https://img.shields.io/github/issues/alexeev-prog/pyEchoNext?style=for-the-badge"> <img src="https://img.shields.io/github/last-commit/alexeev-prog/pyEchoNext?style=for-the-badge"> <img src="https://img.shields.io/pypi/wheel/pyechonext?style=for-the-badge"> <img src="https://img.shields.io/badge/coverage-73%25-73%25?style=for-the-badge" alt="Coverage"> <img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/pyEchoNext?style=for-the-badge"> <img alt="PyPI - Version" src="https://img.shields.io/pypi/v/pyEchoNext?style=for-the-badge"> <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/pyEchoNext?style=for-the-badge"> <img alt="GitHub contributors" src="https://img.shields.io/github/contributors/alexeev-prog/pyEchoNext?style=for-the-badge"> </p> <p align="center"> <img src="https://raw.githubusercontent.com/alexeev-prog/pyEchoNext/refs/heads/main/docs/pallet-0.png"> </p>PyEchoNext is a lightweight, high-performance web framework designed for building scalable Python web applications and APIs. With its modular architecture and focus on developer productivity, it combines Flask-like simplicity with FastAPI-inspired performance features. Built for modern web development challenges.
[!NOTE] Python 3.12+
[!CAUTION] PyEchoNext is currently in active alpha development. While core functionality is stable, some advanced features are still evolving. Production use requires thorough testing.
[!NOTE] Versions below 0.7.14a are not recommended for use with gunicorn <23.0 due to the fact that they used an older version of gunicorn (<23.0), which was vulnerable.
Next big update: 0.8.0 - Hybrid Performance Core: async + multithread + multiprocess
You want see hybrid core before release? See DevGuide Specs for HybridCore.
Check Other My Projects
- SQLSymphony - simple and fast ORM in sqlite (and you can add other DBMS)
- Burn-Build - simple and fast build system written in python for C/C++ and other projects. With multiprocessing, project creation and caches!
- OptiArch - shell script for fast optimization of Arch Linux
- libnumerixpp - a Powerful C++ Library for High-Performance Numerical Computing
- pycolor-palette - display beautiful log messages, logging, debugging.
- shegang - powerful command interpreter (shell) for linux written in C
🤔 Why Choose pyEchoNext?
-
🔥 Featherweight Performance: No bloat, just speed! Our framework is designed to optimize performance, making it a breeze to create and scale your applications without the overhead.
-
💼 Unmatched Scalability: Handle thousands of connections effortlessly! Echonext is built for performance in high-demand environments, making it the perfect choice for startups or enterprise applications.
-
🔧 Customizable Architecture: Tailor your framework to suit your unique needs. Whether it’s middleware, routing, or authentication, make it yours with minimal effort!
-
🌍 Cross-Platform Compatibility: Echonext works beautifully on any OS. Whether you’re developing on Windows, macOS, or Linux, you’re covered!
-
💡 User-Friendly Design: Our intuitive API and comprehensive documentation make it easy for beginners and pros alike. Dive in and start coding right away!
-
📦 Plug-and-Play Components: Easily integrate with third-party libraries to enhance your application. Don’t reinvent the wheel—leverage existing solutions!
-
🔒 Built-in Authentication: Simplify your user authentication process with our built-in, easy-to-implement features.
-
📊 Automatic API Documentation: Create RESTful endpoints that are not just powerful but also well-documented, saving you time and effort.
📚 Key Features
- Intuitive API: Pythonic, object-oriented interface for interacting with routes and views.
- Performance Optimization: Lazy loading, eager loading, and other techniques for efficient web queries.
- Comprehensive Documentation: Detailed usage examples and API reference to help you get started.
- Modular Design: Clean, maintainable codebase that follows best software engineering practices.
- Extensive Test Coverage: Robust test suite to ensure the library's reliability and stability.
graph TD
A[Router] --> B[Middleware]
B --> C[Controllers]
C --> D[Models]
C --> E[Views]
D --> F[Data]
E --> G[Templates]
A --> H[Static Files]
Intelligent Routing System
- Trie-based URL dispatch - O(m) lookup complexity
- Dynamic path parameters - Type-annotated parameter handling
- Nested routers - Modular application organization
# Hierarchical routing example
main_router = Router()
admin_router = Router(prefix="/admin")
@admin_router.route_page("/dashboard")
def admin_dashboard(request, response):
return render_template("admin.html")
main_router.include_router(admin_router)
Security Framework
- Multi-layer protection:
- CSRF tokens with session binding
- XSS double-escaping (content + attributes)
- SQL injection pattern filtering
- Rate limiting (sliding window algorithm)
- Cryptographic modules:
- PSPCAlgorithm for lightweight encryption
- SHA3/BLAKE3 hashing support
- Salted password handling
# Security implementation example
token = Security.generate_csrf_token(session_id)
filtered_query = Security.filter_sql_query("SELECT * FROM users; DROP TABLE users")
⚡ Performance Optimization
- Multi-layer caching:
- LRU in-memory cache
- Performance-optimized memoization
- Static file preloading
- JIT-friendly design:
- Numba-compatible critical paths
- Zero-copy request processing
- Async-ready architecture (in development)
# Performance-cached view
@performance_cached(perf_cache)
def compute_intensive_view():
return calculate_fibonacci(1000)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
⚙️ Functionality
- i18n/l10n localization with hermes-langlib.
- basic project documentation generator
- request/response
- middlewares (with basic session cookie middleware)
- views and routes
- settings and config loader
- built-in template engine and Jinja2
- basic security and hashing
- static files management
- cache response bodies
- performance
- slugger
- permissions
- pyEchoNext Schemas (
pyechonext.schemas) and pydantic support for validating schemas
🚀 Getting Started
pyEchoNext is available on PyPI. Simply install the package into your project environment with PIP:
pip install pyechonext
Once installed, you can start using the library in your Python projects. Check out the documentation for detailed usage examples and API reference.
<p align="right">(<a href="#readme-top">back to top</a>)</p>⚙️ Dependency Injection
pyEchoNext is universal, and you are free to use any Dependency-Injection framework. But we recommend using the specially developed echonextdi. It is simple and fast to use.
Install:
pip install echonextdi
Example code:
from echonextdi.containers.container import Container
from echonextdi.depends import Depends
from echonextdi.providers.callable_provider import CallableProvider
def sqrt(a: int, b: int = 2):
return a**b
class SQRT_Dependency:
def __init__(self, sqrt):
self.sqrt = sqrt
container = Container()
container.register("sqrt", CallableProvider(sqrt))
def calculate(number: int, depend: Depends = Depends(container, SQRT_Dependency)):
print(f"{number} ^2 = {depend().sqrt(2)}")
calculate(4) # Output: 16
💻 Usage Examples
You can view examples at examples directory.
Prefix Tree (Trie)
Prefix Tree data structure (this structure also used in pyechonext routing system)
from pyechonext.utils.trie import PrefixTree
if __name__ == '__main__':
trie = PrefixTree()
trie.insert('apple')
trie.insert('app')
trie.insert('aposematic')
trie.insert('appreciate')
trie.insert('book')
trie.insert('bad')
trie.insert('bear')
trie.insert('bat')
print(trie.starts_with(
