Skip to content

Home

walbox

Async Python runtime for consuming PostgreSQL logical replication as a stream of committed transactions.

Build Status Package version Supported Python versions

Publish a table in PostgreSQL, and walbox streams every committed change out of it as a durable, at-least-once feed.

walbox delivers each transaction at least once, resumes from a durable checkpoint after any restart, and applies backpressure instead of buffering without limit when your handler falls behind. See Introduction for the full list of guarantees and where walbox's limits are.

How it works

graph LR
    B["Row Change<br/>Committed"]
    B --> C["PostgreSQL<br/>WAL"]
    C --> D["walbox<br/>Consumer"]
    D --> E["Application<br/>Handler"]
    E --> F["Durable<br/>Checkpoint"]
    F -.->|resume from checkpoint| D
  1. Write to any table covered by your publication
  2. walbox receives the change via logical replication
  3. Your handler processes it (publishes to a broker, writes to another system, etc.)
  4. Once successful, walbox saves a durable checkpoint
  5. On restart, walbox resumes from the last durable checkpoint.

Install

pip install walbox

See Getting Started for setup, or jump to Examples for production patterns.

Requirements

  • Python 3.13+
  • PostgreSQL 14+
  • Psycopg 3

By default, Psycopg uses your system's libpq. If you don't have libpq installed, Psycopg can use its own bundled version. See Getting Started for details.


Next: Getting Started · Production Guide · Examples