# SW Registry Stack Python SDK
[](https://badge.fury.io/py/sw-registry-stack)
[](https://opensource.org/licenses/MIT)
[](https://python.org/)
[](https://github.com/psf/black)
A comprehensive Python SDK for the SW Registry Stack, providing Python interfaces for Operator Registry, Pipeline Registry, Executor, and Recorder operations.
## Installation
```bash
pip install sw-registry-stack
```
For development:
```bash
pip install sw-registry-stack[dev]
```
## Quick Start
### Executor Operations
```python
import asyncio
from sw_registry_stack import Executor
async def main():
# Initialize the executor
executor = Executor(
base_path="/tmp/executor",
bridge_lib_path="/path/to/libexecutor_bridge.so",
debug=True
)
await executor.initialize()
# Create a pipeline
result = await executor.create(
config={
"json_file": "/path/to/pipeline.json",
"background": True
},
device_id="my-device-001",
enable_logging=True,
on_unified_log=lambda entry: print(f"Log: {entry.message} from {entry.source}")
)
if result.status == "success":
print(f"Pipeline created: {result.data.pipeline_id}")
# Start the pipeline
await executor.start(result.data.run_id)
# Stop the pipeline
await executor.stop(result.data.run_id)
# Destroy the pipeline
await executor.destroy(result.data.run_id)
if __name__ == "__main__":
asyncio.run(main())
```
### Unified Logging
The SDK provides structured logging with rich context:
```python
from sw_registry_stack.modules.executor.utils.unified_logging import (
UnifiedLogEntry, LOG_LEVELS, LOG_SOURCES
)
def log_callback(entry: UnifiedLogEntry):
print(f"Log: {entry.message}")
print(f"Level: {entry.level} ({LOG_LEVELS(entry.level).name})")
print(f"Source: {entry.source} ({LOG_SOURCES(entry.source).name})")
print(f"Node: {entry.node_id}")
print(f"Pipeline: {entry.pipeline_id}")
print(f"Data: {entry.data}")
```
### Log Sources
- **NODE (0)**: C++ pipeline nodes
- **EXECUTOR (1)**: Executor core operations
- **PIPELINE (2)**: Pipeline management
- **SDK (3)**: Python SDK operations
- **SYSTEM (4)**: System components
### Log Levels
- **DEBUG (0)**: Detailed debugging information
- **INFO (1)**: General information
- **WARNING (2)**: Warning messages
- **ERROR (3)**: Error conditions
- **CRITICAL (4)**: Critical failures
## API Reference
### Executor
#### `Executor(base_path, bridge_lib_path, debug=False)`
Create a new Executor instance.
**Parameters:**
- `base_path: str` - Base directory for executor operations
- `bridge_lib_path: str` - Path to the native bridge library
- `debug: bool` - Enable debug logging
#### `await executor.initialize()`
Initialize the executor and load the native bridge.
#### `await executor.create(config, device_id=None, enable_logging=False, on_unified_log=None)`
Create a new pipeline.
**Parameters:**
- `config: dict` - Pipeline configuration
- `device_id: str` - Device identifier
- `enable_logging: bool` - Enable unified logging
- `on_unified_log: callable` - Logging callback function
**Returns:** `PipelineCreateResponse`
#### `await executor.start(run_id)`
Start a pipeline execution.
#### `await executor.stop(run_id)`
Stop a pipeline execution.
#### `await executor.destroy(run_id)`
Destroy a pipeline and clean up resources.
Raw data
{
"_id": null,
"home_page": "https://github.com/sw-registry-stack/sdk",
"name": "nexstem-registry-stack",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Vignesh Sambari <vignesh.sambari@nexstem.ai>",
"keywords": "sw-registry-stack, operator-registry, pipeline-registry, executor, recorder, cffi, python, sdk",
"author": "Vignesh Sambari",
"author_email": "Vignesh Sambari <vignesh.sambari@nexstem.ai>",
"download_url": "https://files.pythonhosted.org/packages/13/6c/9ae06da0f731b704a031ca1927bf751f0c57e12a9a036cbf0edbb0c083ce/nexstem_registry_stack-1.0.7.tar.gz",
"platform": null,
"description": "# SW Registry Stack Python SDK\n\n[](https://badge.fury.io/py/sw-registry-stack)\n[](https://opensource.org/licenses/MIT)\n[](https://python.org/)\n[](https://github.com/psf/black)\n\nA comprehensive Python SDK for the SW Registry Stack, providing Python interfaces for Operator Registry, Pipeline Registry, Executor, and Recorder operations.\n\n## Installation\n\n```bash\npip install sw-registry-stack\n```\n\nFor development:\n\n```bash\npip install sw-registry-stack[dev]\n```\n\n## Quick Start\n\n### Executor Operations\n\n```python\nimport asyncio\nfrom sw_registry_stack import Executor\n\nasync def main():\n # Initialize the executor\n executor = Executor(\n base_path=\"/tmp/executor\",\n bridge_lib_path=\"/path/to/libexecutor_bridge.so\",\n debug=True\n )\n \n await executor.initialize()\n \n # Create a pipeline\n result = await executor.create(\n config={\n \"json_file\": \"/path/to/pipeline.json\",\n \"background\": True\n },\n device_id=\"my-device-001\",\n enable_logging=True,\n on_unified_log=lambda entry: print(f\"Log: {entry.message} from {entry.source}\")\n )\n \n if result.status == \"success\":\n print(f\"Pipeline created: {result.data.pipeline_id}\")\n \n # Start the pipeline\n await executor.start(result.data.run_id)\n \n # Stop the pipeline\n await executor.stop(result.data.run_id)\n \n # Destroy the pipeline\n await executor.destroy(result.data.run_id)\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n### Unified Logging\n\nThe SDK provides structured logging with rich context:\n\n```python\nfrom sw_registry_stack.modules.executor.utils.unified_logging import (\n UnifiedLogEntry, LOG_LEVELS, LOG_SOURCES\n)\n\ndef log_callback(entry: UnifiedLogEntry):\n print(f\"Log: {entry.message}\")\n print(f\"Level: {entry.level} ({LOG_LEVELS(entry.level).name})\")\n print(f\"Source: {entry.source} ({LOG_SOURCES(entry.source).name})\")\n print(f\"Node: {entry.node_id}\")\n print(f\"Pipeline: {entry.pipeline_id}\")\n print(f\"Data: {entry.data}\")\n```\n\n### Log Sources\n\n- **NODE (0)**: C++ pipeline nodes\n- **EXECUTOR (1)**: Executor core operations\n- **PIPELINE (2)**: Pipeline management\n- **SDK (3)**: Python SDK operations\n- **SYSTEM (4)**: System components\n\n### Log Levels\n\n- **DEBUG (0)**: Detailed debugging information\n- **INFO (1)**: General information\n- **WARNING (2)**: Warning messages\n- **ERROR (3)**: Error conditions\n- **CRITICAL (4)**: Critical failures\n\n## API Reference\n\n### Executor\n\n#### `Executor(base_path, bridge_lib_path, debug=False)`\n\nCreate a new Executor instance.\n\n**Parameters:**\n- `base_path: str` - Base directory for executor operations\n- `bridge_lib_path: str` - Path to the native bridge library\n- `debug: bool` - Enable debug logging\n\n#### `await executor.initialize()`\n\nInitialize the executor and load the native bridge.\n\n#### `await executor.create(config, device_id=None, enable_logging=False, on_unified_log=None)`\n\nCreate a new pipeline.\n\n**Parameters:**\n- `config: dict` - Pipeline configuration\n- `device_id: str` - Device identifier\n- `enable_logging: bool` - Enable unified logging\n- `on_unified_log: callable` - Logging callback function\n\n**Returns:** `PipelineCreateResponse`\n\n#### `await executor.start(run_id)`\n\nStart a pipeline execution.\n\n#### `await executor.stop(run_id)`\n\nStop a pipeline execution.\n\n#### `await executor.destroy(run_id)`\n\nDestroy a pipeline and clean up resources.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python SDK for SW Registry Stack - Operator Registry, Pipeline Registry, Executor, and Recorder",
"version": "1.0.7",
"project_urls": {
"Bug Tracker": "https://github.com/sw-registry-stack/sdk/issues",
"Documentation": "https://sw-registry-stack.readthedocs.io/",
"Homepage": "https://github.com/sw-registry-stack/sdk",
"Repository": "https://github.com/sw-registry-stack/sdk.git"
},
"split_keywords": [
"sw-registry-stack",
" operator-registry",
" pipeline-registry",
" executor",
" recorder",
" cffi",
" python",
" sdk"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e557600a1e232e1cfce3a35d8e0b9a8222a10397115e76daa42c29388641d414",
"md5": "218cd57df77e618724bfb3feeb9a644c",
"sha256": "d08635afbe5d822226cbc67ab892957d81287a91311dde26be085d9949de7ea6"
},
"downloads": -1,
"filename": "nexstem_registry_stack-1.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "218cd57df77e618724bfb3feeb9a644c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 138718,
"upload_time": "2025-11-02T22:19:01",
"upload_time_iso_8601": "2025-11-02T22:19:01.004979Z",
"url": "https://files.pythonhosted.org/packages/e5/57/600a1e232e1cfce3a35d8e0b9a8222a10397115e76daa42c29388641d414/nexstem_registry_stack-1.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "136c9ae06da0f731b704a031ca1927bf751f0c57e12a9a036cbf0edbb0c083ce",
"md5": "6d61307bc6abc3d1bed20a0b0314851b",
"sha256": "545b88f2832410b9cd381dfe4adc4e02c387056128ee6d0d10ff9c4da230dee3"
},
"downloads": -1,
"filename": "nexstem_registry_stack-1.0.7.tar.gz",
"has_sig": false,
"md5_digest": "6d61307bc6abc3d1bed20a0b0314851b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 2366130,
"upload_time": "2025-11-02T22:19:04",
"upload_time_iso_8601": "2025-11-02T22:19:04.218924Z",
"url": "https://files.pythonhosted.org/packages/13/6c/9ae06da0f731b704a031ca1927bf751f0c57e12a9a036cbf0edbb0c083ce/nexstem_registry_stack-1.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-11-02 22:19:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sw-registry-stack",
"github_project": "sdk",
"github_not_found": true,
"lcname": "nexstem-registry-stack"
}