Skip to main content

A Python library for reading and parsing Functional Mock-up Interface model description XML file.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

mdreader

A Python library for reading and parsing Functional Mock-up Interface (FMI2.0 currently) model description XML file.

Pydantic models are used to represent the structure of the model description, providing type validation and easy access to model information.

Installation

It is suggested to add mdreader to your pyproject.toml with uv by running:

uv add mdreader

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

Other installation options

Option 1: Add mdreader to an existing virtual environment with uv

uv pip install mdreader

Option 2: Add mdreader with pip

pip install -U mdreader

Getting started

from mdreader.fmi2 import read_model_description

# Read from XML file
md = read_model_description("path/to/modelDescription.xml")

# Read from FMU file
md = read_model_description("path/to/model.fmu")

# Read from an unzipped fmu directory containing modelDescription.xml
md = read_model_description("path/to/directory")

Features

  • Parse FMI 2.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)
  • Access unit definitions and type definitions
  • Support for both Model Exchange and Co-Simulation interfaces
  • Parse model structure, dependencies, and experiment configurations

Related projects

Why another FMI model description reader?

  • Lightweight: mdreader only depends on Pydantic
  • De/Serialization: Pydantic models support easy serialization to/from JSON, dict, etc.
  • Validation: mdreader uses Pydantic models to ensure the integrity of the parsed data
  • FMI version exclusive: The fmi2.FMIModelDescription class is specific to FMI 2.0 (not a mix of FMI1/2/3), making it simpler to use for that version

Licensing

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdreader-0.1.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdreader-0.1.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file mdreader-0.1.0.tar.gz.

File metadata

  • Download URL: mdreader-0.1.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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}

File hashes

Hashes for mdreader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e5447c7bc500afd782fa1e25f2ee3d8eb3405d95635eba87ecfadc9804949008
MD5 587c13ac39e5023aba0638ced542d9d6
BLAKE2b-256 201ad57526e411b1f16bcb8f86ed61901dee03bc132e9cc73385ce45d8ad9d41

See more details on using hashes here.

File details

Details for the file mdreader-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mdreader-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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}

File hashes

Hashes for mdreader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb30f2046f77ef23c2fd0b8321ccba2b00398effa325506cc6732509b1b60a32
MD5 9bc08313350097c662894082cc693ac1
BLAKE2b-256 4b0a7ef23819e03e7d370486644b36576f346a1575b8c9b28c3a97c46fb46955

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page