Metadata-Version: 2.1
Name: tws-sdk
Version: 0.1.0
Summary: TWS client for Python.
Home-page: https://github.com/Fireline-Science/tws-py
License: MIT
Author: Fireline Science
Author-email: sean@firelinescience.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: supabase (>=2.10.0,<3.0.0)
Project-URL: Documentation, https://github.com/Fireline-Science/tws-py
Project-URL: Repository, https://github.com/Fireline-Science/tws-py
Description-Content-Type: text/markdown

# `tws-py`

Python client for [TWS](https://www.tuneni.ai).

## Installation

```bash
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

```python
from tws import create_client

# Create a client instance
client = create_client(
    public_key="your_public_key",
    secret_key="your_secret_key",
    api_url="your_api_url"
)

# Run a workflow and wait for completion
result = 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 is created using `create_async_client` and client
methods are awaited.

```python
from tws import create_async_client


async def main():
    # Create an async client instance
    client = await create_async_client(
        public_key="your_public_key",
        secret_key="your_secret_key",
        api_url="your_api_url"
    )

    # Run a workflow and wait for completion
    result = await client.run_workflow(
        workflow_definition_id="your_workflow_id",
        workflow_args={
            "param1": "value1",
            "param2": "value2"
        },
    )
```
