viso-sdk-python
viso-sdk-python is a Python SDK providing shared utilities for viso.ai edge containers. It covers logging, the frame bus between containers, MQTT communication, model fetching, ROI handling, detection structures, and more.
Licensed under LGPLv3.
Requirements
- Python >= 3.10
- glibc >= 2.34, x86_64 (iceoryx2 wheels)
- System library:
libmagic1(required by themodelmodule)
apt-get install libmagic1
Installation
pip install viso-sdk-python
2.x replaces Redis with the iceoryx2 frame bus; pin "viso-sdk-python<2" for the Redis-based SDK.
Releases are also uploaded to s3://viso-dev-euc1-codebuild/viso_sdk_python/ (sdist and cp310/cp311/cp312 wheels):
aws s3 cp s3://viso-dev-euc1-codebuild/viso_sdk_python/ dist/ --recursive --exclude "*" --include "viso_sdk_python-2.0.0*"
pip install --find-links dist/ "viso-sdk-python==2.0.0"
Modules
| Module | Description |
|---|---|
viso_sdk.constants |
Shared constants and environment-driven configuration |
viso_sdk.model |
Model fetching, extraction, and type detection |
viso_sdk.logging |
Centralised logger factory |
viso_sdk.ipc |
Frame bus: zero-copy frames between containers (iceoryx2) plus results/triggers/status on local MQTT |
viso_sdk.image |
JPEG/BMP/base64 image encode and decode helpers |
viso_sdk.mqtt |
MQTT client wrapper |
viso_sdk.roi |
Region-of-interest helpers |
viso_sdk.detection |
Detection result structures |
viso_sdk.edge |
Edge device utilities |
viso_sdk.status |
Container status reporting |
viso_sdk.nodered |
Node-RED integration helpers |
Usage Examples
Frame bus
Every output port of a node is an iceoryx2 service viso/<node_id>/<port>. Frames
(uint8 BGR/GRAY/BGRA) and the meta/result JSON travel together through shared
memory; subscribers always get the newest frame. The JSON is mirrored to the local
MQTT topic viso_local/flow/<node_id>/<port>/result for Node-RED.
from viso_sdk.ipc import FramePublisher, FrameSubscriber, VisoData
# producer
viso_data = VisoData(feed_idx=0, cur_node=config)
pub = FramePublisher(node_id=config["id"], port=0, node_config=config)
pub.publish(viso_data.create_viso_data(result=detections), frame)
# or write straight into shared memory (no copy), e.g. while resizing
loaned = pub.loan((480, 640, 3))
cv2.resize(src, (640, 480), dst=loaned.image)
loaned.send(viso_data.create_viso_data(result=[]))
# consumer of the previous node's port
sub = FrameSubscriber(node_id=prev_node["id"], port=prev_port, data_manager=viso_data)
is_new, frame = sub.get_frame() # (False, None) on timeout / end of stream
is_new, frame, data = sub.receive_metadata() # data["meta"], data["result"], data["frame"]
with sub.receive(copy=False) as f: # zero-copy view, valid inside the block
small = cv2.resize(f.image, (640, 640))
pub.close() # sends end-of-stream to subscribers
Triggers from Node-RED:
from viso_sdk.ipc import on_trigger
on_trigger(config["id"], lambda message: handle(message))
All participants must share /dev/shm (podman run --ipc=host), use the same
/etc/iceoryx2/iceoryx2.toml ([global] root-path = "/dev/shm/iceoryx2/") and run as
the same host uid. The QoS in viso_sdk/ipc/qos.py and the header in
viso_sdk/ipc/frame_header.py are shared with viso-sdk-cpp.
MQTT Messaging
from viso_sdk.mqtt import MqttWrapper
# Initialize MQTT client
mqtt = MqttWrapper()
# Publish message
mqtt.publish(topic="device/status", message='{"state": "online"}')
Logging
from viso_sdk.logging import get_logger
logger = get_logger("MyModule")
logger.info("Application started")
logger.error("An error occurred")
Contributing
Contributions are welcome! See CONTRIBUTING.md for development setup, testing guidelines, and CI pipeline information.
License
Licensed under LGPLv3.
Metadata
Release files for viso-sdk-python 2.0.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 |
|---|---|---|---|---|
| viso_sdk_python-2.0.0.tar.gz | 2.8 MB | Without provenance | Details for viso_sdk_python-2.0.0.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| viso_sdk_python-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ x86-64 | Details for viso_sdk_python-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| viso_sdk_python-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ x86-64 | Details for viso_sdk_python-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| viso_sdk_python-2.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.17+ x86-64 | Details for viso_sdk_python-2.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
Total release size: 50.2 MB
Release files / viso_sdk_python-2.0.0.tar.gz
| Download URL | viso_sdk_python-2.0.0.tar.gz |
|---|---|
| Size | 2.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69c4debfd152208a51f81ab98c3888d258b670a74468cbcbda50e8ddbad81941
|
|
BLAKE2b-256 checksum How to use checksums |
25f112e44d2c3166935b5204269d74fa4f958ccc8128c222607bf37597905583
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Release files / viso_sdk_python-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | viso_sdk_python-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 16.1 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
54bf4d73e46d01a9d0e10d40b58376582780c1df1f8a78bc5fee4a15c626f621
|
|
BLAKE2b-256 checksum How to use checksums |
604127ab52171e919ea30110d14727d968f2d1cff5428be95daa615ea350d045
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Release files / viso_sdk_python-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | viso_sdk_python-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 15.9 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
64e748a240b2be1dcc206a3ce8d6d3f100696a81959ea88d6890b7ecd5c28c13
|
|
BLAKE2b-256 checksum How to use checksums |
a3ac408a4c552420fd9c1ab97e806e16361f9f7cd3a9a3f58b4ddbbba91316ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Release files / viso_sdk_python-2.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | viso_sdk_python-2.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 15.4 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
694173ba08f897867513b304d60444ae0113b7e24f575beedbd93a6854223b61
|
|
BLAKE2b-256 checksum How to use checksums |
f8c787fcd943511ee5b22371190c0064e3e4f0fb72dd8a69af5e85c502a658fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Security for viso-sdk-python 2.0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.