Robyn is a fast async Python web server with a runtime written in Rust.
Check out the talk at PyCon Sweden 2021 about Robyn: An async python web framework with a Rust runtime
You can simply use Pip for installation.
pip install robyn
Or, with conda-forge
conda install -c conda-forge robyn
from robyn import Robyn
app = Robyn(__file__)
@app.get("/")
async def h(request):
return "Hello, world!"
app.start(port=8080)
Robyn is compatible with the following Python versions:
Python >= 3.7
It is recommended to use the latest version of Python for the best performance and compatibility
Please make sure you have the correct version of Python installed before starting to use this project. You can check your Python version by running the following command in your terminal:
python --version
- Under active development!
- Written in Rust, btw xD
- A multithreaded Runtime
- Extensible
- A simple API
- Sync and Async Function Support
- Dynamic URL Routing
- Multi Core Scaling
- WebSockets!
- Middlewares
- Hot Reloading
- Community First and truly FOSS!
Feel free to open an issue for any clarification or for any suggestions.
If you're feeling curious. You can take a look at a more detailed architecture here.
-
Install the development dependencies:
pip install -r dev-requirements.txt
-
Install the pre-commit git hooks:
pre-commit install
-
Add more routes in the
integration_tests/base_routes.py
file (if you like). -
Run
maturin develop
ormaturin develop --cargo-extra-args="--features=io-uring"
(if you want to run the experimental version). -
Run
python3 integration_tests/base_routes.py
python3 app.py -h
usage: app.py [-h] [--processes PROCESSES] [--workers WORKERS] [--dev DEV]
Robyn, a fast async web framework with a rust runtime.
optional arguments:
-h, --help show this help message and exit
--processes PROCESSES : allows you to choose the number of parallel processes
--workers WORKERS : allows you to choose the number of workers
--dev DEV : this flag gives the option to enable hot reloading or not and also sets the default log level to debug
--log-level LEVEL : this flag allows you to set the log level
To contribute to Robyn, make sure to first go through the CONTRIBUTING.md.
Thanks to all the contributors of the project. Robyn will not be what it is without all your support ❤️.
Special thanks to the PyO3 community and Andrew from PyO3-asyncio for their amazing libraries and their support for my queries. 💖
These sponsors help us make the magic happen!