A Super Fast Async Python Web Framework with a Rust runtime.
Project description
Robyn
Robyn is a High-Performance, Community-Driven, and Innovator Friendly Web Framework with a Rust runtime. You can learn more by checking our community resources!
Source: TechEmpower Round 22
📦 Installation
You can simply use Pip for installation.
pip install robyn
Or, with conda-forge
conda install -c conda-forge robyn
🤔 Usage
🚀 Define your API
To define your API, you can add the following code in an app.py
file.
from robyn import Robyn
app = Robyn(__file__)
@app.get("/")
async def h(request):
return "Hello, world!"
app.start(port=8080)
🏃 Run your code
Simply run the app.py file you created. You will then have access to a server on the localhost:8080
, that you can request from an other program. Robyn provides several options to customize your web server.
$ python3 app.py
To see the usage
usage: app.py [-h] [--processes PROCESSES] [--workers WORKERS] [--dev] [--log-level LOG_LEVEL]
Robyn, a fast async web framework with a rust runtime.
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.
--version Show the Robyn version.
--compile-rust-path COMPILE_RUST_PATH
Compile rust files in the given path.
--create-rust-file CREATE_RUST_FILE
Create a rust file with the given name.
--disable-openapi Disable the OpenAPI documentation.
--fast Enable the fast mode.
Log level can be DEBUG
, INFO
, WARNING
, or ERROR
.
When running the app using --open-browser
a new browser window will open at the app location, e.g:
$ python3 app.py --open-browser
💻 Add more routes
You can add more routes to your API. Check out the routes in this file as examples.
🐍 Python Version Support
Robyn is compatible with the following Python versions:
Python >= 3.8
It is recommended to use the latest version of Python for the best performances.
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
💡 Features
- 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
- Built in form data handling
- Dependency Injection
- Hot Reloading
- Direct Rust Integration
- Community First and truly FOSS!
🗒️ How to contribute
🏁 Get started
Please read the code of conduct and go through CONTRIBUTING.md before contributing to Robyn. Feel free to open an issue for any clarifications or suggestions.
If you're feeling curious. You can take a look at a more detailed architecture here.
If you still need help to get started, feel free to reach out on our community discord.
⚙️ 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
- Build & install Robyn Rust package (experimental)
maturin develop --cargo-extra-args="--features=io-uring"
- Run!
poetry run test_server
- Run tests
pytest integration_tests
- Test (refer to
integration_tests/base_routes.py
for more endpoints)
curl http://localhost:8080/sync/str
- tip: One liners for testing changes!
maturin develop && poetry run test_server
maturin develop && pytest integration_tests
- Potential errors
- install
patchelf
withpip install patchelf
if you facepatchelf
not found issue duringmaturin develop
(esp. on Arch Linux)
- install
✨ Special thanks
✨ Contributors/Supporters
Thanks to all the contributors of the project. Robyn will not be what it is without all your support :heart:.
Special thanks to the PyO3 community and Andrew from PyO3-asyncio for their amazing libraries and their support for my queries. 💖
✨ Sponsors
These sponsors help us make the magic happen!
Star History
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for robyn-0.60.2-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b30c784a8cb41937e0b7de7849ddd6a33ce37dcb5c2625f5874f1a1e128b3bd |
|
MD5 | 31886090b03c18710a4013ee8f41eea9 |
|
BLAKE2b-256 | cc4a8b8503fbc34ac18dae8b2a5a9f3b2427e6766d8884c2ef96092f714cbfbe |
Hashes for robyn-0.60.2-cp312-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78e19ee59ee9efe527899c731aa4bb124c1823ae993e8677458467c34f7e3047 |
|
MD5 | cd06931e2ea9cfefa304630d209a1670 |
|
BLAKE2b-256 | cb5ed6c44c8305549c819c5699698989e41e9676be5af2989155a149a9a523a8 |
Hashes for robyn-0.60.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 798ed8ae08c06ad54f331889f0a11962f0f86e3d73b71f542d693dad63a02e4f |
|
MD5 | 6b4047a63f50893fcbc97d982b16c392 |
|
BLAKE2b-256 | f17c2975346ebc3ec19e8a1a0aabcfef18113297abbd5fbadae7e74e5565a184 |
Hashes for robyn-0.60.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13bf6c0742fe4bc5cc84ef8b0878542ea707f2e6fd69b2cbf192c2a9311cef48 |
|
MD5 | 11ac9e8955ac9db213f611a6af5ddd18 |
|
BLAKE2b-256 | 78548bb97adc179eb510ba6a9ddba32b96f9d5109915d5f9795cfda45330a155 |
Hashes for robyn-0.60.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 328df8f0bc149e0876021bec3d4a3ff1097ba27e9fed7d0a87138b52c75fc552 |
|
MD5 | 340360ab618acf7ab2373f974a5042c5 |
|
BLAKE2b-256 | 6acd32ee6fad8a796e1d16366c8ddcf6ca2f190040d0ab66d8c5ee867e249870 |
Hashes for robyn-0.60.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee23530bffc78a63fa0ab92232ec1d36513362a359eeb61fc66812836ee26d7a |
|
MD5 | 3b130ea664d3f88795526c894f46f412 |
|
BLAKE2b-256 | 5580353218ec42817d6612bda007ce0c75ea369295ccdebdbdc87f36c03bba11 |
Hashes for robyn-0.60.2-cp312-cp312-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e7c5b70fb2f9e3bb83e34be2c32d7386a47594e37a941b04061f164dd60183b |
|
MD5 | 5d1e336108af6f69d4dee5b5b7892249 |
|
BLAKE2b-256 | 747ffa225104ac2c4a17f6ee8abacadca910d7660b833dfd5fa99d32d0f7ef33 |
Hashes for robyn-0.60.2-cp312-cp312-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 480fed91c78abe3fc43fd683e466a49dd2bd8c86276c5d3adf0ef69fbaf0bc24 |
|
MD5 | b932ba261062fb7065b3833b7966108c |
|
BLAKE2b-256 | e8deba3a2ae0564280782ca3bcf907925922869ff95b951bd8963ced90b45b7e |
Hashes for robyn-0.60.2-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbf40b304d49a954fb1051a79aa721e42f07c6b5231ec205fd207f78e11d249f |
|
MD5 | fffc31e04913d5faf723555662e17cf2 |
|
BLAKE2b-256 | e5b3bdba03e95da6fc7b6e92c6d4293e5a1fd59c25fa66bb6ef9edf94a9b5a2e |
Hashes for robyn-0.60.2-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 191e8ca1f67298cd9961b1be01ef2772e61030e2e3b24f72da8b34d2d4c0d211 |
|
MD5 | baa67a72d30753435c1791374c94a664 |
|
BLAKE2b-256 | 77e268691a04ae63017df54e481f0e96c46370aa28019fedc44a764a0fce8aa8 |
Hashes for robyn-0.60.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | defba43f3282dc4dcd94af45b4853cb36b9dccad70b9fc6a34a8b1e69083e7bc |
|
MD5 | 54fcf25f27cf9523c096950dcfc6339c |
|
BLAKE2b-256 | c25823831349e8973e1e6599e9fd3d35dbadd9e730fd9a11e0634bec3427af2f |
Hashes for robyn-0.60.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 205f4cefa3b0625b40464964f2226a4abf4eeb785385ddf4322e31000805733d |
|
MD5 | e6889f4c6152225a14ccb5357884b572 |
|
BLAKE2b-256 | a65376d75e7c3f0b5de13ff3f54b989a3a6d122435f7b1dafb6c3beb4c35b532 |
Hashes for robyn-0.60.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec04e8b139d237b599b26a61c3fb884b54d78dab234f38a76675ba7d557e3de0 |
|
MD5 | a55c1224f85d5e206268c06640dd9bc7 |
|
BLAKE2b-256 | 2b0f8b74820c574f49027947d2f1b7b100895a1f2187a498c2b905ee2adc330b |
Hashes for robyn-0.60.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9577cb2eeab92c86be4fc2936c2dc0fb2d3c8459c03aed7b87a11825614379b |
|
MD5 | 3ce466fa7eec94067736c08a99faae61 |
|
BLAKE2b-256 | 78b24d186c64dc26e164c48c45adf7ca6684b2cc270725447532cba16553c30e |
Hashes for robyn-0.60.2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4c45d8cda4be89231803a0b0bc3b48c026c01228ef82e55bb46accfdb130833 |
|
MD5 | a014257d7fd838f1b997ef63f73f93a2 |
|
BLAKE2b-256 | 4c2402da9d667c573f73f5c8563e531681da42a95e8826febb5c5773239261f8 |
Hashes for robyn-0.60.2-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfd24ecc6be51b84adf23c6d665aeb7a02f1a19ecb806fb05bdfa697c4c7d7d3 |
|
MD5 | 6082798ec1026471e5e4510a957c374d |
|
BLAKE2b-256 | 1240712fe6a09a1397ab45c4e158bac04eb6997d870ddb3c49a43d24224fe00a |
Hashes for robyn-0.60.2-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73352965bdbd70cf43d15c5be3277baccf5cb947b31ba95112a8e859b42c05b5 |
|
MD5 | b585ae38755590e84f7f303371657b23 |
|
BLAKE2b-256 | 3c13c46f2a77d6a03349cfeee2afef3f768f353d1fa05b50d246f92466fbe5a3 |
Hashes for robyn-0.60.2-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b276e5ebd46fd8f27d9ecfae3704513c1591121125283a5c968d13db328782dd |
|
MD5 | 770d5b6465ac5fc6f8ddf346573e8a08 |
|
BLAKE2b-256 | d7240a78a58d1c1b738072d651989940c11f46f4f1a92d2518c9257024fb1fe3 |
Hashes for robyn-0.60.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ea3dc47e43f1a4863361fb5fa222697bafb193909d00b095a136a8ba8a1c811 |
|
MD5 | 19aec0e2fd843e61cbb7517b3bad3a93 |
|
BLAKE2b-256 | f3e28cdafa32dccb09bc8fa32cbda312d33fc5b272f91a415f2b7b25a4b8b4ce |
Hashes for robyn-0.60.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7901892771d95556ab7d6aa2f0b111bc8374433a7119dd56a89e1b3b016db3b5 |
|
MD5 | 89b9852a87839a9693ab44c26e70522c |
|
BLAKE2b-256 | 25ec590eae0659abb3fc3ffa1e8c7c73d84c81102688bdc8a1e3302ad426649a |
Hashes for robyn-0.60.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7db167de9c096c856d31a5451eb1159835b8d4da531c3358b373a824019c59f1 |
|
MD5 | 3404736aab970900e04a1a772ed5cda6 |
|
BLAKE2b-256 | de725126577551d00600971b0e046768f72f7bae4bf2655c457a33007ec47ba0 |
Hashes for robyn-0.60.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b851943945a891d85cf83e5dc7de1c7864b063afc19a57cc7f9ddb4b4d19d1a0 |
|
MD5 | 371552ab01ecafecb8734c506098083f |
|
BLAKE2b-256 | 3f1fcae70e3b658fba6d89d1c05fe205e0451ceb5300ae2cd08b28fe7fb0de26 |
Hashes for robyn-0.60.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8c3476cd506b108891332d5d5552129adc1e9bd2fb8ffd66a870ca78f7b2f1 |
|
MD5 | b09f1056a80dd93735645bf70ad3ff4c |
|
BLAKE2b-256 | c6c1302303fa71ce8e39027d13cdbdc3e4a928939f06e6077dc0733f69a88ecf |
Hashes for robyn-0.60.2-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f93cab2c3808b18256d8ee979077831e06b46cf6de9478a91465ba1601efa68 |
|
MD5 | 4eb3fc7a765e87592c215539deb009f2 |
|
BLAKE2b-256 | 45f8bceea071fc85d9bccdc4a5ec78cc7589b9410abf2165c7db660301401886 |
Hashes for robyn-0.60.2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1979e31fbc7c944f50242dfa23146671907cbef4b88ee80275fe14b6720f1e3c |
|
MD5 | 98e14ff9eea26d7135f9535d133fae79 |
|
BLAKE2b-256 | e32356a8e284035cf33f4dac86a73c41c9063eddbc615b3e00dc5aac73012186 |
Hashes for robyn-0.60.2-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5213808cbc08e300cab9ad3b0388435552dae2d412d95ceecf808a1055873761 |
|
MD5 | 7e48f6564a8c7cc0bfd0a74f4d0d0031 |
|
BLAKE2b-256 | 6b45d980f2f3beaf07d62c42d58f0af47e54fb3588157c2f4a7dcf5f3b96c5ec |
Hashes for robyn-0.60.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 822b10a6de8b6d3948237f0c00080a839a8c90eb5ca52a78c2a46adae9e51fe2 |
|
MD5 | ef3117f31a5862886c07e9ad61a8cadd |
|
BLAKE2b-256 | 26877b781c12aa195b2b5a1f28145f2550f6e4757d0150b1efd7ef016a78cf5d |
Hashes for robyn-0.60.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5456c8c3e05f8c3aac6d0b8ccd9376785636be31f5899c9686fd3d7329bf808a |
|
MD5 | 4c51d34114bdee792c1f764d6149037b |
|
BLAKE2b-256 | e908ef52434e75b172379f17ae39b21a271722c42c956da5e8db43fd63bd51e1 |
Hashes for robyn-0.60.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b840445cbe695038873345a90e2a7de3f4d723f7c8e0c76d6662b0b77c984d3 |
|
MD5 | 090355f90caed86fef8d2c2048e036c6 |
|
BLAKE2b-256 | 4145c94d0f2ab61589778296e73d4a6b19f6fdd68a475a48df4f6cd34bf575b3 |
Hashes for robyn-0.60.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3117af6a56934937772bb25ef6d137c0722fa45de9c2bef8b8d6e1487fed6e27 |
|
MD5 | 9287e9b0ba162ecfbd278d2ed3979c1d |
|
BLAKE2b-256 | 459304be05afb2988c3aa67b992fc21c5ba9808db555038a312db858942d2cee |
Hashes for robyn-0.60.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa929c5d45d6456e8f638293fa9a340fc9c96f44db6f6864979f77e4298431e6 |
|
MD5 | fd58ac099eb0a51f01ac0b5ed257b46c |
|
BLAKE2b-256 | 8f0e8bfa735c2723443e1c2ca255a4b71921a2f2c7f27a8ec3ecfdd7d96be43c |
Hashes for robyn-0.60.2-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1d42d025e702670e23cf4abeeb5445e6a38ea6c37764cbb75935b076212d3fd |
|
MD5 | 9d93e909b7ea226efee36f507af6fbe9 |
|
BLAKE2b-256 | 94530f8146378a85dd8087722a03bcbb4c1e3dac7fb2af5a5a04be8ef64398ef |
Hashes for robyn-0.60.2-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4cb8a560ce880bba65747193ab702bec69bdf32a2f81a5ff10aa7e1701331f1 |
|
MD5 | ce829567cbb08db3316c1340a8d065f4 |
|
BLAKE2b-256 | 0dec09e5b9cab7d3cacf1c3023e4cb34107fdc9524bdd45bf3b93cec7aff4c67 |
Hashes for robyn-0.60.2-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27cd76df17fb82a3c9fe23032bb2a608b83bccd6d5cfb75dd70544fb27fb90ba |
|
MD5 | e597f8611e62e6eb39331d38bfab8fed |
|
BLAKE2b-256 | 8fc8ae4f4c3c4f80fdcac4700c8d4922a97744863dd2feac8f03cb59888224f7 |
Hashes for robyn-0.60.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2186a30ca6c8394f6f93d5f5652afefa3aadcedfaa55a970187249ed01c0c396 |
|
MD5 | 31e8019443bdb65f36458c7d04810e93 |
|
BLAKE2b-256 | c5d3e6f8074ff2aa32ac96d712bfb136a4f642f59a058bc9a55fa9170cac2056 |
Hashes for robyn-0.60.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3e70de21436ffb95da8e021546c9479625d2f2af2e7df19039109e61e80f298 |
|
MD5 | 5376cc2a99ae3c21bb3c53443bab94fb |
|
BLAKE2b-256 | b6115044b0c5ebce8d50f12cec2169c9135e1b91f7fa2bfd1d01a0fb443140cc |
Hashes for robyn-0.60.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fa721f25a6a64472ccacb86bf4ef00e10a57a903bff5ba16101d80f849f344f |
|
MD5 | 9a595f28a47dae925ff4c55dbc183cc6 |
|
BLAKE2b-256 | d363a047115cc26a2ea0cc82a28e97533620be8c1768aaf1d20c3ae6ab342d20 |
Hashes for robyn-0.60.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fcf64ed201ccd2a6f3936bdafc3a1fd148be235661c19bf49720cd2edc75917 |
|
MD5 | 4cfc7fe3ff51ab5d636d21133b722180 |
|
BLAKE2b-256 | 56cc71f860bd4f8e9764b18861f9be0c295f3c6d1c10f8909db20927be8159b9 |
Hashes for robyn-0.60.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b7da61ac3d4c164c3f48bd9057535d0b0551636908aa90b46f433313a8da3ae |
|
MD5 | 58284b71f1278f39a05d3a834c7c81de |
|
BLAKE2b-256 | 086e60046c0c90fb65bd1cd4c879a7159d9c041c553b3c5222afeab912327f82 |
Hashes for robyn-0.60.2-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a123e28180ed0218f95b83b894a1759be80889f1968a5daa00ab3bdbd924e7db |
|
MD5 | 2d8d69f9125d27759fbd5f5e3998083e |
|
BLAKE2b-256 | 779a8632d846b746569c4d64361beb4a3fa18f5cc0ef4f415e4fb72ef3aef859 |