Pure-Python codec for the dqlite wire protocol — encode and decode the messages a dqlite server speaks.
dqlite is Canonical's distributed SQLite, built on Raft. This package implements the bytes-on-the-wire layer: it turns request/response objects into frames and back, following the official wire-protocol specification. It does no networking, pooling, or SQL — just framing.
Probably not, unless you are building a driver or doing wire-level work (a proxy, traffic capture/replay, a custom client). If you just want to run SQL against dqlite from Python, use one of the higher layers — see The dqlite Python stack below.
pip install dqlite-wireRequires Python 3.13+.
from dqlitewire import encode_message, decode_message
from dqlitewire.messages import LeaderRequest
# Encode a request to bytes
data = encode_message(LeaderRequest())
# Decode bytes back into a message object
message = decode_message(data, is_request=True)This is the lowest of four layered packages. Each builds on the one below:
| Package | Role |
|---|---|
| sqlalchemy-dqlite | SQLAlchemy 2.0 dialect |
| dqlite-dbapi | PEP 249 (DB-API 2.0) driver — sync & async |
| dqlite-client | Async wire client — pooling, leader discovery |
| dqlite-wire — this package | Wire-protocol codec |
Most applications should use dqlite-dbapi or sqlalchemy-dqlite.
- Thread-safety — codec objects are single-owner; read this before sharing one.
- Divergences from upstream — the defensive caps and stricter validations this codec adds on top of the C server and go-dqlite.
See DEVELOPMENT.md for setup and contribution guidelines.
MIT