SXD SDK
Python library for building data pipelines on SentientX Data Platform.
Installation
pip install sxd-sdk
Quick Start
1. Create Pipeline
Create a new directory with this structure:
my-pipeline/
├── my_pipeline/
│ ├── __init__.py
│ └── activities.py
├── sxd.yaml
└── pyproject.toml
2. Define Tasks
# my_pipeline/activities.py
from sxd_sdk import sxd_task, TaskContext, ProcessingResult
@sxd_task(name="process_video")
async def process_video(input_data: dict, ctx: TaskContext) -> dict:
video_path = input_data["source_url"]
await ctx.heartbeat(f"Processing {video_path}")
result = ProcessingResult.ok(output_path="/output/result.mp4")
return result.model_dump()
3. Configure (sxd.yaml)
base_image: sxd-base # or: sxd-pytorch, sxd-opencv, sxd-cuda
timeout: 3600 # optional, default 3600s
gpu: false # optional, default false
4. Publish
sxd publish .
5. Submit Tasks
sxd submit process_video --input '{"source_url": "s3://bucket/video.mp4"}'
API Reference
Schemas
from sxd_sdk import (
PipelineInput, # Base input with source_url, customer_id, options
PipelineOutput, # Base output with status, output_path, metrics, errors
ProcessingResult, # Task result with success, output_path, error, metadata
)
# Convenience constructors
result = ProcessingResult.ok("/output/path", count=10)
result = ProcessingResult.fail("Something went wrong")
Testing
from sxd_sdk.testing import MockTaskContext, MockControlPlane
# Test tasks
async def test_my_task():
ctx = MockTaskContext()
result = await process_video({"source_url": "s3://video.mp4"}, ctx)
assert result["success"]
assert ctx._heartbeats # verify heartbeat was called
Client
from sxd_sdk import SXDClient
client = SXDClient(api_url="https://api.example.com", api_key="...")
task = await client.submit("process_video", {"source_url": "s3://video.mp4"})
status = await client.status(task["id"])
License
Apache 2.0
Metadata
Release files for sxd-sdk 0.3.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 |
|---|---|---|---|---|
| sxd_sdk-0.3.0.tar.gz | 47.7 kB | Without provenance | Details for sxd_sdk-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sxd_sdk-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for sxd_sdk-0.3.0-py3-none-any.whl |
Total release size: 95.0 kB
Release files / sxd_sdk-0.3.0.tar.gz
| Download URL | sxd_sdk-0.3.0.tar.gz |
|---|---|
| Size | 47.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b572936db35ecad95437740ee231a6ffab8e6edd8bfa64a99b04cd7f42e72108
|
|
BLAKE2b-256 checksum How to use checksums |
565fdbe76497e64f8082b2e49c43130b5bc578bf1ed6cc267a70679045634517
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Release files / sxd_sdk-0.3.0-py3-none-any.whl
| Download URL | sxd_sdk-0.3.0-py3-none-any.whl |
|---|---|
| Size | 47.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9642c73a415a327883f022b9c6478b65e6e298d68b70acc756fbb1fc591e34d
|
|
BLAKE2b-256 checksum How to use checksums |
cc0a77e7305c3f99933d7b9bad30909350baec7ebc0e1f153d94d31e58ad8cd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Security for sxd-sdk 0.3.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.