Skip to content

Repository files navigation

buzzkill

PyPI Python Versions CI License: MIT

Guaranteed emergency-stop helper for Python. Wrap critical sections so a user-supplied shutdown callback always runs — on normal exit, on exception, or on SIGINT.

Install

pip install buzzkill

Quickstart

from buzzkill import EmergencyStop

stopped = []

def cut_power():
    stopped.append("power_cut")

with EmergencyStop(cut_power):
    # work that must never leave hardware/live state dangling
    pass

assert stopped == ["power_cut"]

Why this exists

  • Hardware and live sessions must never leave power/state dangling after Ctrl-C
  • One callback, fired at most once, even if nested or re-entered
  • Works as a context manager or via the buzzkill() factory

API

Symbol Description
EmergencyStop Context manager; guarantees shutdown callback
buzzkill(shutdown) Factory returning an EmergencyStop
EmergencyStop.fire() Invoke the callback at most once

Related packages

Part of the coldbricks micro-library suite (small, typed, zero-dependency helpers):

Package Role
buzzkill Guaranteed shutdown callbacks
aftercare Reverse-order teardown
fluffer Startup pre-warm
edging Token-bucket rate limit
readback Echo-confirmation validation
hearback Output re-validation decorator
agecheck Timezone-correct age thresholds
transponder State broadcast on change

Development

pip install -e ".[dev]"
pytest -q
ruff check .
mypy src

Roadmap

This is an early 0.1.0 release (Alpha) with active development planned:

  • BLE device registry for pairing emergency-stop hardware
  • Haptic / status feedback hooks
  • Cross-platform signal coverage refinements

License

MIT © Coldbricks — coldbricks@gmail.com

About

Haptic/BLE emergency-stop helper: guaranteed shutdown callbacks.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages