OpenModelica-Python API Interface
Project description
OMPython
OMPython is a Python interface that uses ZeroMQ or CORBA (omniORB) to communicate with OpenModelica.
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:
python -m pip install -U https://github.com/OpenModelica/OMPython/archive/master.zip
Windows
Install the version packed with your OpenModelica installation by running:
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 <OMPythonPath>
, run:
cd <OMPythonPath>
python -m pip install -U .
Usage
Running the following commands should get you started
import OMPython
help(OMPython)
from OMPython import OMCSessionZMQ
omc = OMCSessionZMQ()
omc.sendExpression("getVersion()")
or read the OMPython documentation online.
Bug Reports
- See OMPython bugs on the OpenModelica trac or submit a new ticket.
- Pull requests are welcome.
Contact
- Adeel Asghar, adeel.asghar@liu.se
- Arunkumar Palanisamy, arunkumar.palanisamy@liu.se
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
OMPython-3.6.0.tar.gz
(27.7 kB
view details)
File details
Details for the file OMPython-3.6.0.tar.gz
.
File metadata
- Download URL: OMPython-3.6.0.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b423bd9bab64a8224e029994fe98f833773d761998c878d5e69aa6e66b171ef |
|
MD5 | cc0d454b807fc75cfcb69333175225c3 |
|
BLAKE2b-256 | 08fe9d54052f772ce6292687107d3bd5c4cb39f35f6b1b36e694cdf0bf54430b |