The pytrap module is a native Python extension that allows writing NEMEA modules in Python.
This directory contains an implementation of a Python extension. The aim is to allow native calls of base TRAP functionality (used by NEMEA modules).
Development package of Python is required (python3-devel etc. according to your OS distribution). It contains needed header files.
Since this module uses libtrap and libunirec, https://github.com/CESNET/Nemea-framework must be installed in the system.
For Debian/Ubuntu:
sudo apt install python3-devFor Red Hat/Fedora/CentOS:
sudo dnf install python3-develWhen all requirements are met, run as root:
pip install .Help is contained in the python module. After successful installation run in a python interactive interpreter:
import pytrap
help(pytrap)
help(pytrap.pytrap)The project uses Sphinx for documentation generation. First install documentation dependencies:
pip install .[docs]Then build the documentation:
cd docs
make htmlThe generated documentation will be available in the dist/doc/ directory.
The project uses pytest for testing. First install documentation dependencies:
pip install .[test]# Run all tests
pytest
# Run specific test files (following the project's naming convention)
pytest test/*_unittest.pySee https://github.com/CESNET/Nemea-Framework/tree/master/examples/python