Skip to main content

Atalert Python Package

Atalert.dev

Too many different data notifications or alert packages got you down?

Start by using the Atalert Slack App to generate alert webhooks.

Customize the template, delivery channel, and notify your team.

Then, take note of the webhook URL slug for the code examples below!

It's a best practice to make as many different webhooks as you need for other functional areas, such as code deployments, new user registrations, and results of a long-running data pipeline. If there's information somewhere that's difficult to get to, use Atalert to send it to your Slack workspace.

Installation

pip install atalert or poetry add atalert

Basic Usage

import atalert


# add these to wherever you need to send a slack atalert, customize with your own data payload

# send an 'ok' atalert
atalert.ok('alert_slug_here', data)

# send a 'warning' atalert
atalert.warn('alert_slug_here', data)

# send an 'error' atalert
atalert.err('alert_slug_here', data)

You'll immediately get a custom alert notification in slack according to your webhook configuration.

Then all your data or platform alerts are in the one place you are every day, Slack!

Sending Files to Slack

First, configure your alert within the Atalert Slack App to use the 'attachment' template type.

Then, use any of the following methods:

from atalert import ok_file, warn_file, err_file

# send 'data.json' in the current working directory as a file attachment with OK status
ok_file('alert_slug_here', './data.json')

# send 'error.log' in as a file with ERROR status
err_file('alert_slug_here', './error.log')

# send 'datacat.jpg' as a picture with WARNING status
warn_file('alert_slug_here', './datacat.jpg')

Enjoy fine file-based data in your Slack workspace!

Decorator Usage

Want to simplify error notifications? Need to automatically send a method's return object somewhere? Use the decorators!

from atalert import atalert_on_error
from atalert import atalert_ok_result

# decorator configured with a webhook url slug, will forward any exceptions
@atalert_on_error('alert_slug_here')
def main_processing_method(*args, **kwargs):

	# do some things here that may go wrong and throw exceptions
	numbers = business / 0

	return numbers

@atalert_ok_result('alert_slug_here')
def alternate_processing_method(*args, **kwargs):
	# do some math here that you want to send to slack
	numbers = statistics.stdev(args)
	# whatever you return will automagically go to your predefined slack channel
	return numbers 

You'll get your code exception or method results sent directly to slack!

Metadata

Release files for atalert 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atalert 0.1.10
File Size Uploaded Provenance
atalert-0.1.10.tar.gz 5.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for atalert 0.1.10
File Interpreter ABI Platform
atalert-0.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / atalert-0.1.10.tar.gz

Download URL atalert-0.1.10.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a8cb865c314b558d8693fc2d0ef180dd22f460914e3e9fbbcf842ddbd9e8fd04
BLAKE2b-256 checksum
How to use checksums
4260ead7e44e294d5c19f6767ae4783d31fa7fdbf60a5c4ad5613c5a92a33254
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.10.4 Darwin/19.6.0

Release files / atalert-0.1.10-py3-none-any.whl

Download URL atalert-0.1.10-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfcb7b517f43ac561f1e19203f56b3d168890e066adee6c08818a7532a79a167
BLAKE2b-256 checksum
How to use checksums
26f0d435390102ff4cab3f1e001a62b66ee90a2d44dcd251203789a15e645756
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.10.4 Darwin/19.6.0

Security for atalert 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page