Interact and script with OpenRocket from Python via JPype, with enhanced capabilities for simulations and computational workflows
Project description
orlab
orlab is a Python module designed to simplify interaction and scripting with OpenRocket from Python. It leverages JPype to bridge Python and Java, enabling seamless control over OpenRocket's functionalities. Currently, it supports access to simulation capabilities given an .ork file, with the goal of future expansion to enable more sophisticated computational engineering workflows.
This project is an evolution of the original orhelper library, which hasn't been maintained recently and is limited in scope. orlab supports current OpenRocket versions (the package root is detected from the jar automatically), reorganizes the code for better structure, and plans to incorporate additional features.
Table of Contents
Prerequisites
Before installing orlab, ensure you have the following installed on your system:
- An OpenRocket jar — the version is detected automatically:
- OpenRocket-24.12.jar or OpenRocket-23.09.jar (both tested; 22.02 and 15.03 also verified working)
- Adoptium JDK 17 LTS (or higher?)
- Download Adoptium JDK
- Other JDK releases (i.e. 22) have been tested and work, but not thoroughly.
- Python version 3.10 or higher
Installation
-
Install the Package
Install orlab using
pip:pip install orlab -
Install Java JDK
See Setting Up the JDK for more details.
-
Download OpenRocket JAR
If you haven't already, download the OpenRocket
.jarfile:-
Direct Download: OpenRocket-24.12.jar
-
Using
wgeton Linux:wget https://github.com/openrocket/openrocket/releases/download/release-24.12/OpenRocket-24.12.jar
-
-
Set the
CLASSPATHEnvironment VariableEnsure that the
CLASSPATHincludes the path to the OpenRocket.jarfile. This step is only necessary if the.jarfile is not located in the current directory.export CLASSPATH=/path/to/OpenRocket-24.12.jarReplace
/path/to/with the actual directory path where the.jarfile is located.
Setting Up the JDK
Linux
-
Install Adoptium JDK 17 LTS
Download and install the Adoptium JDK from the official website. Check the option to set / override
JAVA_HOME, unless you have a specific reason not to in which you will need to defineMANUAL_JVM_PATHin your code. -
Set the
JAVA_HOMEEnvironment VariableIf JPype doesn't automatically detect the JDK, manually set the
JAVA_HOMEenvironment variable:-
Find Installation Directory:
Locate where Adoptium JDK is installed, e.g.,
/usr/lib/jvm/adoptium-17. -
Edit
~/.bashrc:Open the
.bashrcfile with your preferred text editor:nano ~/.bashrc -
Add the Following Line:
export JAVA_HOME="/usr/lib/jvm/adoptium-17" -
Apply Changes:
source ~/.bashrc
-
Windows
-
Install Adoptium JDK 17 LTS
Download and install the Adoptium JDK from the official website.
-
Set Environment Variables
-
Open Environment Variables Settings:
Navigate to
Control Panel>System>Advanced system settings>Environment Variables. -
Add
JAVA_HOME:- Click on
Newunder System variables. - Set Variable name to
JAVA_HOME. - Set Variable value to the path where Adoptium JDK is installed, e.g.,
C:\Program Files\Eclipse Adoptium\jdk-17.
- Click on
-
Update
PATH:- Select the
Pathvariable and clickEdit. - Click
Newand add%JAVA_HOME%\bin.
- Select the
-
Apply and Close:
Click
OKto apply the changes.
-
Usage
After installation and setup, you can start using orlab to interact with OpenRocket. Refer to the examples/ directory for sample scripts demonstrating various functionalities. The package must be installed (pip install orlab, or pip install -e . from a clone) before running them — the source now lives under src/ and is not importable from the repository root.
For more detailed information and advanced usage, consult the OpenRocket Wiki on Scripting with Python and JPype.
API docs are a work-in-progress, for now see the examples folder for usage.
Development
If you wish to contribute or modify orlab, follow these steps:
-
Clone the Repository
git clone https://github.com/yourusername/orlab.git cd orlab -
Install Dependencies in Editable Mode
pip install -e . -
Make Your Changes
Modify the codebase as needed. Ensure that your changes are well-documented and tested.
-
Run Tests
(Assuming tests are set up)
pytest -
Submit a Pull Request
Push your changes to a forked repository and submit a pull request for review.
Credits
- The original orhelper project by SilentSys
- All contributors to the OpenRocket project over the years
Feel free to contribute, report issues, or suggest enhancements!
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file orlab-0.4.0.tar.gz.
File metadata
- Download URL: orlab-0.4.0.tar.gz
- Upload date:
- Size: 290.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92a5bbaf1600500e13ec988650d2dbcf3495ef85de5341e03234d5f452d1baf7
|
|
| MD5 |
baa5e86c4ea9f7a0469f8794243e0d5d
|
|
| BLAKE2b-256 |
2f25dc22da2e03a13b948447d569993bc4fca0a1e81520c40a648b69e399f9f4
|
Provenance
The following attestation bundles were made for orlab-0.4.0.tar.gz:
Publisher:
release.yml on CameronBrooks11/orlab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orlab-0.4.0.tar.gz -
Subject digest:
92a5bbaf1600500e13ec988650d2dbcf3495ef85de5341e03234d5f452d1baf7 - Sigstore transparency entry: 2188267879
- Sigstore integration time:
-
Permalink:
CameronBrooks11/orlab@3e61f722900441bda298ca2b6b110db8b7d463f4 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CameronBrooks11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3e61f722900441bda298ca2b6b110db8b7d463f4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file orlab-0.4.0-py3-none-any.whl.
File metadata
- Download URL: orlab-0.4.0-py3-none-any.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd7c1a62ffdf862cd2b1b7883d45f929497a43e1e533ef03d77be1ecb14b1831
|
|
| MD5 |
b89ad5cfda114d6113a1ae4c064a77f9
|
|
| BLAKE2b-256 |
5a44cba39bfae08bda78f7fca9936faa6903b3f37bfd3a5a7ff52a3916a9c307
|
Provenance
The following attestation bundles were made for orlab-0.4.0-py3-none-any.whl:
Publisher:
release.yml on CameronBrooks11/orlab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orlab-0.4.0-py3-none-any.whl -
Subject digest:
dd7c1a62ffdf862cd2b1b7883d45f929497a43e1e533ef03d77be1ecb14b1831 - Sigstore transparency entry: 2188267903
- Sigstore integration time:
-
Permalink:
CameronBrooks11/orlab@3e61f722900441bda298ca2b6b110db8b7d463f4 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CameronBrooks11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3e61f722900441bda298ca2b6b110db8b7d463f4 -
Trigger Event:
release
-
Statement type: