A long time ago, I used JModelica/pymodelica to compile modelica models into FMUs, using a simple python script. Now I learn that JModelica is discontinued as an open-source project. (The libraries to run an FMU seems to have been branched out into new open-source projects, but I did not find the compiler.)
Is there an alternative which is up-to-date, open source, and equally simple?
The script I have from back when is the following, and I hope to find something which lets me update this to Python3 and continue where I left off so many years ago.
#! /local/opt/modelica/bin/jm_python.sh
# Import the compiler function
from pymodelica import compile_fmu
import optparse
parser = optparse.OptionParser()
(options,args) = parser.parse_args()
# Specify Modelica model and model file (.mo or .mop)
mo_file = args[0]
model_name = mo_file.split(".")[0]
print mo_file, model_name
# Compile the model and save the return argument, which is the file name of the FMU
my_fmu = compile_fmu(model_name, mo_file, target='cs')