Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quartermaster_gc-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quartermaster_gc-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

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

Hashes for quartermaster_gc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a511158938eb8493e7d8b4f75ed1012f002e50c8b871594b35abd8df6e41c5e0
MD5 9adb9c9242de4186412d0d60b9c0e19f
BLAKE2b-256 5caddbbc84915615c5aea3c6f43152124f464fd22faedbf04d7083472fa7ac4a

See more details on using hashes here.

File details

Details for the file quartermaster_gc-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for quartermaster_gc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d38d8913078bd678ef53de48825481cf699af7546aa7c96b9e01465819a117ef
MD5 ffcdb3478622c9ee14263aa06042782a
BLAKE2b-256 9a2bc66927dc4e86e3b4d5a3350befd2111f970463f470275b529a0d2665490c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page