aftercare
Teardown orchestration for Python. Register cleanup steps, then run them in reverse order on exit — logging each one's success or failure without short-circuiting the rest.
Install
pip install aftercare
Usage
from aftercare import Aftercare
order = []
with Aftercare() as ac:
ac.add(lambda: order.append("close_db"), name="close_db")
ac.add(lambda: order.append("flush_cache"), name="flush_cache")
# main work...
assert order == ["flush_cache", "close_db"]
assert all(r.ok for r in ac.results)
Roadmap
This is an early 0.1.0 release with active development planned:
- Async cleanup support
- Timeout and cancel policies
- Structured result export for ops tooling
Author
Coldbricks — coldbricks@gmail.com
Metadata
Release files for aftercare 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aftercare-0.1.0.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aftercare-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.5 kB
Release files / aftercare-0.1.0.tar.gz
| Download URL | aftercare-0.1.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d3d1ba0e0e3a62c7caf7fc99deeba0bb991afa13aa58be39f8edb8444ab81b7
|
|
BLAKE2b-256 checksum How to use checksums |
7f512e628ef6f2174bfbe81a470d9ec4fde9b935cb1ce7224504553cffbefbeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / aftercare-0.1.0-py3-none-any.whl
| Download URL | aftercare-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e6d6c17a004ead4542fedc0c9f09c138cb406e17976b4d45a9a0e14f3051604
|
|
BLAKE2b-256 checksum How to use checksums |
6c512379cd26f6f6f17cf1ae70805ac997f83a4e97d1b0ed807551169dd4d597
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|