Skip to main content

Python SDK for the Dex workflow engine

Project description

dex-python-sdk

Python SDK for Dex workflow engine

pip install dex-python-sdk==0.0.1

See samples for use case examples.

Requirements

Concepts

To implement a workflow, the two most core interfaces are

A workflow can contain any number of WorkflowStates.

See more in https://github.com/superdurable/dex#what-is-dex

Development Plan

1.0 -- the basic and most frequently needed features

  • Start workflow API
  • Executing wait_until/execute APIs and completing workflow
  • Parallel execution of multiple states
  • GetWorkflowResultsWithWait API
  • StateOption: WaitUntil(optional)/Execute API timeout and retry policy
  • Get workflow with wait API
  • Timer command
  • AnyCommandCompleted and AllCommandCompleted waitingType
  • InternalChannel command
  • DataAttribute
  • Stop workflow API
  • Improve workflow uncompleted error return(canceled, failed, timeout, terminated)
  • Support execute API failure policy
  • Support workflow RPC
  • Signal command
  • Reset workflow API
  • Skip timer API for testing/operation

Running dex-server locally

Option 1: use docker compose

See dex README

Option 2: VSCode Dev Container

Dev Container is an easy way to get dex-server running locally. Follow these steps to launch a dev container:

  • Install Docker, VSCode, and VSCode Dev Container plugin.
  • Open the project in VSCode.
    cd dex-python-sdk
    code .
    
  • Launch the Remote-Containers: Reopen in Container command from Command Palette (Ctrl + Shift + P). You can also click in the bottom left corner to access the remote container menu.
  • Once the dev container starts, dex-server will be listening on port 8801.

How To Contribute

This project uses Poetry as a dependency manager. Check out Poetry's documentation on how to install it on your system before proceeding.

❗Note: If you use Conda or Pyenv as your environment / package manager, avoid dependency conflicts by doing the following first:

  1. Before installing Poetry, create and activate a new Conda env (e.g. conda create -n langchain python=3.9)
  2. Install Poetry (see above)
  3. Tell Poetry to use the virtualenv python environment (poetry config virtualenvs.prefer-active-python true)
  4. Continue with the following steps.

To install requirements:

poetry install

Update IDL

Edit protos/dex.proto. Rename catalog: docs/design/idl-renames.md.

Generate stubs from IDL

make -C ../protos proto

Checked-in Python stubs land in dex/dexpb/.

Linting

To run linting for this project:

poetry run pre-commit run --show-diff-on-failure --color=always --all-files

Code of Conduct

This project is governed by the Contributor Covenant v 1.4.1. (Review the Code of Conduct and remove this sentence before publishing your project.)

Publishing to PyPI

  1. Bump version in pyproject.toml (and the pip install line above).
  2. Create a GitHub Release with tag sdk-python-vX.Y.Z (for example sdk-python-v0.0.1), or run the Publish Python SDK to PyPI workflow manually.
  3. CI runs poetry publish --build using the PYPI_TOKEN repository secret.

See CONTRIBUTING.md for monorepo tag conventions.

License

This project uses the Apache 2.0 license. (Update this and the LICENSE file if your project uses a different license.)

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

dex_python_sdk-0.0.1.tar.gz (76.9 kB view details)

Uploaded Source

Built Distribution

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

dex_python_sdk-0.0.1-py3-none-any.whl (138.3 kB view details)

Uploaded Python 3

File details

Details for the file dex_python_sdk-0.0.1.tar.gz.

File metadata

  • Download URL: dex_python_sdk-0.0.1.tar.gz
  • Upload date:
  • Size: 76.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.6 Darwin/25.5.0

File hashes

Hashes for dex_python_sdk-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e51bdd1d0550152451d07c4d8308b873588de3afc29964e841adda7d29d246c9
MD5 b2ad892ea2903f8aeea46c30f234bfed
BLAKE2b-256 9527ac42185156699aa56d3162e13edf0c9b6aa79e23712a4fe297d3545072dc

See more details on using hashes here.

File details

Details for the file dex_python_sdk-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: dex_python_sdk-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 138.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.6 Darwin/25.5.0

File hashes

Hashes for dex_python_sdk-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca1f482e8815adca04fc454fff3bb043ace16897360177fa0369f3b75223f155
MD5 b01baf6156aaff53ed3c02532ee558e5
BLAKE2b-256 56b5aff670eeb466e831a521d2e9c1bfa872f6fe9ef5bc70bf001f07ab0b03e8

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