Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ZydecoDB Python driver

Official Python client for ZydecoDB. Pure standard library, no runtime dependencies.

Wire reference: this client is the hand-maintained reference codec. Go and TypeScript track the same bytes via ../conformance/vectors.json (CI job wire-conformance).

Install

pip install zydecodb

Requires Python 3.9+. (Working from a checkout of this repo: pip install -e clients/python.)

Quick start

from zydecodb import Client

# Plain TCP (localhost). For TLS: Client(..., api_key="YOUR_KEY", tls=True)
with Client("127.0.0.1", 9470, api_key="YOUR_KEY") as db:
    users = db.collection("users")
    users.create_index(["email"], unique=True)

    uid = users.insert_one({"email": "ada@example.com", "name": "Ada", "age": 30})

    for u in users.find({"age": {"$gte": 18}}, sort=[("age", True)]):
        print(u["name"], u["age"])

    users.update_one({"_id": uid}, {"$inc": {"age": 1}})
    print(users.count_documents())

What you get

  • Connection pooling. Client owns a thread-safe pool (pool_size, default 8) and is safe to share across threads.
  • Automatic retries with backoff. Transient transport failures and server EngineBusy responses are retried (full-jitter exponential backoff) for operations that are safe to repeat. Operator updates and deletes are never retried automatically.
  • Keepalive. Idle pooled connections are validated with a Ping on checkout and transparently replaced if dead.
  • Typed error taxonomy. Non-OK responses raise a specific subclass: ConflictError (unique-index violation), AuthError, ServerBusyError, InvalidRequestError, or the base ServerError — each carrying the wire status byte. Transport problems raise ConnectionError.
  • Collection API. insert_one/many, find/find_one, update_one/many, delete_one/many, count_documents, distinct, create_index, with $-operators, sort, projection, and skip/limit. Pagination is repeatable-read across pages.
  • Raw KV with TTL. Side-channel put (with expires_at), get, and delete methods on Client for session data that needs a time-to-live.
  • TLS. Pass tls=True for system CA defaults, or an ssl.SSLContext for custom roots / verification.

Durability

Writes are durable (fsync-on-commit) by default. For latency-sensitive, loss-tolerant writes, pass relaxed=True to acknowledge before the fsync. It is available on every write: insert_one, replace_one, update_one, update_many, delete_one, and delete_many.

users.insert_one(doc, relaxed=True)
users.update_one({"_id": "ada"}, {"$inc": {"hits": 1}}, relaxed=True)
users.delete_many({"stale": True}, relaxed=True)

Running the tests

Unit + wire conformance (no server):

cd clients/python
pip install -e ".[dev]"
pytest tests/test_protocol.py tests/test_conformance.py

Integration tests run against a live server selected by environment variables (skipped automatically if it is unreachable):

ZYDECODB_TEST_HOST=127.0.0.1 ZYDECODB_TEST_PORT=9470 pytest

Release files for zydecodb 0.9.0b6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zydecodb 0.9.0b6
File Size Uploaded
zydecodb-0.9.0b6.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zydecodb 0.9.0b6
File Interpreter ABI Platform
zydecodb-0.9.0b6-py3-none-any.whl Python 3 none any Details

Total release size: 29.2 kB

Release files / zydecodb-0.9.0b6.tar.gz

Download URL zydecodb-0.9.0b6.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
01dfb606beab77a24ded37d9c112e54ab65cef3cd92aadf33a5feca43bb2a996
BLAKE2b-256 checksum
How to use checksums
6812ec778f26671c7eb4f2cd7a27e4abb1f1450ce2d72d15aaa28fc650e6790c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Release files / zydecodb-0.9.0b6-py3-none-any.whl

Download URL zydecodb-0.9.0b6-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
855e029bac1bf0bcd54d7b49a0bccbecf1ff401c2f187d56a828d4678a73741b
BLAKE2b-256 checksum
How to use checksums
d1901619eadf1e17a65690c3453eb6c1d14c4287c77637a006b963fba940359e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page