Metadata-Version: 2.4
Name: octapyx
Version: 0.0.16
Summary: Library for creating OCTAS® world XML files through Python.
Project-URL: Homepage, https://gitlab.cc-asp.fraunhofer.de/octas/tools/python/octaspyxml
Project-URL: Issues, https://gitlab.cc-asp.fraunhofer.de/octas/tools/python/octaspyxml/-/issues
Author-email: OCTAS Team <octas@iosb.fraunhofer.de>, Jens Ziehn <jens.ziehn@iosb.fraunhofer.de>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10.0
Requires-Dist: numpy~=2.2.6
Description-Content-Type: text/markdown

# octapyx

A Python framework for writing OCTAS® XML files via Python code.

It imports OCTAS® definitions for steppers and properties, and provides these through Python modules.


<table>
<tr>
<td> Python code written based on octapyx</td> <td> XML file to be opened in OCTAS®</td>
</tr>
<tr>
<td>

```py
import octapyx.oct.world as world
from octapyx.modules.org.octane.oct.ent import Camera
from octapyx.modules.org.octane.oct.prop import Pose, TfTree
from octapyx.modules.org.octane.stdlib import TfTreeStepper

world = world.World()

renderCamera = world.add(
	Camera("renderCamera"))

renderCamera.assign(
	Pose(
		position=[1, 2, 3]))

renderCamera.assign(
	TfTree(
		position=[3, 2, 1]))

tfTreeStepper = world.add(
	TfTreeStepper(
		name="tfTreeStepper"))

tfTreeStepper.registerEntity(
	entity=renderCamera)

tfTreeStepper.step()

world.addToScheduler(tfTreeStepper)

world.write("example.oct.xml")

# Optional: Run OCTAS® directly
# by loading the world.
world.run()

```

</td>
<td>

```xml
<World>
	<!--Generated by octapyx.-->
	<Entity
		ucn="octane.org/oct/ent/Camera"
		name="renderCamera">
		<Property
			ucn="octane.org/oct/prop/Pose"
			position="1 2 3"
			/>
		<Property
			ucn="octane.org/oct/prop/TfTree"
			position="3 2 1"
			/>
	</Entity>
	<Stepper
		ucn="octane.org/stdlib/TfTreeStepper"
		name="tfTreeStepper">
		<registerEntity
			name="renderCamera"
			/>
	</Stepper>
	<Build
		fromStepper="tfTreeStepper" />
	<Scheduler
		ucn="oct/sched/ASyncThreadScheduler">
		<addStepper
			name="tfTreeStepper" />
	</Scheduler>
</World>
```
</td>
</tr>
</table>

In particular, it enables the use of Python control flows (`if`, `for`, ...), libraries and interfaces to generate complex scenes in a flexible, adaptive way.


## Installation

Install the `octapyx` package by running:

```
pip install octapyx
```

or

```
pip install git+https://gitlab.cc-asp.fraunhofer.de/octas/tools/python/octaspyxml
```