Python library for NXP Edge AI Industrial Platform
Project description
AI Box Library
Python library for the NXP Edge AI Industrial Platform.
Overview
ai-box-lib provides thin clients for component-to-component communication:
DataCollectorClientfor publishing collector payloadsPreProcessorClientfor subscribing collector payloads and publishing featuresContextEngineClientfor publishing context messages
Installation
Install from PyPI:
pip install ai-box-lib
Quick Start
1) Publish data from a data collector
from ai_box_lib.data_collector_client import DataCollectorClient
client = DataCollectorClient[dict]()
client.connect()
client.publish_timestream({"random_number": "42"})
2) Subscribe and publish from a pre-processor
from ai_box_lib.pre_processor_client import PreProcessorClient
client = PreProcessorClient[dict, dict]()
client.connect()
def handle_raw(message: dict) -> None:
processed = {"feature_a": [1.0, 2.0, 3.0]}
client.publish_data(processed)
unsubscribe = client.subscribe_timestream(handle_raw)
3) Publish context output
from ai_box_lib.context_engine_client import ContextEngineClient
client = ContextEngineClient[dict]()
client.connect()
client.publish_data({"state": "ok"})
API Summary
DataCollectorClient.publish_timestream(data)DataCollectorClient.publish_audio(data)PreProcessorClient.subscribe_timestream(handler)PreProcessorClient.subscribe_audio(handler)PreProcessorClient.publish_data(data)ContextEngineClient.publish_data(data)
Validation and Limits
- Clients must call
connect()before publish/subscribe operations. DataCollectorClientvalidates message keys againstCHANNELS.PreProcessorClientvalidates feature keys and feature shapes againstFEATURES.- Maximum publish payload size is 2 MB.
License
See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ai_box_lib-0.1.9.tar.gz
(10.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_box_lib-0.1.9.tar.gz.
File metadata
- Download URL: ai_box_lib-0.1.9.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
858e12a5c076375cc526b933b483e9784b469a11e79fbf05c8e7b7dd5c60c0b7
|
|
| MD5 |
709d0f6a66c71ea8c5d8a4ebc13a1d39
|
|
| BLAKE2b-256 |
a8acbe57cbfd6b68bfc1e0210ffcdd537dd900224354bdcc6759ca219d4cf520
|
File details
Details for the file ai_box_lib-0.1.9-py3-none-any.whl.
File metadata
- Download URL: ai_box_lib-0.1.9-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af558aa63b2adef8fd5b28ee600103ebaae4a9141a85f5f313049501cbce7ed9
|
|
| MD5 |
3fcc1fd04559c3b6db83371f97ec442a
|
|
| BLAKE2b-256 |
fbb4a117638137f49426bbc5a3d3b46fb509d5dc9d22bf03ac4b4799afc6d31f
|