Skip to main content

Inhumate RTI Client

Project description

Inhumate RTI Client for Python

This is the Python client for the Inhumate RTI (RunTime Infrastructure), part of the Inhumate Suite.

See the Inhumate Suite documentation for more in-depth topics and an overview of the software suite.

Installing

pip install inhumate-rti

Quick Start

import inhumate_rti as RTI

rti = RTI.Client(application="Python RTI App")
rti.wait_until_connected()

def on_connect():
    print("Connected")
rti.on("connect", on_connect)

def on_hello(content): 
    print(f"Received: {content}")
rti.subscribe_text("hello", on_hello)

rti.publish_text("hello", "Hello World!")

Note that the Python client is multi-threaded by default. subscribe callbacks are called from a separate receive thread. Depending on your use case, you might want to use the single-threaded pattern and main_loop constructor argument:

import inhumate_rti as RTI

def main_loop():
    print("." if rti.connected else "x", end="", flush=True)
    if rti and rti.connected: rti.publish_text("foo", "bar")

# connect after initializing, otherwise 'rti' will be undefined in the main loop
rti = RTI.Client(application="Python RTI App", main_loop=main_loop, main_loop_idle_time=1.0)
rti.connect() # blocks further execution

For a more complete usage example, see usage_example.py and usage_example_main_loop.py.

Running tests

Clone the project from GitHub, and in the python folder:

python -m virtualenv .venv
. .venv/bin/activate
pip install -r inhumate_rti/requirements.txt 
pip install -r test/requirements.txt
pytest

Feedback & Contributing

Feedback and contributions of any kind are welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inhumate_rti-2.0.7.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inhumate_rti-2.0.7-py3-none-any.whl (59.8 kB view details)

Uploaded Python 3

File details

Details for the file inhumate_rti-2.0.7.tar.gz.

File metadata

  • Download URL: inhumate_rti-2.0.7.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for inhumate_rti-2.0.7.tar.gz
Algorithm Hash digest
SHA256 114cc23400a674630150f0492fe19a4edfc9937c6fcf9b45d7b8d0fdf58aafcc
MD5 88de687c62a44100501f48d681f4b715
BLAKE2b-256 b38bdc084607813b7940842b48a24a24bb51aabaf03e2be0d2127665ef7d06d8

See more details on using hashes here.

File details

Details for the file inhumate_rti-2.0.7-py3-none-any.whl.

File metadata

  • Download URL: inhumate_rti-2.0.7-py3-none-any.whl
  • Upload date:
  • Size: 59.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for inhumate_rti-2.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 80c002c914e95e3805da5d8e55ea4a63a4d34071e72c3eee3b3c2c15a447bf7d
MD5 e598ee7a98802305fd2ebaeb39844f1d
BLAKE2b-256 c8bf6489b91e9e9f82a467e9fc98fccbe5e83383686c48d9c3067c06d4f6ce97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page