skillfed

FMPy

Simulate Functional Mock-up Units (FMUs) in Python

fmpy v0.3.31 210.1K downloads/30d#9,504 on PyPI
License unclear Active released

What it is and what it does

FMPy is a Python library for simulating Functional Mock-up Units (FMUs), which are standardized simulation components used across engineering and scientific modeling. It implements the FMI standard (versions 1.0, 2.0, and 3.0) and supports both Co-Simulation and Model Exchange modes, allowing you to load, inspect, and run FMU files directly from Python or via command-line tools. The library includes a graphical user interface for interactive exploration, a web app built on Dash for sharing simulations, and Jupyter Notebook integration for computational workflows.

Typical usage involves loading an FMU file, querying its metadata (variables, parameters, initial conditions), running a simulation over a time horizon, and analyzing or plotting the results. FMPy depends on numpy for numerical computation, lxml for XML parsing (FMU metadata), cmake for compiling C code FMUs, and several other utilities. It runs on Windows, Linux, and macOS and requires Python 3.10 or later.

Use it for:

  • Simulate control systems or physical models packaged as FMUs in Python scripts for parameter studies or optimization loops.
  • Inspect and debug FMU metadata and behavior interactively using the command-line tools or GUI without writing code.
  • Create reproducible simulation notebooks in Jupyter for documentation, teaching, or collaborative engineering analysis.
  • Share FMU simulations with non-technical stakeholders via the web app without requiring them to install Python or specialized tools.
  • Compile and debug C code FMUs using generated CMake projects for model development and validation.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

FMPy simulates Functional Mock-up Units (FMUs) conforming to FMI 1.0, 2.0, and 3.0 standards, supporting both Co-Simulation and Model Exchange modes via Python, command-line, GUI, or web interface.

Yes, with conditions. FMPy is actively maintained, has low install friction, and is the standard Python tool for FMI simulation. However, verify the license terms before use—the metadata shows 'unclear' treatment with no published SPDX identifier. If you work with FMU-based models or need FMI standard compliance in Python, this is the right choice; otherwise, it is not applicable.

Install

fmpy on PyPI

pip

pip install fmpy

uv

uv add fmpy

poetry

poetry add fmpy

Installing FMPy

Before you install

Low install friction with a pure-wheel distribution. Active maintenance with a release dated 2026-08-13. Requires Python 3.10 or later and brings in 8 runtime dependencies including numpy, lxml, and cmake for C code compilation support.

License in practice

License treatment is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms before use in proprietary or restricted contexts.

Quickstart

pip install fmpy[complete]

from fmpy import simulate_fmu, dump
fmu = 'Rectifier.fmu'
info = dump(fmu)
result = simulate_fmu(fmu)

Requires Python 3.10 or later. FMU files must be obtained separately (e.g., from the FMI cross-check repository).

Verify before relying

  • Actual license terms and restrictions—metadata shows 'unclear' treatment with no SPDX or raw license field.
  • Whether cmake and C compilation toolchain are required for all use cases or only for compiling C code FMUs.

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 8 — attrs, cmake, jinja2, lark, lxml, msgpack, nbformat, numpy
Maintenance actively maintained — 1 days since the last release
First released
Downloads 210,102/month — #9,504 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fmpy-0.3.31-py3-none-any.whl

Tags

FMU simulation Pythonfunctional mock-up unitFMI standard simulatorco-simulation model exchangeFMU command line toolFMU graphical interfaceFMU Jupyter notebook
simulationfmi-standardmodeling

More Scientific/Engineering packages