Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

openrois-interfaces

Python

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
  • function is the RoSO class of the component. actuation components are bound by one client at a time, sensing and function components 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 (Any for 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.0a6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openrois-interfaces 0.1.0a6
File Size Uploaded Provenance Actions
openrois_interfaces-0.1.0a6.tar.gz 100.8 kB With provenance Details for openrois_interfaces-0.1.0a6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openrois-interfaces 0.1.0a6
File Interpreter ABI Platform Actions
openrois_interfaces-0.1.0a6-py3-none-any.whl Python 3 none any Details for openrois_interfaces-0.1.0a6-py3-none-any.whl

Total release size: 155.7 kB

Release files / openrois_interfaces-0.1.0a6.tar.gz

Download URL openrois_interfaces-0.1.0a6.tar.gz
Size 100.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3008b2d023ef478758ef601c9d319ce15bb801d64f5e1a1c33788062fa780892
BLAKE2b-256 checksum
How to use checksums
e234e97ea0bf0b38743b26281b87a7480e259530fc43dd59922cde736da29e92
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 6, 2026.

Transparency log

Release files / openrois_interfaces-0.1.0a6-py3-none-any.whl

Download URL openrois_interfaces-0.1.0a6-py3-none-any.whl
Size 55.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
874a7533405a89c44acd99e1931be0051d73616558fc39640cc09596e5522e51
BLAKE2b-256 checksum
How to use checksums
62b44716bfcdd2421388ce96e6b1be22bada757044ca679c846b90e2790671a9
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 6, 2026.

Transparency log

Security for openrois-interfaces 0.1.0a6

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.

Select from 2 files

Attestation for openrois_interfaces-0.1.0a6.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 6, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page