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.
- Please file bug reports and/or feature requests as GitHub issues
- Suggest code changes by creating a pull request
- For any other questions, comments or inquiries, get in touch
Metadata
Release files for inhumate-rti 3.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| inhumate_rti-3.0.7.tar.gz | 31.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| inhumate_rti-3.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.2 kB
Release files / inhumate_rti-3.0.7.tar.gz
| Download URL | inhumate_rti-3.0.7.tar.gz |
|---|---|
| Size | 31.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
274f75eab959d2b37c21b9a7d95d05049877ea4b6c61546aea95c395b2a1c16f
|
|
BLAKE2b-256 checksum How to use checksums |
8e0e291bed9074b9be3bd486bf489f5f7827ea688933d18f75f98eac9c691b1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Release files / inhumate_rti-3.0.7-py3-none-any.whl
| Download URL | inhumate_rti-3.0.7-py3-none-any.whl |
|---|---|
| Size | 47.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0e92018c3687f0248c04fb4021115c2ad4dcdb538063ecf7b0ed5a1f35526f0
|
|
BLAKE2b-256 checksum How to use checksums |
02530f05c2d5f9f8493e77c8166d97572a342627afc917ea1eca7ba6bbb790b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|