Creating fully self-contained and pre-compiled library

A full-blown example: GitHub - ufechner7/pykitemodels: Kite power system models for Python

In this package, I wrap a Julia package using JSON over HTTP for use in Python.
The call overhead is about 100µs. (Of course, it depends on the size of the data you exchange and on the speed of your CPU).

See also:

While this is not the fastest possible approach, it is the simplest and most straightforward approach. On the Python side you do not need any extra package, because HTTP and JSON are included by default. All you need to do is to define a struct with the parameters of the function you want to call.

An other alternative is to export Julia models using FMIExport. Then you have an FMU component that can be used in Python or Simulink or whatever. But these components are very large.

2 Likes