-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathREADME
More file actions
88 lines (57 loc) · 1.64 KB
/
README
File metadata and controls
88 lines (57 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# About pytrap
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).
# Installation
## Prerequisites
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.
### Installing Python development headers
**For Debian/Ubuntu:**
```bash
sudo apt install python3-dev
```
**For Red Hat/Fedora/CentOS:**
```bash
sudo dnf install python3-devel
```
## Installing pytrap
When all requirements are met, run as root:
```bash
pip install .
```
## Viewing help
Help is contained in the python module. After successful installation run in
a python interactive interpreter:
```python
import pytrap
help(pytrap)
help(pytrap.pytrap)
```
# Documentation
## Building documentation
The project uses Sphinx for documentation generation. First install documentation dependencies:
```bash
pip install .[docs]
```
Then build the documentation:
```bash
cd docs
make html
```
The generated documentation will be available in the `dist/doc/` directory.
# Testing
The project uses pytest for testing. First install documentation dependencies:
```bash
pip install .[test]
```
```bash
# Run all tests
pytest
# Run specific test files (following the project's naming convention)
pytest test/*_unittest.py
```
# Examples
See https://github.com/CESNET/Nemea-Framework/tree/master/examples/python