Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openmodelica/ompython
A Python interface to OpenModelica communicating via CORBA or ZeroMQ
https://github.com/openmodelica/ompython
Last synced: 38 minutes ago
JSON representation
A Python interface to OpenModelica communicating via CORBA or ZeroMQ
- Host: GitHub
- URL: https://github.com/openmodelica/ompython
- Owner: OpenModelica
- License: other
- Created: 2015-04-28T06:59:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-12-17T08:39:36.000Z (26 days ago)
- Last Synced: 2025-01-04T20:05:51.138Z (7 days ago)
- Language: Python
- Homepage:
- Size: 8.88 MB
- Stars: 109
- Watchers: 29
- Forks: 58
- Open Issues: 43
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# OMPython
OMPython is a Python interface that uses ZeroMQ or CORBA (omniORB) to
communicate with OpenModelica.[![FMITest](https://github.com/OpenModelica/OMPython/actions/workflows/FMITest.yml/badge.svg)](https://github.com/OpenModelica/OMPython/actions/workflows/FMITest.yml)
[![Test](https://github.com/OpenModelica/OMPython/actions/workflows/Test.yml/badge.svg)](https://github.com/OpenModelica/OMPython/actions/workflows/Test.yml)## Dependencies
### Using ZeroMQ
- Python 2.7 and 3.x supported
- PyZMQ is required### Using omniORB
- Currently, only Python 2.7 is supported
- omniORB is required:
- Windows: included in the OpenModelica installation
- Linux: Install omniORB including Python 2 support (the omniidl
command needs to be on the PATH). On Ubuntu, this is done by
running
`sudo apt-get install omniorb python-omniorb omniidl omniidl-python`## Installation
Installation using `pip` is recommended.
### Linux
Install the latest OMPython master by running:
```bash
python -m pip install -U https://github.com/OpenModelica/OMPython/archive/master.zip
```### Windows
Install the version packed with your OpenModelica installation by running:
```cmd
cd %OPENMODELICAHOME%\share\omc\scripts\PythonInterface
python -m pip install -U .
```### Local installation
To Install the latest version of the OMPython master branch
only, previously cloned into ``, run:```
cd
python -m pip install -U .
```## Usage
Running the following commands should get you started
```python
import OMPython
help(OMPython)
``````python
from OMPython import OMCSessionZMQ
omc = OMCSessionZMQ()
omc.sendExpression("getVersion()")
```or read the [OMPython documentation](https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/ompython.html)
online.## Bug Reports
- See OMPython bugs on the [OpenModelica
trac](https://trac.openmodelica.org/OpenModelica/query?component=OMPython)
or submit a [new
ticket](https://trac.openmodelica.org/OpenModelica/newticket).
- [Pull requests](https://github.com/OpenModelica/OMPython/pulls) are
welcome.## Contact
- Adeel Asghar,
- Arunkumar Palanisamy,