A Fast Async Python backend with a Rust runtime.
Project description
Hypern
Hypern: A Versatile Python and Rust Framework
Hypern is a flexible, open-source framework built on the Robyn, 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 Robyn Rust package
maturin develop
🤔 Usage
🏃 Run your code
This using default CLI Robyn, you can see bellow. You will then have access to a server on the localhost:5005
,
# main.py
from hypern import Hypern
from hypern.routing import Route, HTTPEndpoint
class MyEndpoint(HTTPEndpoint):
async def get(self, global_dependencies):
return {"data": "Hello World"}
routing = [
Route("/hello", MyEndpoint)
]
app = Hypern(routing)
if __name__ == "__main__":
app.start(host='localhost', port=5005)
$ python3 main.py
To see the usage
usage: main.py [-h] [--processes PROCESSES] [--workers WORKERS] [--dev] [--log-level LOG_LEVEL]
options:
-h, --help show this help message and exit
--processes PROCESSES Choose the number of processes. [Default: 1]
--workers WORKERS Choose the number of workers. [Default: 1]
--dev Development mode. It restarts the server based on file changes.
--log-level LOG_LEVEL Set the log level name
--create Create a new project template.
--docs Open the Robyn documentation.
--open-browser Open the browser on successful start.
Log level can be DEBUG
, INFO
, WARNING
, or ERROR
.
You can open swagger UI at path /docs
💡 Features
Comming Soon !
✨ Special thanks
Special thanks to the PyO3 community and Robyn for their amazing libraries 💖
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hypern-0.1.1.tar.gz
.
File metadata
- Download URL: hypern-0.1.1.tar.gz
- Upload date:
- Size: 110.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d2972bbf4d971118d6acadff491b2a3ec3a6320cb63b8d05613a91621517dac |
|
MD5 | 2516738e26db95f67e67f7ec892a0949 |
|
BLAKE2b-256 | 75a82243271398b48a142af261081081a7831a5a3ec889bbb3dfcd83a48674df |
File details
Details for the file hypern-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl
.
File metadata
- Download URL: hypern-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a4a737857c335d582a66f3bdf55988143ff95ba842c04aa8109bf4b02db9253 |
|
MD5 | 68ae5f49feb64a96bdea99cb5769caf3 |
|
BLAKE2b-256 | 43c0e09df9ceb18fda9fb0baafa8f0227b1a4346aadb220781917cadf9ec63d4 |