{"id":13656020,"url":"https://github.com/CATIA-Systems/FMPy","last_synced_at":"2025-04-23T17:31:00.135Z","repository":{"id":37431442,"uuid":"91576871","full_name":"CATIA-Systems/FMPy","owner":"CATIA-Systems","description":"Simulate Functional Mockup Units (FMUs) in Python","archived":false,"fork":false,"pushed_at":"2025-04-10T15:06:01.000Z","size":16138,"stargazers_count":476,"open_issues_count":106,"forks_count":122,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-04-10T16:44:42.350Z","etag":null,"topics":["fmi","fmi-standard","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CATIA-Systems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-17T12:59:50.000Z","updated_at":"2025-04-10T15:06:05.000Z","dependencies_parsed_at":"2023-02-05T20:02:36.056Z","dependency_job_id":"6f1a4d2a-7159-4a60-978e-9773e7f6a7f5","html_url":"https://github.com/CATIA-Systems/FMPy","commit_stats":{"total_commits":763,"total_committers":5,"mean_commits":152.6,"dds":0.07208387942332894,"last_synced_commit":"c3ed274f06d844df92ec3b9f00f52fc519485648"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CATIA-Systems%2FFMPy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CATIA-Systems%2FFMPy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CATIA-Systems%2FFMPy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CATIA-Systems%2FFMPy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CATIA-Systems","download_url":"https://codeload.github.com/CATIA-Systems/FMPy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250480343,"owners_count":21437526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fmi","fmi-standard","python"],"created_at":"2024-08-02T04:00:46.164Z","updated_at":"2025-04-23T17:30:55.123Z","avatar_url":"https://github.com/CATIA-Systems.png","language":"Python","readme":"[![Build Status](https://dev.azure.com/CATIA-Systems/FMPy/_apis/build/status/CATIA-Systems.FMPy?branchName=develop)](https://dev.azure.com/CATIA-Systems/FMPy/_build/latest?definitionId=1\u0026branchName=develop)\r\n[![PyPI](https://img.shields.io/pypi/dm/FMPy.svg?label=PyPI%20downloads)](https://pypi.org/project/FMPy/)\r\n[![Conda](https://img.shields.io/conda/dn/conda-forge/FMPy.svg?label=Conda%20downloads)](https://anaconda.org/conda-forge/fmpy)\r\n[![Read the Docs](https://readthedocs.org/projects/fmpy/badge/?version=latest)](https://fmpy.readthedocs.io/)\r\n\r\n# FMPy\r\n\r\nFMPy is a free Python library to simulate [Functional Mock-up Units (FMUs)](http://fmi-standard.org/) that...\r\n\r\n- supports FMI 1.0, 2.0, and 3.0\r\n- supports Co-Simulation and Model Exchange\r\n- runs on Windows, Linux and macOS\r\n- has a [command line](#simulate-an-fmu-on-the-command-line), [graphical user interface](#start-the-graphical-user-interface), and [web app](#start-the-web-app)\r\n- creates [Jupyter Notebooks](#create-a-jupyter-notebook)\r\n- compiles C code FMUs and generates [CMake](https://cmake.org/) projects for debugging\r\n\r\n## Installation\r\n\r\nSeveral options are available:\r\n\r\n- Install with conda: `conda install -c conda-forge fmpy`\r\n- Install with from PyPI: `python -m pip install fmpy[complete]`\r\n- [Install a development build](docs/faq.md)\r\n\r\nIf you don't have Python on your machine you can install [Miniforge](https://github.com/conda-forge/miniforge).\r\n\r\n## Start the Graphical User Interface\r\n\r\nYou can start the FMPy GUI with `python -m fmpy.gui`\r\n\r\n![FMPy GUI](docs/Rectifier_GUI.png)\r\n\r\n## Simulate an FMU in Python\r\n\r\nTo follow this example download `Rectifier.fmu` for your platform by clicking on the respective link:\r\n[Linux](https://github.com/modelica/fmi-cross-check/raw/master/fmus/2.0/cs/linux64/MapleSim/2018/Rectifier/Rectifier.fmu),\r\n[macOS](https://github.com/modelica/fmi-cross-check/raw/master/fmus/2.0/cs/darwin64/MapleSim/2018/Rectifier/Rectifier.fmu),\r\n[Windows](https://github.com/modelica/fmi-cross-check/raw/master/fmus/2.0/cs/win64/MapleSim/2018/Rectifier/Rectifier.fmu).\r\nChange to the folder where you've saved the FMU and open a Python prompt.\r\n\r\n```\r\n\u003e\u003e\u003e from fmpy import *\r\n\u003e\u003e\u003e fmu = 'Rectifier.fmu'\r\n\u003e\u003e\u003e dump(fmu)  # get information\r\n\r\nModel Info\r\n\r\n  FMI Version       2.0\r\n  Model Name        Rectifier\r\n  Description       Model Rectifier\r\n  Platforms         win64\r\n  Continuous States 4\r\n  Event Indicators  6\r\n  Variables         63\r\n  Generation Tool   MapleSim (1267140/1267140/1267140)\r\n  Generation Date   2017-10-04T12:07:10Z\r\n\r\nDefault Experiment\r\n\r\n  Stop Time         0.1\r\n  Step Size         1e-07\r\n\r\nVariables (input, output)\r\n\r\nName                Causality          Start Value  Unit     Description\r\noutputs             output        282.842712474619  V        Rectifier1.Capacitor1.v\r\n\u003e\u003e\u003e result = simulate_fmu(fmu)         # simulate the FMU\r\n\u003e\u003e\u003e from fmpy.util import plot_result  # import the plot function\r\n\u003e\u003e\u003e plot_result(result)                # plot two variables\r\n```\r\n\r\n![Rectifier Result](docs/Rectifier_result.png)\r\n\r\n## Simulate an FMU on the command line\r\n\r\nTo get information about an FMU directly from the command line change to the folder where you've saved the\r\nFMU and enter\r\n\r\n```\r\nfmpy info Rectifier.fmu\r\n```\r\n\r\nSimulate the FMU and plot the results\r\n\r\n```\r\nfmpy simulate Rectifier.fmu --show-plot\r\n```\r\n\r\nGet more information about the available options\r\n\r\n```\r\nfmpy --help\r\n```\r\n\r\n## Create a Jupyter Notebook\r\n\r\nTo create a [Jupyter](https://jupyter.org/) Notebook open an FMU in the FMPy GUI and select `Tools \u003e Create Jupyter Notebook...` or run\r\n\r\n```\r\nfmpy create-jupyter-notebook Rectifier.fmu\r\n```\r\n\r\non the command line and open the notebook in Jupyter with\r\n\r\n```\r\njupyter notebook Rectifier.ipynb\r\n```\r\n\r\n![Web App](docs/Rectifier_Notebook.png)\r\n\r\n## Start the Web App\r\n\r\nThe FMPy Web App is built with [Dash](https://plotly.com/dash/) and a great way to share your FMUs with anyone that has a web browser.\r\nTo start it run\r\n\r\n```\r\npython -m fmpy.webapp Rectifier.fmu\r\n```\r\n\r\non the command line or use `--help` for more options.\r\n\r\n![Web App](docs/Rectifier_WebApp.png)\r\n\r\n## Advanced Usage\r\n\r\nTo learn more about how to use FMPy in you own scripts take a look at the\r\n[coupled_clutches.py](fmpy/examples/coupled_clutches.py),\r\n[custom_input.py](fmpy/examples/custom_input.py) and\r\n[parameter_variation.py](fmpy/examples/parameter_variation.py) examples.\r\n\r\n## Commercial Support\r\n\r\nYou're starting a project, need training or professional support?\r\nOur partners at LTX Simulation are ready to help you.\r\nPlease send an e-mail to support@ltx.de for a quote.\r\n\r\n------------------------------------\r\n\r\n\u0026copy; 2023 Dassault Syst\u0026egrave;mes\r\n","funding_links":[],"categories":["Electronics and Mechanics","FMI 2","Functional Mockup Interface"],"sub_categories":["Version Control","Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCATIA-Systems%2FFMPy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCATIA-Systems%2FFMPy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCATIA-Systems%2FFMPy/lists"}