Metadata-Version: 2.1
Name: trailwatch
Version: 0.1.0
Summary: Python SDK for Trailwatch by Kicksaw
Home-page: https://www.kicksaw.com/
License: MIT
Author: George Bocharov
Author-email: george@kicksaw.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: requests (>=2.28.2,<3.0.0)
Project-URL: Repository, https://github.com/Kicksaw-Consulting/trailwatch-python-sdk
Description-Content-Type: text/markdown

- [Installation](#installation)
- [Getting Started](#getting-started)
- [Partial Success](#partial-success)

# Installation

```shell
pip install trailwatch
```

# Getting Started

```python
from trailwatch import configure, watch

configure(
  project="my-project",
  trailwatch_url="https://<random>.execute-api.us-west-2.amazonaws.com",
)

@watch()
def handler(event, context):
  # Do your thing
  return
```

# Partial Success

Raise a `PartialSuccess` exception to indicate that the execution was partially
successful. This exception is handled by Trailwatch to set execution status to `partial`
and will not be propagated to the caller.

```python
from trailwatch import configure, watch
from trailwatch.exceptions import PartialSuccessError

configure(
  project="my-project",
  trailwatch_url="https://<random>.execute-api.us-west-2.amazonaws.com",
)

@watch()
def handler(event, context):
  # Do your thing
  # You find out that only a subset of the work was successful
  # Log information about the failure normally using the logger
  raise PartialSuccessError
```

