Last-stop signals for automation failures.
Project description
Shuuten sends structured Slack and email alerts when your Python automations fail — especially in AWS Lambda and ECS — with minimal setup and zero dependencies.
終点 (Shūten) means "final stop" in Japanese — the point where a workflow ends and signals that something needs attention.
📖 Documentation · ⭐ Star on GitHub
Quick start (AWS Lambda)
import shuuten
@shuuten.capture
def lambda_handler(event, context):
shuuten.debug('debug info') # not sent
shuuten.error('domain error') # sent to Slack
1 / 0 # sent with stack trace
Set one environment variable and you’re done (see Slack webhook setup):
export SHUUTEN_SLACK_WEBHOOK_URL="https://hooks.slack.com/services/..."
Why Shuuten?
- Built for failure paths — only
ERROR+signals are sent by default - Zero dependencies — no SDKs, agents, or background workers
- Designed for AWS — Lambda, ECS tasks, and containers work out of the box
- Logging-native — uses familiar
loggingsemantics - Opinionated but minimal — small surface area, easy to reason about
Installation
pip install shuuten # no dependencies (Slack, local logging)
pip install "shuuten[email]" # SES email (boto3) outside AWS Lambda
Usage patterns
Structured logging (logging-style)
import shuuten
def handler(event, context):
shuuten.info('hello') # not sent
shuuten.error('bad input') # sent to Slack if configured
Explicit logger + email notifications
Requires SES env vars (
SHUUTEN_SES_FROM,SHUUTEN_SES_TO). Email is sent via AWS SES if configured.
import shuuten
shuuten.init(shuuten.Config(app='my-app', env='dev'))
log = shuuten.get_logger(__name__)
@shuuten.capture(workflow='my-workflow')
def handler(event, context):
log.critical('Something went wrong') # sent to Slack + Email (if configured)
Manual context control (advanced)
import shuuten
def handler(event, context):
token = shuuten.detect_and_set_context(context)
try:
...
finally:
shuuten.reset_runtime_context(token)
The
capture()decorator works for ECS tasks as well (via ECS metadata v4).
Configuration
You can configure Shuuten via Config in code or environment variables.
| Variable | Description | Default |
|---|---|---|
SHUUTEN_APP |
Application name (used for grouping/metadata) | auto |
SHUUTEN_ENV |
Environment name (prod, dev, staging, etc.) |
auto |
SHUUTEN_MIN_LEVEL |
Minimum level sent to destinations | ERROR |
SHUUTEN_EMIT_LOCAL_LOG |
Emit local structured log when notifying | true |
SHUUTEN_QUIET_LEVEL |
Silence noisy third-party logs (e.g. boto) | WARNING |
SHUUTEN_DEDUPE_WINDOW_S |
Slack dedupe window (seconds); 0 disables |
30 |
Slack
| Variable | Description |
|---|---|
SHUUTEN_SLACK_WEBHOOK_URL |
Slack Incoming Webhook URL |
SHUUTEN_SLACK_FORMAT |
blocks or plain |
Email (SES)
| Variable | Description |
|---|---|
SHUUTEN_SES_FROM |
Verified SES sender |
SHUUTEN_SES_TO |
Comma-separated recipient list |
SHUUTEN_SES_REPLY_TO |
Optional reply-to address |
SHUUTEN_SES_REGION |
Optional SES region |
Supported destinations
- Slack (Incoming Webhooks)
- Email (AWS SES)
Note: When running in AWS (e.g. Lambda or ECS), the execution role must be allowed to send email via SES. See AWS docs.
Roadmap
- PagerDuty and other alerting destinations
- Context manager for exception capture
- Optional "exceptions-only" alerting mode
- Expanded ECS and EKS support
Credits
Created with Cookiecutter using https://github.com/audreyfeldroy/cookiecutter-pypackage
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shuuten-0.2.0.tar.gz.
File metadata
- Download URL: shuuten-0.2.0.tar.gz
- Upload date:
- Size: 27.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
921844b49ed764f5a9b95ed9c91eb606e3ef760e311944b9404cfe388a9d021c
|
|
| MD5 |
7a4c1ff182b770c6e32a2acc2efee08c
|
|
| BLAKE2b-256 |
47abf482a001ab81f7277d231bbbe3a64fd0c181936568621f299036c8782a4f
|
Provenance
The following attestation bundles were made for shuuten-0.2.0.tar.gz:
Publisher:
release.yml on rnag/shuuten
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shuuten-0.2.0.tar.gz -
Subject digest:
921844b49ed764f5a9b95ed9c91eb606e3ef760e311944b9404cfe388a9d021c - Sigstore transparency entry: 814701730
- Sigstore integration time:
-
Permalink:
rnag/shuuten@95107381218031b3a0c61bae98f778a282fc760b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/rnag
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@95107381218031b3a0c61bae98f778a282fc760b -
Trigger Event:
push
-
Statement type:
File details
Details for the file shuuten-0.2.0-py3-none-any.whl.
File metadata
- Download URL: shuuten-0.2.0-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9b1304fa7ff3bbd373a359d72dc9a7f24a27f4bb458202f31a834c347ddfa16
|
|
| MD5 |
8bd543c646d55513ae22f1511877e2ba
|
|
| BLAKE2b-256 |
b89cebffa0632828a94c73d0a48add46b02649c37cb971424c6d23a081175712
|
Provenance
The following attestation bundles were made for shuuten-0.2.0-py3-none-any.whl:
Publisher:
release.yml on rnag/shuuten
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shuuten-0.2.0-py3-none-any.whl -
Subject digest:
d9b1304fa7ff3bbd373a359d72dc9a7f24a27f4bb458202f31a834c347ddfa16 - Sigstore transparency entry: 814701731
- Sigstore integration time:
-
Permalink:
rnag/shuuten@95107381218031b3a0c61bae98f778a282fc760b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/rnag
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@95107381218031b3a0c61bae98f778a282fc760b -
Trigger Event:
push
-
Statement type: