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"
},
)
Tags
You can specify tags, which are string key-value pairs, when calling the run_workflow method. These tags can then
be used when designing workflows in TWS to lookup and filter the results of workflow runs. This allows you to associate
the results of a workflow run with a specific entity or grouping mechanism within your system, such as a user ID or
a lesson ID.
Provide tags to the run_workflow method as a dictionary. Keep in mind that both tag keys and values must be strings
that are at most 255 characters long.
tws_client.run_workflow(
workflow_definition_id="your_workflow_id",
workflow_args={
"param1": "value1",
"param2": "value2"
},
tags={
"user_id": "12345",
"lesson_id": "67890"
}
)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tws_sdk-0.2.1.tar.gz.
File metadata
- Download URL: tws_sdk-0.2.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6417e609659e14519b52894924b99ff30e1f38825b501702ad714e1918fd8bb0
|
|
| MD5 |
c5c6796709d9fecfab3522025237187f
|
|
| BLAKE2b-256 |
6d3ac4ab5b80ade8fa3131d1d14257ef6e6a34b5e08685b54720b4d74e44b4bb
|
Provenance
The following attestation bundles were made for tws_sdk-0.2.1.tar.gz:
Publisher:
publish.yaml on Fireline-Science/tws-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tws_sdk-0.2.1.tar.gz -
Subject digest:
6417e609659e14519b52894924b99ff30e1f38825b501702ad714e1918fd8bb0 - Sigstore transparency entry: 163094262
- Sigstore integration time:
-
Permalink:
Fireline-Science/tws-py@4f5a690accf03aeba184c2ccad570e6706b092e0 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/Fireline-Science
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@4f5a690accf03aeba184c2ccad570e6706b092e0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tws_sdk-0.2.1-py3-none-any.whl.
File metadata
- Download URL: tws_sdk-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f4171dedd115f711a0821ec03c69526205402114530da9136b0d0cb8015ecdf
|
|
| MD5 |
c823c71d355714022ae668d6fdf0e4c8
|
|
| BLAKE2b-256 |
edd98050dfebdf4233229bb58646221c9338e721cd68e0df8c785574c089c0f0
|
Provenance
The following attestation bundles were made for tws_sdk-0.2.1-py3-none-any.whl:
Publisher:
publish.yaml on Fireline-Science/tws-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tws_sdk-0.2.1-py3-none-any.whl -
Subject digest:
0f4171dedd115f711a0821ec03c69526205402114530da9136b0d0cb8015ecdf - Sigstore transparency entry: 163094264
- Sigstore integration time:
-
Permalink:
Fireline-Science/tws-py@4f5a690accf03aeba184c2ccad570e6706b092e0 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/Fireline-Science
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@4f5a690accf03aeba184c2ccad570e6706b092e0 -
Trigger Event:
push
-
Statement type: