Skip to main content

interloper-slack

Slack notifications for interloper runs: a SlackHook that posts a run outcome to a channel, and the SlackConnection that holds the bot token.

The hook is the notification counterpart to core's WebhookHook — same events, but the payload is a message a human reads rather than a document a service parses.

Setup

  1. Create a Slack app (From scratch) at api.slack.com/apps.
  2. Under OAuth & Permissions, add these bot token scopes:
    • chat:write — post the notification
    • channels:read, groups:read — populate the channel picker
  3. Install to Workspace and copy the bot user token (xoxb-…).
  4. Invite the bot to each channel it posts to (/invite @your-app). Slack rejects chat.postMessage with not_in_channel otherwise.

One connection serves the whole workspace; each hook picks its own channel.

Usage

import interloper as il
from interloper_slack import SlackConnection, SlackHook

hook = SlackHook(
    connection=SlackConnection(bot_token="xoxb-..."),
    channel="C0123456789",
    watches=[my_source],
    events=["run_failed"],
)

The token also loads from the environment (SLACK_BOT_TOKEN), so SlackConnection() works with no arguments.

events defaults to ["run_failed"] like every hook — the alert most teams want. Add "run_completed" for a full-chatter channel.

In a deployed instance you configure this through the UI instead: add a Slack connection, then a Slack hook watching the source or job you care about. The scheduler's hook evaluator fires it on terminal runs.

Message shape

❌ *Facebook Ads* failed
Run `9f3c…` · partition `2026-07-30`
HTTPStatusError: 429 Too Many Requests

The headline also travels as the message's text, so notification previews and screen readers get the outcome without parsing blocks.

Notes

Every Slack call goes through the connection's client — a cached_property il.RESTClient with il.HTTPBearerAuth, like every other connection in the workspace. That client owns the base URL, the token, and the connection pool, so callers name a path and nothing else; the channel picker paginates with il.JSONCursorPaginator over Slack's response_metadata.next_cursor.

The client is sync, where most connections' are async. The two consumers are a hook firing (sync by contract) and a form lookup — neither has independent requests to overlap, and the API process runs sync providers in a thread, so it never blocks the event loop.

The one thing the framework can't cover is that Slack answers a rejected call with HTTP 200 and {"ok": false, "error": "..."}, so raise_for_status() alone lets failures pass silently. Each call site checks ok itself and raises RuntimeError with Slack's own error code — the same shape as the other connections that face an in-body error flag. For the paginated picker that check lives in the data_selector, since paginate only raises for HTTP status.

A failed firing is recorded on the hook's firing claim (as hook_failed) and is not retried.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

interloper_slack-0.57.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

interloper_slack-0.57.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file interloper_slack-0.57.0.tar.gz.

File metadata

  • Download URL: interloper_slack-0.57.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for interloper_slack-0.57.0.tar.gz
Algorithm Hash digest
SHA256 2350195dac30b4767075312008423a84fd115f9cce9c4d9a687dfe98b035cbd6
MD5 34d8372bef6c833d131d99811244eb2a
BLAKE2b-256 b8713c75208f0bcdafd9a7f5391e970701f20f2fe363d7d38143b5672c8d1464

See more details on using hashes here.

File details

Details for the file interloper_slack-0.57.0-py3-none-any.whl.

File metadata

  • Download URL: interloper_slack-0.57.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for interloper_slack-0.57.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52b4bcd378a1d7e0410a9b3b83e0b37c8978638860259d18105cae1e5382f2fe
MD5 b6d3fc0f68b8409f133a3e985c63052b
BLAKE2b-256 eee5d7645ef5e34aae5c3a83bced29ee89e402b5187ce7be0804dbb8cf34a49d

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 Sentry Error logging StatusPage Status page