Metadata-Version: 2.1
Name: kafka-temporal-mapper-client
Version: 0.1.1
Summary: A client library to send subscribe and notify workflow events to the kafka-temporal-mapper server.
License: AGPL-3.0-only
Author: gtato
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: dacite (>=1.7.0,<2.0.0)
Requires-Dist: dataclasses-json (>=0.5.7,<0.6.0)
Requires-Dist: kafka-python (>=2.0.2,<3.0.0)
Project-URL: source, https://github.com/canonical/kafka_temporal_mapper
Description-Content-Type: text/markdown

# Kafka-Temporal Mapper Client

Kafka-Temporal mapper client facilitates the interaction between the workflows and the Kafka-Temporal mapper server.
This library is used by the workflows and provides methods for publishing of the workflow and mapping events. 

The client provides two methods:
- **subscribe**: used to subscribe a workflow to the execution of another workflow.   
- **notify**: used by a workflow to notify the termination of its execution.  

### Installation
```bash
pip install kafka_temporal_mapper_client
```

### Usage
To use this library for notifying or subscribing:
```python
from kafka_temporal_mapper.client import KafkaTemporalClient

ktc = KafkaTemporalClient()

# subscribe workflow B to workflow A using a part of A's results as argument (@b.c)
ktc.subscribe('WorkflowB', [{'name':'WorkflowA', 'args': {"a":"hello", "b":"@b.c"}}]) 

# notify workflow A execution and its results
ktc.notify('WorkflowA', {"a":"hello", "b": {"c": "world"}})
```

