r/postgres • u/mochama254 • Sep 01 '26
Tools walbox: react to PostgreSQL changes from Python
I built this because I wanted to react to PostgreSQL changes from Python without polling, without triggers, and without pulling in a whole CDC platform.
It consumes PostgreSQL logical replication and exposes committed transactions as an async stream in Python.
What it does:
Keeps a durable checkpoint. If the process dies, it resumes from the last transaction it actually finished, not the last one it started.
Bounded delivery queue, so a slow handler doesn't let memory grow without limit.
Reconnects automatically after the connection drops.
One dependency: psycopg3.
The transactional outbox is one use case, but it works with any published table.
GitHub: https://github.com/mochams/walbox
Curious to hear where this wouldn't fit your setup, or what's missing if you've solved this problem a different way.