Skip to main content

deco_slack notifies you if a method has completed successfully or not.

Project description

decoslack

decoslack notifies you via Slack if a method has completed successfully or not.

Description

  • Notify Slack when a process starts, ends normally, or ends abnormally.
  • Each notification can be set on or off.

Configurations

Environment variables to set

  • SLACK_TOKEN
    • Slack bot token that can be used with chat:write.public scope.
  • SLACK_CHANNEL
    • Channel name to be notified without # (like notify_xxx not #notify_xxx)

Example

from deco_slack import deco_slack


@deco_slack(
    # These parameters are all optional
    start={
        "text": "start text",
        "title": 'start',
        "color": "good"
    },
    success={
        "text": "success text",
        "title": 'success',
        "color": "good"
    },
    error={
        "title": 'error',
        "color": "danger",
        "stacktrace": True # Set True if you need stacktrace in a notification
    },
)
def test1():
  print('test1')


@deco_slack(
    success={
        "text": "success text",
        "title": 'success',
        "color": "good"
    },
    error={
        "title": 'error',
        "color": "danger",
        "stacktrace": True
    },
)
def error1():
  raise ValueError('error occured.')

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

deco_slack-0.0.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

deco_slack-0.0.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file deco_slack-0.0.1.tar.gz.

File metadata

  • Download URL: deco_slack-0.0.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.3 Darwin/19.6.0

File hashes

Hashes for deco_slack-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b35776ac3d1de7e615b459e1e5288d583114fadfcfa518965a01a5462407fcda
MD5 be1a09fafe0c63044a491cc64399e6bb
BLAKE2b-256 698a5e3bd240e785e556fe518df0c08d1a1bee6e42cc869e2ce6ba2304e5264c

See more details on using hashes here.

File details

Details for the file deco_slack-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: deco_slack-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.3 Darwin/19.6.0

File hashes

Hashes for deco_slack-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d60fb3f0a08f60b4012dd12925b557a8349888d5667e7c450ef345bcd56e458
MD5 8646d8d25f7d82512ce9eee98828e9a8
BLAKE2b-256 7f41d71ee7ff0e82cfac54f726e83cbc70138043a3393e3cdaabbf088be837ae

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