You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Robyn is a fast async Python web server with a runtime written in Rust.
17
-
18
-
Check out the talk at **PyCon Sweden 2021** about [Robyn: An async python web framework with a Rust runtime](https://www.youtube.com/watch?v=DK9teAs72Do)
14
+
Robyn is a fast async Python web framework coupled with a web server written in Rust. You can learn more by checking our [community resources](https://sansyrox.github.io/robyn/#/community-resources)!
To define your API, you can add the following code in an `app.py` file.
35
+
36
36
```python
37
37
from robyn import Robyn
38
38
@@ -43,17 +43,40 @@ async def h(request):
43
43
return"Hello, world!"
44
44
45
45
app.start(port=8080)
46
+
```
47
+
48
+
### 🏃 Run your code
49
+
50
+
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.
Robyn, a fast async web framework with a rust runtime.
58
+
59
+
options:
60
+
-h, --help show this help message and exit
61
+
--processes PROCESSES Choose the number of processes. [Default: 1]
62
+
--workers WORKERS Choose the number of workers. [Default: 1]
63
+
--dev Development mode. It restarts the server based on file changes.
64
+
--log-level LOG_LEVEL Set the log level name
47
65
```
48
66
49
-
## Python Version Support
67
+
Log level can be `DEBUG`, `INFO`, `WARNING`, or `ERROR`.
68
+
69
+
### 💻 Add more routes
70
+
71
+
You can add more routes to your API. Check out the routes in [this file](https://github.com/sansyrox/robyn/blob/main/integration_tests/base_routes.py) as examples.
72
+
73
+
## 🐍 Python Version Support
50
74
51
75
Robyn is compatible with the following Python versions:
52
76
53
77
> Python >= 3.7
54
78
55
-
It is recommended to use the latest version of Python for the best performance
56
-
and compatibility
79
+
It is recommended to use the latest version of Python for the best performances.
57
80
58
81
Please make sure you have the correct version of Python installed before starting to use
59
82
this project. You can check your Python version by running the following command in your
@@ -79,44 +102,35 @@ python --version
79
102
- Hot Reloading
80
103
- Community First and truly FOSS!
81
104
82
-
## 🗒️ Contributor Guidelines
105
+
## 🗒️ How to contribute
83
106
84
-
Feel free to open an issue for any clarification or for any suggestions.
107
+
### 🏁 Get started
85
108
86
-
If you're feeling curious. You can take a look at a more detailed architecture [here](https://github.com/sansyrox/robyn/blob/main/docs/architecture.md).
109
+
Please read the [code of conduct](https://github.com/sansyrox/robyn/blob/main/CODE_OF_CONDUCT.md) and go through [CONTRIBUTING.md](https://github.com/sansyrox/robyn/blob/main/CONTRIBUTING.md) before contributing to Robyn.
110
+
Feel free to open an issue for any clarifications or suggestions.
87
111
88
-
## ⚙️ To Develop Locally
112
+
If you're feeling curious. You can take a look at a more detailed architecture [here](https://sansyrox.github.io/robyn/#/architecture).
89
113
90
-
1. Install the development dependencies: `pip install -r dev-requirements.txt`
114
+
If you still need help to get started, feel free to reach out on our [community discord](https://discord.gg/rkERZ5eNU8).
91
115
92
-
1. Install the pre-commit git hooks: `pre-commit install`
116
+
### ⚙️ To Develop Locally
93
117
94
-
1.Add more routes in the `integration_tests/base_routes.py` file (if you like).
118
+
1.Install the development dependencies (preferably inside a virtual environment): `pip install -r dev-requirements.txt`
95
119
96
-
1. Run `maturin develop` or `maturin develop --cargo-extra-args="--features=io-uring"` (if you want to run the experimental version).
120
+
2. Install the pre-commit git hooks: `pre-commit install`
97
121
98
-
1. Run `python3 integration_tests/base_routes.py`
122
+
3. Run `maturin develop` or `maturin develop --cargo-extra-args="--features=io-uring"` for using the experimental version of actix-web. This command will build the Robyn Rust package and install it in your virtual environment.
99
123
100
-
## 🏃 To Run
124
+
4. Run `python3 integration_tests/base_routes.py`. This file contains several examples of routes we use for testing purposes. You can modify or add some to your likings.
101
125
126
+
You can then request the server you ran from an other terminal. Here is a `GET` request done using [curl](https://curl.se/) for example:
Robyn, a fast async web framework with a rust runtime.
108
-
109
-
optional arguments:
110
-
-h, --help show this help message and exit
111
-
--processes PROCESSES : allows you to choose the number of parallel processes
112
-
--workers WORKERS : allows you to choose the number of workers
113
-
--dev DEV : this flag gives the option to enable hot reloading or not and also sets the default log level to debug
114
-
--log-level LEVEL : this flag allows you to set the log level
128
+
curl http://localhost:8080/sync/str
115
129
```
116
130
117
-
## ✨ Contributors/Supporters
131
+
## ✨ Special thanks
118
132
119
-
To contribute to Robyn, make sure to first go through the [CONTRIBUTING.md](./CONTRIBUTING.md).
133
+
### ✨ Contributors/Supporters
120
134
121
135
Thanks to all the contributors of the project. Robyn will not be what it is without all your support :heart:.
122
136
@@ -126,7 +140,7 @@ Thanks to all the contributors of the project. Robyn will not be what it is with
126
140
127
141
Special thanks to the [PyO3](https://pyo3.rs/v0.13.2/) community and [Andrew from PyO3-asyncio](https://github.com/awestlake87/pyo3-asyncio) for their amazing libraries and their support for my queries. 💖
Robyn is an async Python backend server with a runtime written in Rust, btw.
9
+
Robyn is a Python web framework coupled with an async server implementation written in Rust. You can find the source code on [Github](https://github.com/sansyrox/robyn), contributions are very welcome!
16
10
17
-
## 📦 Installation
11
+
On this website, you will find more information on how to use Robyn.
18
12
19
-
You can simply use Pip for installation.
13
+
If you do not find what you were looking for here or have some suggestions to improve the docs, feel free to open an issue on the [Github repo](https://github.com/sansyrox/robyn), or ask for help on the official [Discord server](https://discord.gg/rkERZ5eNU8).
20
14
21
-
```
22
-
pip install robyn
23
-
```
15
+
## ✨ Special thanks
24
16
25
-
Or, with [conda-forge](https://conda-forge.org/)
26
-
27
-
```
28
-
conda install -c conda-forge robyn
29
-
```
30
-
31
-
## 🤔 Usage
32
-
33
-
```python
34
-
from robyn import Robyn
35
-
36
-
app = Robyn(__file__)
37
-
38
-
39
-
@app.get("/")
40
-
asyncdefh(request):
41
-
return"Hello, world!"
42
-
43
-
app.start(port=8080)
44
-
```
45
-
46
-
## 💡 Features
47
-
48
-
- Under active development!
49
-
- Written in Rust, btw xD
50
-
- A multithreaded Runtime
51
-
- Extensible
52
-
- A simple API
53
-
- Sync and Async Function Support
54
-
- Dynamic URL Routing
55
-
- Multi Core Scaling
56
-
- WebSockets!
57
-
- Middlewares
58
-
- Hot Reloading
59
-
- Community First and truly FOSS!
60
-
61
-
## 🗒️ Contributor Guidelines
62
-
63
-
Feel free to open an issue for any clarification or for any suggestions.
64
-
65
-
If you're feeling curious. You can take a look at a more detailed architecture [here](https://github.com/sansyrox/robyn/blob/main/docs/architecture.md).
66
-
67
-
## ⚙️ To Develop Locally
68
-
69
-
1. Install the development dependencies: `pip install -r dev-requirements.txt`
70
-
71
-
1. Install the pre-commit git hooks: `pre-commit install`
72
-
73
-
1. Add more routes in the `integration_tests/base_routes.py` file(if you like).
74
-
75
-
1. Run `maturin develop` or `maturin develop --cargo-extra-args="--features=io-uring"` (if you want to run the experimental version).
Robyn, a fast async web framework with a rust runtime.
87
-
88
-
optional arguments:
89
-
-h, --help show this help message and exit
90
-
--processes PROCESSES : allows you to choose the number of parallel processes
91
-
--workers WORKERS : allows you to choose the number of workers
92
-
--dev DEV : this flag gives the option to enable hot reloading or not and also sets the default log level to debug
93
-
--log-level LEVEL : this flag allows you to set the log level
94
-
```
95
-
96
-
## ✨ Contributors/Supporters
97
-
98
-
To contribute to Robyn, make sure to first go through the [CONTRIBUTING.md](https://github.com/sansyrox/robyn/blob/main/CONTRIBUTING.md).
17
+
### ✨ Contributors/Supporters
99
18
100
19
Thanks to all the contributors of the project. Robyn will not be what it is without all your support :heart:.
101
20
@@ -105,11 +24,11 @@ Thanks to all the contributors of the project. Robyn will not be what it is with
105
24
106
25
Special thanks to the [PyO3](https://pyo3.rs/v0.13.2/) community and [Andrew from PyO3-asyncio](https://github.com/awestlake87/pyo3-asyncio) for their amazing libraries and their support for my queries. 💖
0 commit comments