Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/schaffung/csv-mqtt
A CSV to MQTT connector. Reads data from csv file and pushes it to a MQTT Broker.
https://github.com/schaffung/csv-mqtt
csv iot mqtt mqtt-client
Last synced: about 3 hours ago
JSON representation
A CSV to MQTT connector. Reads data from csv file and pushes it to a MQTT Broker.
- Host: GitHub
- URL: https://github.com/schaffung/csv-mqtt
- Owner: schaffung
- License: mit
- Created: 2019-10-14T12:34:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-21T08:33:53.000Z (5 months ago)
- Last Synced: 2025-01-14T03:30:39.868Z (22 days ago)
- Topics: csv, iot, mqtt, mqtt-client
- Language: Python
- Size: 9.77 KB
- Stars: 18
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CSV-MQTT
A CSV to MQTT connector. Reads data from csv file and pushes it to a MQTT Broker.Many a times, we want to read a particular .csv file and then form a MQTT payload to publish it to cloud. ( Probably when working in IoT).
So the project as always came in due to a necessity. The idea is simple. The process will read the .csv file wherein the very first row contains the columns headers. ( Please add column headers before using the code or be ready to see something strange.)
Then the same column headers are treated as Keys and the corresponding row values as Values in a JSON object while forming a MQTT Payload.For example, If the csv data is as follows,
```csv
Name,Age,School
dummy_name,dummy_value,dummy_school
```Then the resulting MQTT Payload will be of the form,
```json
{
"Name" : "dummy_name",
"Age" : "dummy_value",
"School" : "dummy_school"
}
```One can install the package using pip
```
pip3 install csv-mqtt
```Once installed, they can use the package by using the import
```
from csv_mqtt.csv_mqtt import CsvMqtt
```The `CsvMqtt` can be used to create objects for creating a pipeline for csv-mqtt.
For examples, one can check the example directory in the project.