diff --git a/README.md b/README.md index 267d0d9..348c099 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,22 @@ -# mdreader +# mdreader 📖 -A Python library for reading and parsing Functional Mock-up Interface (FMI2.0 currently) model description XML file. +A Python library for reading and parsing Functional Mock-up Interface (FMI2.0 currently) model description XML file into Pydantic models. -Pydantic models are used to represent the structure of the model description, providing type validation and easy access to model information. +[![PyPI version](https://badge.fury.io/py/mdreader.svg)](https://badge.fury.io/py/mdreader) -## Installation +## Installation 📦 -It is suggested to add `mdreader` to your `pyproject.toml` with `uv` by running: +Add `mdreader` to your `pyproject.toml` with `uv` with: -``` +``` bash 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 -``` +## How to use 🚀 -## Getting started +To read and parse an FMI 2.0 model description: ```python from mdreader.fmi2 import read_model_description @@ -36,14 +24,16 @@ from mdreader.fmi2 import read_model_description # Read from XML file md = read_model_description("path/to/modelDescription.xml") -# Read from FMU file +# Read from FMU archive md = read_model_description("path/to/model.fmu") -# Read from an unzipped fmu directory containing modelDescription.xml -md = read_model_description("path/to/directory") +# Read from unzipped FMU directory +md = read_model_description("path/to/unzipped/fmu/directory") + +print(md) ``` -## Features +## Features ✨ - Parse FMI 2.0 model description XML files - Read model information from FMU archives @@ -53,18 +43,18 @@ md = read_model_description("path/to/directory") - Support for both Model Exchange and Co-Simulation interfaces - Parse model structure, dependencies, and experiment configurations -## Related projects - -* [fmpy](https://github.com/CATIA-Systems/FMPy) - -## Why another FMI model description reader? +## 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 +## Related projects 🔗 + +* [fmpy](https://github.com/CATIA-Systems/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](LICENSE) file for details.