Tile garbage collection with retention policies — keep what matters, discard what's expired
Project description
quartermaster-gc
Tile garbage collection with retention policies. Like a ship's quartermaster managing supplies: keep what matters, discard what's expired, sample what's abundant.
Policies
- KEEP_ALL — never delete anything
- KEEP_RECENT — keep tiles newer than
max_age_seconds - KEEP_IMPORTANT — keep tiles with weight above
min_weight - KEEP_SAMPLED — keep 1 in every N tiles
Stack policies for compound filtering (all must agree to keep).
Usage
from quartermaster_gc import TileGC, RetentionPolicy, TileEntry
import time
gc = TileGC()
gc.add_tile(TileEntry(id="t1", room="bridge", timestamp=time.time(), weight=0.9))
gc.add_tile(TileEntry(id="t2", room="engine", timestamp=time.time() - 9999, weight=0.1))
gc.add_policy(RetentionPolicy.KEEP_RECENT, max_age_seconds=3600)
gc.add_policy(RetentionPolicy.KEEP_IMPORTANT, min_weight=0.5)
report = gc.collect()
# t2 collected (old + low weight), t1 kept (recent + important)
Zero deps. pip install quartermaster-gc
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 quartermaster_gc-0.1.0.tar.gz.
File metadata
- Download URL: quartermaster_gc-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a511158938eb8493e7d8b4f75ed1012f002e50c8b871594b35abd8df6e41c5e0
|
|
| MD5 |
9adb9c9242de4186412d0d60b9c0e19f
|
|
| BLAKE2b-256 |
5caddbbc84915615c5aea3c6f43152124f464fd22faedbf04d7083472fa7ac4a
|
File details
Details for the file quartermaster_gc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: quartermaster_gc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d38d8913078bd678ef53de48825481cf699af7546aa7c96b9e01465819a117ef
|
|
| MD5 |
ffcdb3478622c9ee14263aa06042782a
|
|
| BLAKE2b-256 |
9a2bc66927dc4e86e3b4d5a3350befd2111f970463f470275b529a0d2665490c
|