| |
|
|||||||
|
|
||||||||
|
Python Bindings Plug-In This plug-in implements libFAUDES bindings for the scripting language Python. Relevant libFAUDES data types and functions as documented via the libFAUDES User Reference can be accessed from within the Python interpreter. For user documentation/introduction specifically for the faudes Python module, see the libFAUDES Python API. The most convenient method to make the faudes Python module available is to install it via $ pip install faudes
$ python3 -c "import faudes; print(faudes.Version())"
or, for native Windows > py -m pip install faudes
> py -c "import faudes; print(faudes.Version())"
This will search the index PyPI for a binary distribution that fits your platform/archirectur. In the case no such matching binary is present, please let us know. Instructions on how to compile your own binary are below. Example Script# load libFAUDES bindings
from faudes import *
# test
Version()
Build()
# instantiate generator from Python lists
g = Generator.NewFromLists(
delta=[
['idle', 'alpha', 'busy'],
['busy', 'beta', 'idle']],
Q0 =[ 'idle' ],
Qm =[ 'idle' ]
)
# show on console
g.Write()
# show graphically, i.e., in Jupyter notebook
g.GraphShow()
Note: for graphics output you must have installed DocExecPath("/wherever_dot_is/dot").
Building the libFAUDES Python moduleThe faudes Python module consists of the glue code Example for the overall build process incl. copy/rename: ./libFAUDES$ make dist-clean
./libFAUDES$ make -j configure
./libFAUDES$ make -j
./libFAUDES$ cp plugings/pybindings/obj/faudes.py whereever/
./libFAUDES$ cp plugings/pybindings/obj/_faudes.so whereever/
./libFAUDES$ cd whereever
./whereever$ python3 -c "import faudes; print(faudes.Version())"
The above method is specifically recommended for MSYS environments where pip install from PyPI.org will fail. Building the libFAUDES Python moduleA Python wheel is an archive in a clearly defined format/layout which among others facilitates binary distribution of Python extenstions e.g. via PyPI.org. The libFAUDES build system has a dedicated target Example for the overall build process incl. installation: ./libFAUDES$ make dist-clean
./libFAUDES$ make -j configure
./libFAUDES$ make pybindings-wheel
./libFAUDES$ pip install faudes-2.34.0-cp314-cp314-macosx_10_15_universal2.whl
Alternatively, you may download the configured source from PyPI and invoke ./faudes-2.34> py -m build --wheel --outdir=./
LicenseThe Python bindings plug-in is distributed with libFAUDES. All code is provided under terms of the LGPL. Copyright (c) 2023 - 2026 Thomas Moor. libFAUDES 2.34g --- 2026.03.30 --- c++ api documentaion by doxygen |