Skip to main content

Python SDK for DxPipe model editing and simulation workflows

Project description

dxpipe-sdk

dxpipe-sdk is a Python SDK for DxPipe model editing, simulation execution, streaming result retrieval, and runtime command control.

Features

  • Token-based authentication against the DxPipe backend
  • Create models for supported workspace types and open existing models
  • Add, remove, connect, and configure components in the model graph
  • Save model snapshots and start simulation jobs
  • Poll or stream logs, plots, tables, inspect data, and container messages
  • Send runtime commands to components during online or transient execution

Requirements

  • Python 3.10 or later
  • A reachable DxPipe service endpoint
  • A DxPipe account that can obtain access tokens

Install

Install from a built wheel or from PyPI after publication:

pip install dxpipe-sdk

For local development in this repository:

pip install -e .

Quick Start

from dxpipe_sdk import DxPipeClient

client = DxPipeClient(
    base_url="http://localhost:8000",
    username="admin",
    password="your-password",
)

model = client.create_model(
    name="sdk-demo-model",
    workspace_type="lps_online",
    description="Created by dxpipe-sdk",
)

source = model.add_component("Source", position=(0, 0))
pipe = model.add_component("Pipe", position=(240, 0))
load = model.add_component("Load", position=(480, 0))

model.connect(source, "0", pipe, "0")
model.connect(pipe, "1", load, "0")

model.save()
job = model.run(timeout=120, image="dxpipe")

for message in job.stream_results(timeout=2):
    print(message.get("type"), message.get("key"))

Public API

The package currently exports these main entry points:

  • DxPipeClient
  • Model
  • Component
  • Connection
  • Job
  • MetaService
  • ResultStream
  • LogMessage
  • PlotMessage
  • TableMessage
  • InspectMessage
  • ContainerMessage
  • DxPipeError
  • AuthError
  • APIError
  • NotFoundError
  • ValidationError

Examples

  • examples/quickstart.py: create, save, run, and fetch results
  • examples/transient_streaming.py: stream transient online results and send commands during execution
  • examples/run_existing_model.py: open an existing model by ID and run it

Release Validation

Build and metadata check:

python -m build
python -m twine check dist/*

Minimal install smoke test with the built wheel:

python -m venv .smoke-venv
.smoke-venv\Scripts\python -m pip install dist\dxpipe_sdk-0.1.0-py3-none-any.whl
.smoke-venv\Scripts\python -c "from dxpipe_sdk import DxPipeClient, Model, Job, ResultStream; print('smoke ok')"

License

This package is currently distributed as proprietary software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dxpipe_sdk-0.1.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dxpipe_sdk-0.1.0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file dxpipe_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: dxpipe_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for dxpipe_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9f265026face480178df6d3e687d25c2bb78197883ad41a17efb04625a9cd1d9
MD5 01298377d53233d7662aef2b0ba1e673
BLAKE2b-256 79542db24f256dbed4d940cb4db41f969fd6bfe11254bb743f814595ebbfeef6

See more details on using hashes here.

File details

Details for the file dxpipe_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dxpipe_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for dxpipe_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffcdcaaccf9f9cb7201d319b40e4f06b43956a19a157c4328bdbb8410f66a01d
MD5 b5011d13bf0347219d79653293024615
BLAKE2b-256 90fd806fdc8673c1a9d67443e6cc12561dc36efb7ac234a6a216c4653241342a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page