mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-04-28 15:09:47 +00:00
848 B
848 B
Python Bindings Development Guide
The aim of this document is to guide when extending these bindings with additional nDPI API. In the following we suppose that we want to add the following API to ndpi python package.
int ndpi_des_init(struct ndpi_des_struct *des, double alpha, double beta, float significance);
Add it to NDPI_APIS Python definition
NDPI_APIS must be updated with the new API you want to add.
Regenerate bindings
python3 setup.py install
That's it!
Now this API can be called and used on python side
from ndpi import lib, ffi
des = ffi.new("struct ndpi_des_struct *")
alpha = 0.9
beta = 0.5
lib.ndpi_des_init(des, alpha, beta, 0.05)