Skip to content

Commit ba8ccec

Browse files
committed
doc: README
Table of contents, Docker instructions
1 parent 4fc7494 commit ba8ccec

File tree

1 file changed

+99
-64
lines changed

1 file changed

+99
-64
lines changed

README.md

Lines changed: 99 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,124 @@
1-
---
21
<p align="center">
32
<img alt="logo" width="300" src=".github/images/logo.png">
43
</p>
54

5+
<h1 align="center">
6+
succulent - Collect POST requests easily
7+
</h1>
68

7-
# succulent - Collect POST requests easily
8-
9-
---
10-
![PyPI Version](https://img.shields.io/pypi/v/succulent.svg)
11-
[![Documentation Status](https://readthedocs.org/projects/succulent/badge/?version=latest)](https://succulent.readthedocs.io/en/latest/?badge=latest)
12-
![PyPI - Downloads](https://img.shields.io/pypi/dm/succulent.svg)
13-
[![Downloads](https://static.pepy.tech/badge/succulent)](https://pepy.tech/project/succulent)
14-
![GitHub repo size](https://img.shields.io/github/repo-size/firefly-cpp/succulent?style=flat-square)
15-
[![GitHub license](https://img.shields.io/github/license/firefly-cpp/succulent.svg)](https://github.com/firefly-cpp/succulent/blob/master/LICENSE)
16-
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/firefly-cpp/succulent.svg)
17-
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/firefly-cpp/succulent.svg)](http://isitmaintained.com/project/firefly-cpp/succulent "Average time to resolve an issue")
18-
[![Percentage of issues still open](http://isitmaintained.com/badge/open/firefly-cpp/succulent.svg)](http://isitmaintained.com/project/firefly-cpp/succulent "Percentage of issues still open")
19-
[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
20-
[![AUR package](https://img.shields.io/aur/version/python-succulent?color=blue&label=Arch%20Linux&logo=arch-linux)](https://aur.archlinux.org/packages/python-succulent)
21-
[![Fedora package](https://img.shields.io/fedora/v/python3-succulent?color=blue&label=Fedora%20Linux&logo=fedora)](https://src.fedoraproject.org/rpms/python-succulent)
22-
[![Packaging status](https://repology.org/badge/tiny-repos/python:succulent.svg)](https://repology.org/project/python:succulent/versions)
23-
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10402365.svg)](https://doi.org/10.5281/zenodo.10402365)
9+
<p align="center">
10+
<img alt="PyPI Version" src="https://img.shields.io/pypi/v/succulent.svg">
11+
<img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/succulent.svg">
12+
<a href="https://aur.archlinux.org/packages/python-succulent">
13+
<img alt="AUR package" src="https://img.shields.io/aur/version/python-succulent?color=blue&label=Arch%20Linux&logo=arch-linux">
14+
</a>
15+
<a href="https://src.fedoraproject.org/rpms/python-succulent">
16+
<img alt="Fedora package" src="https://img.shields.io/fedora/v/python3-succulent?color=blue&label=Fedora%20Linux&logo=fedora">
17+
</a>
18+
<a href="https://pepy.tech/project/succulent">
19+
<img alt="Downloads" src="https://static.pepy.tech/badge/succulent">
20+
</a>
21+
<a href="https://repology.org/project/python:succulent/versions">
22+
<img alt="Packaging status" src="https://repology.org/badge/tiny-repos/python:succulent.svg">
23+
</a>
24+
<a href="https://github.com/firefly-cpp/succulent/blob/master/LICENSE">
25+
<img alt="GitHub license" src="https://img.shields.io/github/license/firefly-cpp/succulent.svg">
26+
</a>
27+
<a href="https://github.com/firefly-cpp/succulent/actions/workflows/test.yml">
28+
<img alt="Build" src="https://github.com/firefly-cpp/succulent/actions/workflows/test.yml/badge.svg">
29+
</a>
30+
<a href="https://succulent.readthedocs.io/en/latest/?badge=latest">
31+
<img alt="Documentation status" src="https://readthedocs.org/projects/succulent/badge/?version=latest">
32+
</a>
33+
</p>
2434

25-
* **Free software:** MIT license
26-
* **Documentation:** [https://succulent.readthedocs.io/en/latest/](https://succulent.readthedocs.io/en/latest/)
27-
* **Python versions:** 3.8.x, 3.9.x, 3.10.x, 3.11.x, 3.12.x
28-
* **Tested OS:** Windows, Ubuntu, Fedora, Alpine, Arch, macOS. **However, that does not mean it does not work on others**
35+
<p align="center">
36+
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/firefly-cpp/succulent">
37+
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/w/firefly-cpp/succulent.svg">
38+
<a href="http://isitmaintained.com/project/firefly-cpp/succulent">
39+
<img alt="Average time to resolve an issue" src="http://isitmaintained.com/badge/resolution/firefly-cpp/succulent.svg">
40+
</a>
41+
<a href="http://isitmaintained.com/project/firefly-cpp/succulent">
42+
<img alt="Percentage of issues still open" src="http://isitmaintained.com/badge/open/firefly-cpp/succulent.svg">
43+
</a>
44+
<a href="#-contributors">
45+
<img alt="All Contributors" src="https://img.shields.io/badge/all_contributors-5-orange.svg">
46+
</a>
47+
</p>
2948

30-
## About :information_source:
49+
<p align="center">
50+
<a href="https://doi.org/10.5281/zenodo.10402365">
51+
<img alt="DOI" src="https://zenodo.org/badge/DOI/10.5281/zenodo.10402365.svg">
52+
</a>
53+
</p>
54+
55+
<p align="center">
56+
<a href="#-detailed-insights">🔍 Detailed Insights</a> •
57+
<a href="#-installation">📦 Installation</a> •
58+
<a href="#-container">🐳 Container</a> •
59+
<a href="#-usage">🚀 Usage</a> •
60+
<a href="#-configuration">🔧 Configuration</a> •
61+
<a href="#-license">🔑 License</a> •
62+
<a href="#-contributors">🫂 Contributors</a>
63+
</p>
3164

32-
Do you ever find it challenging and tricky to send sensor measurements :straight_ruler:, data :bar_chart:, or GPS positions from embedded devices :iphone:, microcontrollers, and [smartwatches](https://github.com/firefly-cpp/AST-Monitor) to a central server? :satellite: Setting up the primary data collection scripts can be a time-consuming :hourglass_flowing_sand: process, involving selecting a protocol, framework, API, and testing them out. Moreover, these scripts are often tailored for specific tasks, making them difficult to adapt to different scenarios.
65+
Do you ever find it challenging and tricky to send sensor measurements 📏, data 📊, or GPS positions from embedded devices 📱, microcontrollers, and [smartwatches](https://github.com/firefly-cpp/AST-Monitor) to a central server? 📡 Setting up the primary data collection scripts can be a time-consuming process, involving selecting a protocol, framework, API, and testing them out. Moreover, these scripts are often tailored for specific tasks, making them difficult to adapt to different scenarios.
3366

34-
But fear not! Introducing succulent 🌵, a pure Python framework that simplifies the configuration, management, collection, and preprocessing of data collected via POST requests. This framework draws inspiration from real-world data collection challenges in [smart agriculture](https://github.com/firefly-cpp/smart-agriculture-datasets/tree/main/plant-monitoring-esp32) :brain::herb:, specifically plant monitoring using ESP32 devices. The main goal behind succulent is to streamline the process of configuring various data parameters and provide a range of useful functions for data transformations. By leveraging succulent, you can set up your entire data collection endpoint within minutes, freeing you from the hassle of dealing with server-side scripts.:rocket::wrench:
67+
But fear not! Introducing succulent 🌵, a pure Python framework that simplifies the configuration, management, collection, and preprocessing of data collected via POST requests. This framework draws inspiration from real-world data collection challenges in [smart agriculture](https://github.com/firefly-cpp/smart-agriculture-datasets/tree/main/plant-monitoring-esp32) 🧠🌿, specifically plant monitoring using ESP32 devices. The main goal behind succulent is to streamline the process of configuring various data parameters and provide a range of useful functions for data transformations. By leveraging succulent, you can set up your entire data collection endpoint within minutes, freeing you from the hassle of dealing with server-side scripts. 🚀🔧
68+
69+
* **Free software:** MIT license
70+
* **Documentation:** [https://succulent.readthedocs.io/en/latest](https://succulent.readthedocs.io/en/latest/)
71+
* **Python versions:** 3.8.x, 3.9.x, 3.10.x, 3.11.x, 3.12.x
72+
* **Tested OS:** Windows, Ubuntu, Fedora, Alpine, Arch, macOS. **However, that does not mean it does not work on others**
3573

36-
## Detailed Insights :mag:
74+
## 🔍 Detailed Insights
3775

3876
The current version of succulent comes packed with exciting features, including, but not limited to:
3977

4078
- **Hassle-free generation of request URLs** for seamless data collection 🌐
4179
- **Effortless data retrieval** from POST requests 📥
42-
- **Versatile data storage options**, such as CSV, JSON, SQLite, XML and even images 🗂️📊🖼️
43-
- **Customizable boundaries for collected data**, allowing you to set minimum and maximum thresholds ⚙️
80+
- **Versatile data storage options**, such as CSV, JSON, SQLite, XML, and even images 🗂️📊🖼️
81+
- **Customisable boundaries for collected data**, allowing you to set minimum and maximum thresholds ⚙️
4482

4583
With succulent, the process of collecting, managing, and preprocessing data becomes a breeze, empowering you to focus on what truly matters—gaining valuable insights from your embedded devices, microcontrollers, and smartwatches. ⌚ So why waste precious time? ⏳ Dive into the world of succulent and unlock the true potential of your data! 💪📈
4684

47-
## Installation
85+
## 📦 Installation
4886

4987
### pip
5088

51-
Install succulent with pip:
89+
To install `succulent` with pip, use:
5290

5391
```sh
5492
pip install succulent
5593
```
5694
### Alpine Linux
5795

58-
To install succulent on Alpine Linux, please use:
96+
To install `succulent` on Alpine Linux, use:
5997

6098
```sh
6199
$ apk add py3-succulent
62100
```
63101

64102
### Arch Linux
65103

66-
To install succulent on Arch Linux, please use an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers):
104+
To install `succulent` on Arch Linux, use an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers):
67105

68106
```sh
69107
$ yay -Syyu python-succulent
70108
```
71109

72110
### Fedora Linux
73111

74-
To install succulent on Fedora, use:
112+
To install `succulent` on Fedora, use:
75113

76114
```sh
77115
$ dnf install python3-succulent
78116
```
79117

80-
## Container
81-
82-
File: docker-compose.yml
118+
## 🐳 Container
119+
Create a `docker-compose.yml` file with the following content in the root directory:
83120

84-
```sh
121+
```yml
85122
version: '3.8'
86123

87124
services:
@@ -96,9 +133,10 @@ services:
96133
- GUNICORN_WORKERS=2
97134
command: gunicorn -b 0.0.0.0:8080 -w 2 -t 120 run:app
98135
```
99-
File: configuration.yml (example)
100136
101-
```sh
137+
Next create a `configuration.yml` file in the root directory. Here's an example of a configuration file:
138+
139+
```yml
102140
data:
103141
- name: 'temperature'
104142
- name: 'humidity'
@@ -107,8 +145,11 @@ data:
107145
- name: 'date'
108146
```
109147

110-
File: run.py
111-
```bash
148+
More information regarding the configuration file and its settings can be found in the [configuration](#-configuration) section.
149+
150+
Then create a Python file named `run.py` with the following content in the root directory:
151+
152+
```python
112153
from succulent.api import SucculentAPI
113154
114155
api = SucculentAPI(config='configuration.yml', format='csv')
@@ -117,23 +158,19 @@ api = SucculentAPI(config='configuration.yml', format='csv')
117158
app = api.app
118159
```
119160

120-
Build and run:
161+
Once you have set up the configuration file and the Python file, build the Docker image with the following command:
162+
121163
```bash
122164
docker compose build
123165
```
124166

125-
### Usage
126-
Run the container using Docker:
127-
```bash
128-
docker run -p 8080:8080 succulent-container
129-
```
167+
Finally, run the Docker container with the following command:
130168

131-
Alternatively, you can use ``docker-compose``:
132169
```bash
133170
docker compose up
134171
```
135172

136-
## Usage
173+
## 🚀 Usage
137174

138175
### Example
139176

@@ -143,53 +180,51 @@ api = SucculentAPI(host='0.0.0.0', port=8080, config='configuration.yml', format
143180
api.start()
144181
```
145182

146-
## Configuration
183+
## 🔧 Configuration
147184
### Data collection
148-
In the root directory, create a file named `configuration.yml` and define the following:
185+
In the root directory, create a `configuration.yml` file and define the following:
149186
```yml
150187
data:
151188
- name: # Measure name
152-
min: # Minimum value (optional)
153-
max: # Maximum value (optional)
189+
min: # Minimum value (optional)
190+
max: # Maximum value (optional)
154191
```
155192

156-
To collect images, create a file named ``configuration.yml`` in the root directory and define the following:
193+
To collect images, create a ``configuration.yml`` file in the root directory and define the following:
157194
```yml
158195
data:
159196
- key: # Key in POST request
160197
```
161198

162-
To access the URL for data collection, send a GET request or navigate to [http://localhost:8080/measure](http://localhost:8080/measure).
199+
To access the URL for data collection, send a GET request (or navigate) to [http://localhost:8080/measure](http://localhost:8080/measure).
163200

164201
### Data access
165-
To access data via the Succulent API, enable the results in the configuration file:
202+
To access data via the Succulent API, enable the results option in the configuration file:
166203
```yml
167204
results:
168205
- enable: true # false by default
169206
```
170207

171-
To access the collected data, send a GET request or navigate to [http://localhost:8080/data](http://localhost:8080/data).
208+
To access the collected data, send a GET request (or navigate) to [http://localhost:8080/data](http://localhost:8080/data).
172209

173210
### Data export
174-
To export the data, enable the export in the configuration file:
211+
To export the data, enable the export option in the configuration file:
175212
```yml
176213
results:
177-
export:
178-
enabled: true # false by default
214+
- export: true # false by default
179215
```
180216

181-
To export the data, send a GET request or navigate to [http://localhost:8080/export](http://localhost:8080/export).
182-
217+
To export the data, send a GET request (or navigate) to [http://localhost:8080/export](http://localhost:8080/export). The data will be downloaded in the format specified in the configuration file.
183218

184-
## License
219+
## 🔑 License
185220

186221
This package is distributed under the MIT License. This license can be found online at <http://www.opensource.org/licenses/MIT>.
187222

188223
## Disclaimer
189224

190225
This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!
191226

192-
## Contributors ✨
227+
## 🫂 Contributors
193228

194229
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
195230

0 commit comments

Comments
 (0)