Metadata-Version: 2.1
Name: taskbadger
Version: 0.1
Summary: The official Python SDK for Task Badger
Requires-Python: >=3.8,<4.0
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: attrs (>=21.3.0)
Requires-Dist: httpx (>=0.15.4,<0.24.0)
Requires-Dist: python-dateutil (>=2.8.0,<3.0.0)
Requires-Dist: tomlkit (>=0.11.6,<0.12.0)
Requires-Dist: typer[all] (>=0.7.0,<0.8.0)
Description-Content-Type: text/markdown

# Task Badger Python Client
This is the official Python SDK for [Task Badger](https://taskbadger.net/)

---

## Getting Started

### Install

```bash
pip install --upgrade taskbadger
```

### Configuration

```python
import taskbadger

taskbadger.init(
    organization_slug="my-org",
    project_slug="my-project",
    token="***"
)
```

### Usage

```python
from taskbadger import Task, Action, EmailIntegration

# create a new task with custom data and an action definition
task = Task.create(
    "task name",
    data={
        "custom": "data"
    },
    actions=[
        Action(
            "*/10%,success,error",
            integration=EmailIntegration(to="me@example.com")
        )
    ]
)

# update the task status to 'processing'
task.start()
try:
   for i in range(100):
      do_something(i)
      if i % 10 == 0:
         # update the progress of the task
         task.update_progress(i)
except Exception as e:
    # record task errors
    task.error(data={
        "error": str(e)
    })
    raise

# record task success
task.success()
```

