openrois-interfaces
Transport-independent RoIS Framework 2.0 interface types for Python.
This package is the single source of truth for all OpenRoIS types. The Pydantic models
authored here are exported to JSON Schema (interfaces/schema/) and generated into
C# and TypeScript. Never edit the
generated stacks by hand.
Install
Alpha, pre-1.0, unstable API.
pip install openrois-interfaces
To work on the package itself, from a clone of the repository:
pip install -e ./interfaces/python
Usage
from openrois.interfaces.hri import Result, ReturnCode
result = Result(name="number", data_type_ref="int", value="3")
code = ReturnCode.OK
Engines and clients exchange the params and result models of the method catalog:
from openrois.interfaces.catalog import SearchParams, SearchResult
from openrois.interfaces.condition import component_ref
params = SearchParams(condition=component_ref("robot_1/navigation"))
result = SearchResult.model_validate({"return_code": "OK", "component_ref_list": []})
Components are written with openrois-components-core,
and openrois-engine hosts them.
Component Profiles
A RoIS component publishes a profile: its name and type, the commands it accepts, the queries it answers, the events it sends and the parameters you can get and set. The OMG specification writes profiles in XML. You do not need to read or write that XML: this package gives you the profiles as Python objects and produces the XML when something asks for it.
The 18 Standard Types
Every component type the specification defines has a constant, from ROIS_COMMON_PROFILE
to VIDEO_STREAMING_PROFILE. Pick the one your component implements:
from openrois.interfaces.components import NAVIGATION_PROFILE
[p.name for p in NAVIGATION_PROFILE.parameter_profiles]
# ['target_positions', 'time_limit', 'routing_policy']
Each constant already lists the start, stop, suspend, resume and component_status messages
every basic component shares, and carries the RoSO function (sensing, actuation or
function) that tells the engine how many clients may bind the component at once.
Your Own Component Type
When no standard type fits, declare your own. This is the wheelchair of Annex C of the specification:
from openrois.interfaces.declaration import (
Command, ComponentDeclaration, Event, Param, Query,
)
status = [Param("brake_status", "Boolean"), Param("wc_status", "String")]
WHEELCHAIR = ComponentDeclaration(
identifier="urn:x-rois:def:component:ACME::Wheelchair",
name="wheelchair",
function="actuation",
commands=[Command("brake", arguments=[Param("status", "Boolean")])],
queries=[Query("wc_status_change", results=status)],
events=[Event("wc_status_change", results=status)],
parameters=[Param("preferred_max_speed", "Double"), Param("mode", "String", default="Tag")],
)
profile = WHEELCHAIR.profile() # an HRIComponentProfile, with start, stop, ... included
xml = WHEELCHAIR.to_xml() # the RoIS XML profile, as bytes
functionis the RoSO class of the component.actuationcomponents are bound by one client at a time,sensingandfunctioncomponents by every client that asks.- The component includes RoIS_Common unless you pass
sub_profiles=()or other URNs. - A query and an event may share a name. Any type code is accepted, and
openrois.interfaces.type_codes.python_type()tells you the Python type of a code (Anyfor one it does not know). Param(..., read_only=True)marks a parameter that clients can get but not set.
Reading and Writing the XML
openrois.interfaces.xmlcodec reads and writes the XML forms when you need them, for
example to load a vendor's profile file or to hand a profile to another RoIS
implementation:
from pathlib import Path
from openrois.interfaces.components import standard_registry
from openrois.interfaces.xmlcodec import read_component_profile, write_component_profile
registry = standard_registry()
profile = read_component_profile(Path("Wheelchair.xml"), registry=registry)
xml = write_component_profile(profile, registry=registry)
The registry resolves the profiles a file includes by reference, such as RoIS_Common. The
module also reads and writes engine profiles and the command unit sequences of execute.
Module Structure
| Module | Contents |
|---|---|
openrois.interfaces.hri |
Core HRI types: ReturnCode, Result, Parameter, Argument, CommandUnit, CommandUnitSequence |
openrois.interfaces.common |
ComponentStatus, StreamStatus |
openrois.interfaces.service |
Params of the engine notifications: NotifyErrorParams, CompletedParams, NotifyEventParams, ProfileChangedParams, with CompletedStatus and ErrorType |
openrois.interfaces.profiles |
Component and engine profile models |
openrois.interfaces.values |
encode_value and decode_value, the string form of a typed value in Result.value, Parameter.value and Argument.value |
openrois.interfaces.condition |
The CQL2-Text subset every condition uses: parse_condition, Condition, the component_ref and component_type properties, and the eq, like, all_of, quote, component_ref, component_type and component_type_urn builders |
openrois.interfaces.catalog |
Service-side method catalog: params and result models for every rois.* method, the SystemIF, CommandIF, QueryIF and EventIF protocols, the method and notification tables, the EXTENSIONS registry, JsonRpcErrorCode |
openrois.interfaces.components |
The profile constants of the 18 standard component types (NAVIGATION_PROFILE, ...), standard_registry(), and per-component typed message models |
openrois.interfaces.declaration |
ComponentDeclaration, Command, Query, Event and Param, for a component type of your own |
openrois.interfaces.xmlcodec |
The RoIS XML reader and writer for component profiles, engine profiles and command unit sequences, and ProfileRegistry |
openrois.interfaces.type_codes |
python_type(), the Python type of a data_type_ref code |
Development
pip install -e ".[dev]"
pytest # tests, including the schema drift check
mypy src/ # type check
ruff check src/ # lint
python scripts/export_schema.py # regenerate the JSON Schema
Some tests cross-check the models against the normative RoIS machine-readable files, which
are not redistributed here. Those tests are skipped unless OPENROIS_NORMATIVE_DIR points
to a local copy of the OMG RoIS Framework 2.0 machine-readable files.
After regenerating the schema, regenerate the other two stacks as described in AGENTS.md.
The standard profile constants in components/standard_profiles.py are generated from the
same normative files. Regenerate them, or check that they are current, with:
OPENROIS_NORMATIVE_DIR=/path/to/machine-readable python tools/generate_profiles.py
OPENROIS_NORMATIVE_DIR=/path/to/machine-readable python tools/generate_profiles.py --check
License
Apache-2.0.
Metadata
Release files for openrois-interfaces 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openrois_interfaces-0.1.0.tar.gz | 100.9 kB | With provenance | Details for openrois_interfaces-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openrois_interfaces-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for openrois_interfaces-0.1.0-py3-none-any.whl |
Total release size: 155.9 kB
Release files / openrois_interfaces-0.1.0.tar.gz
| Download URL | openrois_interfaces-0.1.0.tar.gz |
|---|---|
| Size | 100.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1df6d8b03c9db62c7b2b31d87e82426c8730405a8049eeaf85b221af9ea6db8f
|
|
BLAKE2b-256 checksum How to use checksums |
9d7e9ecb31071a30c51f915f4fee6a8e4fc2729a4128d746684bf559fe2b7c48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logRelease files / openrois_interfaces-0.1.0-py3-none-any.whl
| Download URL | openrois_interfaces-0.1.0-py3-none-any.whl |
|---|---|
| Size | 55.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
919a58de648bb3ec938d7ffc91cdc56229ff75365bdab6ffdb0dc7ce59b62f77
|
|
BLAKE2b-256 checksum How to use checksums |
31bb4989e435691d2caa648177b8c11ecae1e9c00c419b4982e082c89b542d0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logSecurity for openrois-interfaces 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for openrois_interfaces-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.