The official Python SDK for Task Badger
Project description
Task Badger Python Client
This is the official Python SDK for Task Badger.
For full documentation go to https://docs.taskbadger.net/python/.
Getting Started
Install
pip install --upgrade taskbadger
Client Usage
Configuration
import taskbadger
taskbadger.init(
organization_slug="my-org",
project_slug="my-project",
token="***"
)
API Example
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' and set the value to 0
task.started()
try:
for i in range(100):
do_something(i)
if i!= 0 and 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()
CLI USage
Configuration
$ taskbadger configure
Organization slug: my-org
Project slug: project-x
API Key: XYZ.ABC
Config written to ~/.config/taskbadger/confi
Usage Examples
The CLI run command executes your command whilst creating and updating a Task Badger task.
$ taskbadger run "demo task" --action "error email to:me@test.com" -- path/to/script.sh
Task created: https://taskbadger.net/public/tasks/xyz/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
taskbadger-0.3.0.tar.gz
(22.0 kB
view details)
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 taskbadger-0.3.0.tar.gz.
File metadata
- Download URL: taskbadger-0.3.0.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.9.5 Linux/5.4.0-139-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08fb85f9c7c1e501a84d565e15886d8b0356df2fff02138becd903c9865907e0
|
|
| MD5 |
ac864c47e2d646cfa0ebef6d4fc6ab1f
|
|
| BLAKE2b-256 |
5ccc4dcea777478cea3371b6d22ec569c13617a0474900bb2df2e7f13554e596
|
File details
Details for the file taskbadger-0.3.0-py3-none-any.whl.
File metadata
- Download URL: taskbadger-0.3.0-py3-none-any.whl
- Upload date:
- Size: 45.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.9.5 Linux/5.4.0-139-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7238c97dac15b142543cc8d7dd74aadc713fcf1f15195299f72cb7db0634cc39
|
|
| MD5 |
a3861b39ed23b565dd11dd7f1362dd39
|
|
| BLAKE2b-256 |
ce3db52369787babef5949c63ed5260378be1eca9bdf14018f8396b2ca2c2bd4
|