Skip to content

Commit 646e529

Browse files
authored
docs: improve readme (#418)
1 parent 5f437d1 commit 646e529

File tree

4 files changed

+115
-65
lines changed

4 files changed

+115
-65
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Let's walk through the steps to create an issue:
109109
**4.** Select one of the Issue Templates to get started.
110110
<br><br><img src="https://i.imgur.com/xz2KAwU.png" width="750" /><br>
111111

112-
**4.** Fill in the appropriate `Title` and `Issue description` and click on `Submit new issue`.
112+
**5.** Fill in the appropriate `Title` and `Issue description` and click on `Submit new issue`.
113113
<br><br><img src="https://i.imgur.com/XwjtGG1.png" width="750" /><br>
114114

115115
### Tutorials that may help you:

README.md

+48-34
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@
33
# Robyn
44

55
[![Twitter](https://badgen.net/badge/icon/twitter?icon=twitter&label)](https://twitter.com/robyn_oss)
6-
[![Gitter](https://badges.gitter.im/robyn_/community.svg)](https://gitter.im/robyn_/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
76
[![Downloads](https://static.pepy.tech/personalized-badge/robyn?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/robyn)
8-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
97
[![GitHub tag](https://img.shields.io/github/tag/sansyrox/robyn?include_prereleases=&sort=semver&color=black)](https://github.com/sansyrox/robyn/releases/)
108
[![License](https://img.shields.io/badge/License-BSD_2.0-black)](#license)
119
![Python](https://img.shields.io/badge/Support-Version%20%E2%89%A5%203.7-brightgreen)
12-
[![Discord](https://img.shields.io/discord/999782964143603713?label=discord&logo=discord&logoColor=white&style=for-the-badge&color=blue)](https://discord.gg/rkERZ5eNU8)
1310

1411
[![view - Documentation](https://img.shields.io/badge/view-Documentation-blue?style=for-the-badge)](https://sansyrox.github.io/robyn/#/)
12+
[![Discord](https://img.shields.io/discord/999782964143603713?label=discord&logo=discord&logoColor=white&style=for-the-badge&color=blue)](https://discord.gg/rkERZ5eNU8)
1513

16-
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)!
1915

2016
## 📦 Installation
2117

@@ -33,6 +29,10 @@ conda install -c conda-forge robyn
3329

3430
## 🤔 Usage
3531

32+
### 🚀 Define your API
33+
34+
To define your API, you can add the following code in an `app.py` file.
35+
3636
```python
3737
from robyn import Robyn
3838

@@ -43,17 +43,40 @@ async def h(request):
4343
return "Hello, world!"
4444

4545
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.
51+
52+
```
53+
$ python3 app.py -h
4654
55+
usage: app.py [-h] [--processes PROCESSES] [--workers WORKERS] [--dev] [--log-level LOG_LEVEL]
56+
57+
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
4765
```
4866

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
5074

5175
Robyn is compatible with the following Python versions:
5276

5377
> Python >= 3.7
5478
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.
5780

5881
Please make sure you have the correct version of Python installed before starting to use
5982
this project. You can check your Python version by running the following command in your
@@ -79,44 +102,35 @@ python --version
79102
- Hot Reloading
80103
- Community First and truly FOSS!
81104

82-
## 🗒️ Contributor Guidelines
105+
## 🗒️ How to contribute
83106

84-
Feel free to open an issue for any clarification or for any suggestions.
107+
### 🏁 Get started
85108

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.
87111

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).
89113

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).
91115

92-
1. Install the pre-commit git hooks: `pre-commit install`
116+
### ⚙️ To Develop Locally
93117

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`
95119

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`
97121

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.
99123

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.
101125

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:
102127
```
103-
python3 app.py -h
104-
105-
usage: app.py [-h] [--processes PROCESSES] [--workers WORKERS] [--dev DEV]
106-
107-
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
115129
```
116130

117-
## Contributors/Supporters
131+
## Special thanks
118132

119-
To contribute to Robyn, make sure to first go through the [CONTRIBUTING.md](./CONTRIBUTING.md).
133+
### ✨ Contributors/Supporters
120134

121135
Thanks to all the contributors of the project. Robyn will not be what it is without all your support :heart:.
122136

@@ -126,7 +140,7 @@ Thanks to all the contributors of the project. Robyn will not be what it is with
126140

127141
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. 💖
128142

129-
## ✨ Sponsors
143+
### ✨ Sponsors
130144

131145
These sponsors help us make the magic happen!
132146

docs/README.md

+65-30
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
# Robyn
44

55
[![Twitter](https://badgen.net/badge/icon/twitter?icon=twitter&label)](https://twitter.com/robyn_oss)
6-
[![Gitter](https://badges.gitter.im/robyn_/community.svg)](https://gitter.im/robyn_/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
76
[![Downloads](https://static.pepy.tech/personalized-badge/robyn?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/robyn)
8-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
97
[![GitHub tag](https://img.shields.io/github/tag/sansyrox/robyn?include_prereleases=&sort=semver&color=black)](https://github.com/sansyrox/robyn/releases/)
108
[![License](https://img.shields.io/badge/License-BSD_2.0-black)](#license)
11-
[![Discord](https://img.shields.io/discord/999782964143603713?label=discord&logo=discord&logoColor=white&style=for-the-badge&color=blue)](https://discord.gg/qKF5sSnC)
9+
![Python](https://img.shields.io/badge/Support-Version%20%E2%89%A5%203.7-brightgreen)
1210

1311
[![view - Documentation](https://img.shields.io/badge/view-Documentation-blue?style=for-the-badge)](https://sansyrox.github.io/robyn/#/)
12+
[![Discord](https://img.shields.io/discord/999782964143603713?label=discord&logo=discord&logoColor=white&style=for-the-badge&color=blue)](https://discord.gg/rkERZ5eNU8)
1413

15-
Robyn is an async Python backend server with a runtime written in Rust, btw.
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)!
1615

1716
## 📦 Installation
1817

@@ -30,19 +29,64 @@ conda install -c conda-forge robyn
3029

3130
## 🤔 Usage
3231

32+
### 🚀 Define your API
33+
34+
To define your API, you can add the following code in an `app.py` file.
35+
3336
```python
3437
from robyn import Robyn
3538

3639
app = Robyn(__file__)
3740

38-
3941
@app.get("/")
4042
async def h(request):
4143
return "Hello, world!"
4244

4345
app.start(port=8080)
4446
```
4547

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.
51+
52+
```
53+
$ python3 app.py -h
54+
55+
usage: app.py [-h] [--processes PROCESSES] [--workers WORKERS] [--dev] [--log-level LOG_LEVEL]
56+
57+
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
65+
```
66+
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
74+
75+
Robyn is compatible with the following Python versions:
76+
77+
> Python >= 3.7
78+
79+
It is recommended to use the latest version of Python for the best performances.
80+
81+
Please make sure you have the correct version of Python installed before starting to use
82+
this project. You can check your Python version by running the following command in your
83+
terminal:
84+
85+
```
86+
python --version
87+
88+
```
89+
4690
## 💡 Features
4791

4892
- Under active development!
@@ -58,44 +102,35 @@ app.start(port=8080)
58102
- Hot Reloading
59103
- Community First and truly FOSS!
60104

61-
## 🗒️ Contributor Guidelines
105+
## 🗒️ How to contribute
62106

63-
Feel free to open an issue for any clarification or for any suggestions.
107+
### 🏁 Get started
64108

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).
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.
66111

67-
## ⚙️ 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).
68113

69-
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).
70115

71-
1. Install the pre-commit git hooks: `pre-commit install`
116+
### ⚙️ To Develop Locally
72117

73-
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`
74119

75-
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`
76121

77-
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.
78123

79-
## 🏃 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.
80125

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:
81127
```
82-
python3 app.py -h
83-
84-
usage: app.py [-h] [--processes PROCESSES] [--workers WORKERS] [--dev DEV]
85-
86-
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
128+
curl http://localhost:8080/sync/str
94129
```
95130

96-
## Contributors/Supporters
131+
## Special thanks
97132

98-
To contribute to Robyn, make sure to first go through the [CONTRIBUTING.md](https://github.com/sansyrox/robyn/blob/main/CONTRIBUTING.md).
133+
### ✨ Contributors/Supporters
99134

100135
Thanks to all the contributors of the project. Robyn will not be what it is without all your support :heart:.
101136

@@ -105,7 +140,7 @@ Thanks to all the contributors of the project. Robyn will not be what it is with
105140

106141
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. 💖
107142

108-
## ✨ Sponsors
143+
### ✨ Sponsors
109144

110145
These sponsors help us make the magic happen!
111146

docs/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
name="viewport"
1313
content="width=device-width, initial-scale=1.0, minimum-scale=1.0"
1414
/>
15+
<link rel="icon" href="https://user-images.githubusercontent.com/29942790/140995889-5d91dcff-3aa7-4cfb-8a90-2cddf1337dca.png" />
1516
<link
1617
rel="stylesheet"
1718
href="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/style.min.css"

0 commit comments

Comments
 (0)