Skip to main content

The official Python SDK for Task Badger

Project description

Task Badger Python Client

This is the official Python SDK for Task Badger


Getting Started

Install

pip install --upgrade taskbadger

Configuration

import taskbadger

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

Usage

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()

Project details


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.2.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

taskbadger-0.2-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file taskbadger-0.2.tar.gz.

File metadata

  • Download URL: taskbadger-0.2.tar.gz
  • Upload date:
  • Size: 18.6 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

Hashes for taskbadger-0.2.tar.gz
Algorithm Hash digest
SHA256 5e01ed6195994a582640dd16d414ac2fd858dbc289ea02f560c29151ec66b436
MD5 06969656b5da69ce54a4604f06e2ada2
BLAKE2b-256 11940a8758734537285cd45fd17ed0c7dde4b43aa42f77d8861855f7ac8b2970

See more details on using hashes here.

File details

Details for the file taskbadger-0.2-py3-none-any.whl.

File metadata

  • Download URL: taskbadger-0.2-py3-none-any.whl
  • Upload date:
  • Size: 41.7 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

Hashes for taskbadger-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 84cc8574de70d0f2cbf0dc855ed1ec32745dabfeaecffae206d754e22a770c6c
MD5 58d37cd9b36b38d7bd6991ca421229f2
BLAKE2b-256 d96325187099da2f1469bfd3b109fb9d869f957e67e42d512c24a42f64f4efd9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page