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.1

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.1
File Size Uploaded
lupaxa_slackit-0.1.1.tar.gz 8.9 kB Details

Built distribution (wheel)

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

Total release size: 19.6 kB

Release files / lupaxa_slackit-0.1.1.tar.gz

Download URL lupaxa_slackit-0.1.1.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3d6dcbf8dbb5999ee8b09fc9ae6177fa0a1a9bd27ddc23ce82e10ddc6edd2765
BLAKE2b-256 checksum
How to use checksums
3fdca9076c08da819c5ca7a25d246b9a49b53f3935d8b309a0a69246f78814b4
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.1-py3-none-any.whl

Download URL lupaxa_slackit-0.1.1-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09772fb26972b9d19b3504f8537e6a0cb44fd45125f36889a36260f963799e8f
BLAKE2b-256 checksum
How to use checksums
e6644bfa7c1dfdd885ad6291e014da998d270212136058086ba173d56523c046
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

This release

0.1.1 This release

2 release files

0.1.0

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