https://github.com/dvnghiem/hypern
Hypern is an open-source framework designed to accelerate high-performance web development. Its flexible architecture and robust features empower developers to easily build scalable APIs, microservices, and full-stack applications.
https://github.com/dvnghiem/hypern
async axum backend framework python rust web
Last synced: 9 months ago
JSON representation
Hypern is an open-source framework designed to accelerate high-performance web development. Its flexible architecture and robust features empower developers to easily build scalable APIs, microservices, and full-stack applications.
- Host: GitHub
- URL: https://github.com/dvnghiem/hypern
- Owner: DVNghiem
- License: bsd-2-clause
- Created: 2024-04-03T14:17:46.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-03T05:54:56.000Z (10 months ago)
- Last Synced: 2025-06-03T12:40:22.324Z (10 months ago)
- Topics: async, axum, backend, framework, python, rust, web
- Language: Python
- Homepage:
- Size: 936 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Hypern
Hypern: A Versatile Python and Rust Framework
Hypern is a flexible, open-source framework built on the [Rust](https://github.com/rust-lang/rust), designed to jumpstart your high-performance web development endeavors. By providing a pre-configured structure and essential components, Hypern empowers you to rapidly develop custom web applications that leverage the combined power of Python and Rust.
With Hypern, you can seamlessly integrate asynchronous features and build scalable solutions for RESTful APIs and dynamic web applications. Its intuitive design and robust tooling allow developers to focus on creating high-quality code while maximizing performance. Embrace the synergy of Python and Rust to elevate your web development experience.
### 🏁 Get started
### ⚙️ To Develop Locally
- Setup a virtual environment:
```
python3 -m venv venv
source venv/bin/activate
```
- Install required packages
```
pip install pre-commit poetry maturin
```
- Install development dependencies
```
poetry install --with dev --with test
```
- Install pre-commit git hooks
```
pre-commit install
```
- Build & install Rust package
```
maturin develop
```
## 🤔 Usage
### 🏃 Run your code
You will then have access to a server on the `localhost:5005`,
```python
# main.py
from hypern import Hypern
from hypern.routing import Route, HTTPEndpoint
class MyEndpoint(HTTPEndpoint):
async def get(self, request):
return {"data": "Hello World"}
routing = [
Route("/hello", MyEndpoint)
]
app = Hypern(routing)
if __name__ == "__main__":
app.start()
```
```
$ python3 main.py
```
You can open swagger UI at path `/docs`
## CLI
- host (str): The host address to bind to. Defaults to '127.0.0.1'.
- port (int): The port number to bind to. Defaults to 5000.
- processes (int): The number of processes to use. Defaults to 1.
- workers (int): The number of worker threads to use. Defaults to 1.
- max_blocking_threads (int): The maximum number of blocking threads. Defaults to 32.
- reload (bool): If True, the server will restart on file changes.
- auto_workers (bool): If True, sets the number of workers and max-blocking-threads automatically.
## 💡 Features
### ⚡ High Performance
- Rust-powered core with Python flexibility
- Multi-process architecture for optimal CPU utilization
- Async/await support for non-blocking operations
- Built on top of production-ready Rust language
### 🛠 Development Experience
- Type hints and IDE support
- Built-in Swagger/OpenAPI documentation
- Hot reload during development
- Comprehensive error handling and logging
### 🔌 Integration & Extensions
- Easy dependency injection
- Middleware support (before/after request hooks)
- WebSocket support
- Background task scheduling
- File upload handling
### 🔒 Security
- Built-in authentication/authorization (Comming soon)
- CORS configuration
- Rate limiting
- Request validation