flucto-gmbh / heisskleber

MIT License
0 stars 1 forks source link

Heisskleber

PyPI Python Version License

Read the documentation at https://heisskleber.readthedocs.io/ Tests codecov

pre-commit Format

🇩🇪Heißkleber m: "hot glue".

Heisskleber is a versatile library designed to seamlessly "glue" together various data producers and consumers across a multitude of protocols including zmq, mqtt, udp, serial, influxdb, and cmdline. With the ambition to extend into REST API interactions and file operations, Heisskleber offers both synchronous and asynchronous interfaces to cater to a wide range of IoT connectivity needs.

Features

Installation

You can install Heisskleber via pip from PyPI:

$ pip install heisskleber

Configuration files for zmq, mqtt and other heisskleber related settings should be placed in the user's config directory, usually $HOME/.config. Config file templates can be found in the config directory of the package.

Quick Start

Here's a simple example to demonstrate how Heisskleber can be used to connect a zmq source to an mqtt sink:

"""
A simple forwarder that takes messages from
"""

from heisskleber.serial import SerialSubscriber, SerialConf
from heisskleber.mqtt import MqttPublisher, MqttConf

source = SerialSubscriber(config=SerialConf(port="/dev/ACM0"))
sink = MqttPublisher(config=MqttConf(host="127.0.0.1", port=1883, user="", password=""))

while True:
    topic, data = source.receive()
    sink.send(data, topic="/hostname/" + topic)

All sources and sinks come with customizable "unpack" and "pack" functions, making it simple to work with various data formats.

It is also possible to do configuration via yaml files, placed at $HOME/.config/heisskleber and named according to the protocol in question.

See the documentation for detailed usage.

Development

  1. Install poetry
curl -sSL https://install.python-poetry.org | python3 -
  1. clone repository
git clone https://github.com/flucto-gmbh/heisskleber.git
cd heisskleber
  1. setup
make install

License

Distributed under the terms of the MIT license, Heisskleber is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.