A Python library to parse OpenRocket (.ork) XML files, including simulation data.
Project description
OpenRocket Parser
A Python library to parse OpenRocket (.ork) XML files and simulation data into convenient Python objects and pandas DataFrames.
Installing for usage
You can install this library with pip:
# Installing from pypi
pip install openrocket-python-parser
# Latest version
pip install git+https://github.com/AIAA-UTD-Comet-Rocketry/openrocket-python-parser
# Specific branch
pip install git+https://github.com/AIAA-UTD-Comet-Rocketry/openrocket-python-parser.git@branch-name
# Specific Tag
pip install git+https://github.com/AIAA-UTD-Comet-Rocketry/openrocket-python-parser.git@vMAJOR.MINOR.PATCH
Contributing
# 1. Clone the repo
git clone https://github.com/AIAA-UTD-Comet-Rocketry/openrocket-python-parser
# 2. Create a virtual environment
cd openrocket-python-parser
python -m venv .venv
# 3. Activate the environment
# macOS / Linux
source .venv/bin/activate
# Windows
.venv\Scripts\activate.bat
# 4. Set the library as editable, `.` is the root folder of the cloned repo
pip install -e .
# 5. Install additional dependencies
pip install -r requirements.txt
Basic Usage
Here's how to load simulation data from an OpenRocket file:
from openrocket_parser.simulations.loader import load_simulations_from_xml
sims = load_simulations_from_xml('sample.ork')
if sims:
# Get the first simulation
my_sim = sims[0]
print(f"Loaded simulation: {my_sim.name}")
print(f"Time to Apogee: {my_sim.summary.get('timetoapogee')} seconds")
# The flight data is a pandas DataFrame
flight_df = my_sim.flight_data
# Print the max altitude from the time-series data
max_altitude_from_data = flight_df['altitude'].max()
print(f"Max altitude from data: {max_altitude_from_data:.2f} meters")
Tools
Visualizer
The visualizer tools allows to visualize the simulation data in real-time, directly from the simulation results in OpenRocket
Basic Usage
usage: openrocket-visualizer [-h] [--sim SIM] [--speed SPEED] [--no-repeat] file
Animate OpenRocket flight simulation data tool.
positional arguments:
file Path to the OpenRocket (.ork) file.
options:
-h, --help show this help message and exit
--sim SIM The simulation number to visualize (1-based index). Default is 1.
--speed SPEED Playback speed multiplier (e.g., 2 for 2x speed, 0.5 for half speed). Default is 1.0.
--no-repeat Disable the animation from repeating when it finishes.
For convenience, a sample open rocket with basic information can be found in tests/sample.ork
# This runs the sample.ork simulation data at twice the speed, without repeating
# This requires the visualizer tool to be installed
openrocket-visualizer tests/sample.ork --speed 2 --no-repeat
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 openrocket_python_parser-0.2.1.tar.gz.
File metadata
- Download URL: openrocket_python_parser-0.2.1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e02c040b5f79f3563bc73f578b5ada0e399a3792976b311b711746d524ba1f29
|
|
| MD5 |
48487c42c5f76db7724e3e0503221ebc
|
|
| BLAKE2b-256 |
3f1ce71abc76f26e8fa3e5d7ac0180c2bf462b8e225bbbee366bfb166493dc56
|
File details
Details for the file openrocket_python_parser-0.2.1-py3-none-any.whl.
File metadata
- Download URL: openrocket_python_parser-0.2.1-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3208bc6c7ba1eb16b9ef470289ecef9c10464bf5b275d456187eaab041e25660
|
|
| MD5 |
fb7fc2546dbbc26eb25499f6ee791e53
|
|
| BLAKE2b-256 |
64a5266957eed1700d7e8da300b912324589e09ddbe42b55b22ba8981b4b6555
|