https://github.com/coldbricks/buzzkill
Haptic/BLE emergency-stop helper: guaranteed shutdown callbacks.
https://github.com/coldbricks/buzzkill
coldbricks context-manager emergency-stop pypi python shutdown signals typed zero-dependency
Last synced: 14 days ago
JSON representation
Haptic/BLE emergency-stop helper: guaranteed shutdown callbacks.
- Host: GitHub
- URL: https://github.com/coldbricks/buzzkill
- Owner: coldbricks
- License: mit
- Created: 2026-07-22T19:18:54.000Z (18 days ago)
- Default Branch: main
- Last Pushed: 2026-07-22T19:20:25.000Z (18 days ago)
- Last Synced: 2026-07-23T07:04:07.803Z (17 days ago)
- Topics: coldbricks, context-manager, emergency-stop, pypi, python, shutdown, signals, typed, zero-dependency
- Language: Python
- Homepage: https://pypi.org/project/buzzkill/
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# buzzkill
[](https://pypi.org/project/buzzkill/)
[](https://pypi.org/project/buzzkill/)
[](https://github.com/coldbricks/buzzkill/actions)
[](LICENSE)
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
```bash
pip install buzzkill
```
## Quickstart
```python
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`](https://github.com/coldbricks/aftercare) | Reverse-order teardown |
| [`fluffer`](https://github.com/coldbricks/fluffer) | Startup pre-warm |
| [`edging`](https://github.com/coldbricks/edging) | Token-bucket rate limit |
| [`readback`](https://github.com/coldbricks/readback) | Echo-confirmation validation |
| [`hearback`](https://github.com/coldbricks/hearback) | Output re-validation decorator |
| [`agecheck`](https://github.com/coldbricks/agecheck) | Timezone-correct age thresholds |
| [`transponder`](https://github.com/coldbricks/transponder) | State broadcast on change |
## Development
```bash
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