Developer Tooling · zero-dependency · MIT

larzseen

Which of these ids are actually new since last time?

The small thing every poller ends up hand-rolling: open a state file, load it into a set, diff the current batch against it, save. Ported from a pattern found duplicated across a dozen real production scripts - payment-hold alerts, inbox scanning, digest scanning, indexing submission - each reinventing the same handful of lines. filter_new() does the whole check-diff-record cycle in one call.

larzscript pkg install seen
View on GitHub →Learn the stack

What you get

Try it

import "seen" as seen
let SP = "/tmp/demo_seen.state"
print("run1:", seen.filter_new(SP, ["order_1", "order_2", "order_3"]))
print("run2:", seen.filter_new(SP, ["order_2", "order_3", "order_4"]))
seen.forget(SP, "order_2")
print("order_2 fresh again after forget:", seen.filter_new(SP, ["order_2"]))
Output
run1: [order_1, order_2, order_3]
run2: [order_4]
order_2 fresh again after forget: [order_2]

Why it's in the Larz Stack

larzseen is a real Larzscript package (larzscript pkg install seen) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.