Netdef
Documentation: https://netdef.readthedocs.io/en/latest/
License: GNU Lesser General Public License v3 or later (LGPLv3+)
Summary
An application framework with built-in drivers (Controllers), data holders (Sources) and config parsers (Rules). Also includes a web interface for configuration and troubleshooting.
Features
Abstract base classes for creating custom controllers, sources and rules
The configuration is done using configparser with extended interpolation
Start a new netdef project with cookiecutter or make-project. Templates available at https://gitlab.com/fholmer/netdef-project/
Built-in Controllers:
OpcUa server / client (freeopcua)
TcpModbus server / client (pymodbus)
icmp ping / url ping
XmlRpc client
trigger events by using crontab format (crontab)
disk, memory and CPU monitoring (psutil)
MQTT client (using a simple messaging format called DataMessage) (paho-mqtt)
Simple RESTJson client
Simple Influxdb logger (influxdb)
Built-in Rules:
Generic CSV config parser
Generic INI config parser
Generic Yaml config parser (PyYAML)
Built-in application engines:
threaded engine with stdout/stderr only
threaded engine with web-interface (webadmin)
serve webadmin behind nginx reverse proxy
Use Cases
Netdef is useful if you want to create a middleware that can translate a protocol into a completely different protocol or data format into a completely different data format.
Getting started
First install make-project:
$ python3 -m pip install --user make
Create your first application:
$ python3 -m make project gl:fholmer/netdef-project/minimal-app
When asked for project_name type Test-App:
project_name? [First-App]: Test-App
Setup development environment for your application:
$ cd Test-App $ python3 -m venv venv $ source venv/bin/activate $ pip install wheel $ pip install -r requirements-dev.txt $ pip install -r requirements.txt $ python -m test_app -i .
Run:
$ python -m test_app -r .
CTRL-C to exit
Package your application:
$ python setup.py bdist_wheel
Exit development environment:
$ deactivate
Prepare deployment:
$ sudo mkdir -p /opt/test-app $ sudo chown $USER:$USER /opt/test-app/ $ python3 -m venv /opt/test-app/
Deploy your application:
$ source /opt/test-app/bin/activate $ pip install ./dist/Test_App-0.1.0-py3-none-any.whl $ python -m test_app -i /opt/test-app/
Install as service:
$ sudo /opt/test-app/bin/Test-App-Service -u $USER --install /opt/test-app/
Enable and run:
$ sudo systemctl --system daemon-reload $ sudo systemctl enable test-app-service.service $ sudo systemctl start test-app-service.service
Metadata
Release files for netdef 1.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| netdef-1.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Release files / netdef-1.0.7-py3-none-any.whl
| Download URL | netdef-1.0.7-py3-none-any.whl |
|---|---|
| Size | 137.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70935aadaf575c68ffa59b2fb0c683e6bd72009e83d51d1576e89dc233c4cced
|
|
BLAKE2b-256 checksum How to use checksums |
a5fa7f82d77bae6b402c79a96c3b03b027566fa7d22d6d6945c87f74000c65c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.3
|
Security for netdef 1.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.