Inspirel banner

Programming Distributed Systems with YAMI4

2.6 Python Library

The Python general-purpose library is intended to wrap the C++ general-purpose library and mirror its functionality to a reasonable extent.

The Python library was prepared for both branches of the Python language - 2.x (at least 2.5) and 3.x. Their API is almost identical and differs only in places related to the data model - the differences are described in relevant chapters, although code examples assume Python 3.x as the target environment.

On a Unix-like system it is not necessary to compile the C++ libraries as a preliminary step, as the Python wrapper forces their recompilation anyway due to the specific options that are required for a loadable module.

$ cd src/python
$ make

On a Windows system with Visual Studio or Visual C++ installed it is necessary to compile the C++ core and the C++ general-purpose libraries first, see previous sections for instructions. The Python loadable module can be compiled the following way:

> cd src\python
> nmake /F Makefile.VS

After compilation the lib directory (in the root project directory) will contain libyami4py.so or libyami4py.dylib or yami4py.dll file (depending on the platform) as well as the yami.py module. The dynamically loaded libraries should be located on the path that is automatically searched by the library loader - on Unix-like systems a relevant environment variable that controls the dynamic loading of such modules is LD_LIBRARY_PATH or DYLD_LIBRARY_PATH, whereas on Windows the PATH variable is used for this purpose. The Python module should be visible to the Python interpreter as well.

The doc/python directory contains the generated API documentation for this library.