Skip to main content

CSV parser meets MQTT Publisher

Project description

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 has column headers as, Name, Age and School

Then the resulting MQTT Payload will be of the form,

{ "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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

csv-mqtt-1.0.2.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

csv_mqtt-1.0.2-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page