Skip to main content

TWS client for Python.

Project description

tws-sdk

Python client for TWS.

Installation

pip install tws-sdk

Usage

The library provides both synchronous and asynchronous clients for interacting with TWS.

The primary API is run_workflow, which executes a workflow configured via the TWS UI, waits for completion, and returns the result.

Synchronous Usage

from tws import Client as TWSClient

# Use the client with a context manager
with TWSClient(
    public_key="your_public_key",
    secret_key="your_secret_key",
    api_url="your_api_url"
) as tws_client:
    # Run a workflow and wait for completion
    result = tws_client.run_workflow(
        workflow_definition_id="your_workflow_id",
        workflow_args={
            "param1": "value1",
            "param2": "value2"
        },
    )

Asynchronous Usage

The signatures are exactly the same for async usage, but the client class is TWSAsyncClient and client methods are awaited.

from tws import AsyncClient as TWSAsyncClient


async def main():
    # Use the async client with a context manager
    async with TWSAsyncClient(
        public_key="your_public_key",
        secret_key="your_secret_key",
        api_url="your_api_url"
    ) as tws_client:
        # Run a workflow and wait for completion
        result = await tws_client.run_workflow(
            workflow_definition_id="your_workflow_id",
            workflow_args={
                "param1": "value1",
                "param2": "value2"
            },
        )

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

tws_sdk-0.2.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

tws_sdk-0.2.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file tws_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: tws_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tws_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ace19dd10ace4570964fd832dbc80fb8a7cf92ea235a40675bfb24286ef96a99
MD5 324b76b85a1b93f0de3b6853dcb5da16
BLAKE2b-256 021b62392feda76f777e84f84e7fd8a68a770f41bfede689b06b26063ccea6df

See more details on using hashes here.

Provenance

The following attestation bundles were made for tws_sdk-0.2.0.tar.gz:

Publisher: publish.yaml on Fireline-Science/tws-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tws_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tws_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tws_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e61e6ca78fe8177d9d9c92d87491d0f564c70311da80a84c4d9b1e8501ce862
MD5 910a47e02e50082c71738fb5113e2852
BLAKE2b-256 dd5d61095153b3c52cf9fa84d5d7f96345d3df33611dfc5f45dc4b081b3feeb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tws_sdk-0.2.0-py3-none-any.whl:

Publisher: publish.yaml on Fireline-Science/tws-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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