Skip to main content

fmureader 📖

A Python library for reading and parsing Functional Mock-up Interface (FMI 2.0 and 3.0) model description XML files into Pydantic models.

PyPI version

Installation 📦

Add fmureader to your pyproject.toml with uv with:

uv add fmureader

To install uv, see https://docs.astral.sh/uv/getting-started/installation/

How to use 🚀

To read and parse an FMI model description (works for both 2.0 and 3.0):

import fmureader.fmi2 as fmi2
import fmureader.fmi3 as fmi3

# Read from XML file
md = fmi2.read_model_description("path/to/fmi2/modelDescription.xml")  # or fmi3.read_model_description for 3.0
# Read from FMU archive
md = fmi2.read_model_description("path/to/model.fmu")  # or fmi3.read_model_description for 3.0

# Read from unzipped FMU directory
md = fmi2.read_model_description("path/to/unzipped/fmu/directory")  # or fmi3.read_model_description for 3.0

print(md)

Features ✨

  • Parse FMI 2.0 and 3.0 model description XML files
  • Read model information from FMU archives
  • Access model metadata (name, version, author, GUID, etc.)
  • Extract variable definitions (real, integer, boolean, string, enumeration, clock, binary)
  • Access unit definitions and type definitions
  • Support for Model Exchange, Co-Simulation, and Scheduled Execution interfaces
  • Parse model structure, dependencies, and experiment configurations
  • Full support for FMI 3.0 features including structural parameters, clock variables, and directional derivatives

Why another FMI model description reader? 🤔

  • Lightweight: fmureader only depends on Pydantic
  • De/Serialization: Pydantic models support easy serialization to/from JSON, dict, etc.
  • Validation: fmureader uses Pydantic models to ensure the integrity of the parsed data
  • FMI version specific: The fmi2.FMIModelDescription and fmi3.FMIModelDescription classes are specific to their respective FMI versions (not a mix of versions), making it simpler to use for each version

Related projects 🔗

  • fmpy: A similar read_model_description function is available in FMPy, but it uses custom classes instead of Pydantic models and has more dependencies.

Licensing 📄

The code in this project is licensed under MIT license. See the LICENSE file for details.

Release files for fmureader 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fmureader 0.1.2
File Size Uploaded
fmureader-0.1.2.tar.gz 33.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fmureader 0.1.2
File Interpreter ABI Platform
fmureader-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 68.3 kB

Release files / fmureader-0.1.2.tar.gz

Download URL fmureader-0.1.2.tar.gz
Size 33.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bd41e95b44756db77c7acbc5bfed6999a7d8044be1c63cce0ac0a437cfaaff3e
BLAKE2b-256 checksum
How to use checksums
8b7770b7f070787939ef69949f0c41a6de1c74cfcef78272168d47f313d63b8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fmureader-0.1.2-py3-none-any.whl

Download URL fmureader-0.1.2-py3-none-any.whl
Size 35.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fed1371da75075f89ce1be9d442004328d4917a87323da358dc1504c165149d4
BLAKE2b-256 checksum
How to use checksums
b4bdf49f2fde47ea31f8fe7cf2b8d8af64f1e7695f1504adf0a73fe3a77def07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page