Skip to main content

Project Logo

The Lupaxa Notifications Toolbox
Part of The Lupaxa Project


lupaxa-slackit

Send Slack messages through an incoming webhook.

Features

  • Post message text, one attachment, or Block Kit blocks
  • Set a username, channel, and icon emoji on each client
  • Keep several webhook profiles in $HOME/.slackit.yml and select one with --profile
  • Override any profile field with a CLI flag
  • Turn escaped \n sequences in message text into real line breaks
  • Reject webhook URLs that do not start with https://hooks.slack.com/services/
  • Reject webhook URLs that answer HEAD with a redirect
  • Use the Slackit library class or the slackit command

Installation

From PyPI

pip install lupaxa-slackit

From source (development mode)

pip install -e ".[dev]"

Requires Python 3.13+. Runtime dependencies: requests and PyYAML.

Library quick start

from lupaxa.slackit import Slackit, load_profile

profile = load_profile("testing")
client = Slackit(
    profile.webhook_url,
    username=profile.username,
    channel=profile.channel,
    icon_emoji=profile.icon_emoji,
)
client.send_message("Hello from a profile")

client = Slackit(
    "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXX",
    username="PyBot",
    channel="#testing",
    icon_emoji=":robot_face:",
)
client.send_message("Hello, Slack!")
client.send_attachment('{"text": "Optional text inside the attachment"}')
client.send_block('[{"type": "section", "text": {"type": "mrkdwn", "text": "Hello"}}]')

CLI quick start

slackit --help
slackit --webhook "$SLACK_WEBHOOK_URL" --text "Hello, Slack!"
slackit --profile testing --text "Hello, Slack!"
slackit -p alerts --config "$HOME/work/slackit.yml" --text "Disk full"

You can also run the CLI as a module:

python -m lupaxa.slackit --help
python -m lupaxa.slackit --version

Config

Profiles live in one YAML file. The default path is $HOME/.slackit.yml. Pass --config when the file lives somewhere else. --config requires --profile. CLI flags override the selected profile.

profiles:
  testing:
    webhook_url: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXX
    username: PyBot
    channel: "#testing"
    icon_emoji: ":robot_face:"
    timeout: 15
  alerts:
    webhook_url: https://hooks.slack.com/services/T00000000/B00000000/YYYYYYYY
    channel: "#alerts"

Each profile may set webhook_url, username, channel, icon_emoji, and timeout. --webhook is required when you do not pass --profile.

Options

  • --webhook, -w: Slack incoming webhook URL; required when --profile is omitted
  • --profile, -p: profile name in the config file
  • --config: config file path; default $HOME/.slackit.yml
  • --text, -t: message text
  • --attachment, -a: one attachment as a JSON object
  • --blocks, -b: Block Kit payload as JSON
  • --validate: send a validation message to channel general
  • --username, -u: display name
  • --channel, -c: channel override
  • --icon-emoji, -i: icon emoji
  • --timeout, -T: request timeout in seconds; default 10
  • --version: print the package version

--text, --attachment, --blocks, and --validate are mutually exclusive. One of them is required. CLI flags override the selected profile.

Documentation

Online documentation:

Documentation

Source repository:

GitHub

Serve docs locally

From a clone of the repository:

make mkdocs-serve

Then open the local URL printed by MkDocs in your browser.

Development

Clone the repository and install with Make:

make init                # first-time makefile-skills checkout
make python-install-dev  # editable install with [dev]
make python-check        # lint, type-check, and test
The Lupaxa Project Footer

Release files for lupaxa-slackit 0.1.0

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

Source distribution (sdist)

Source distribution for lupaxa-slackit 0.1.0
File Size Uploaded
lupaxa_slackit-0.1.0.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lupaxa-slackit 0.1.0
File Interpreter ABI Platform
lupaxa_slackit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.6 kB

Release files / lupaxa_slackit-0.1.0.tar.gz

Download URL lupaxa_slackit-0.1.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
701acf7cceddc33c73569f58ff8211ae45521b17974f0269b1b0caee81e0ed8b
BLAKE2b-256 checksum
How to use checksums
ca5fff61c62cca7c999f2060d70b43b68878aaa7296f2b65e9cb65badbda2fc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / lupaxa_slackit-0.1.0-py3-none-any.whl

Download URL lupaxa_slackit-0.1.0-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c16776b743eafdbe4d547380401184afb1de32a69b7c76dc46961f83e20d52c
BLAKE2b-256 checksum
How to use checksums
ca76e7ee72b6ceb695bcc18c22c26c12c4311e7f6e7c0c4958838c172ecde764
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

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