reckon-py
Python gRPC client for ReckonDB.
Packages the generated stubs for all ReckonDB services and adds three thin conveniences:
connect(), named integer sentinels, and TagFilter helpers for DCB queries.
Install
pip install reckon-py
The distribution is reckon-py; the import package is reckon_db:
import reckon_db
Requires Python 3.10+, grpcio ≥ 1.81.1, protobuf ≥ 6.33.5 and < 7: the versions the stubs were generated with, and the oldest they run on. 0.2.0 is the first release on PyPI.
Quick start
import reckon_db
from reckon_db._proto import reckon_streams_pb2 as streams_pb
from reckon_db._proto import reckon_streams_pb2_grpc as streams_grpc
channel = reckon_db.connect("localhost:50051", insecure=True)
stub = streams_grpc.StreamServiceStub(channel)
stub.AppendEvents(streams_pb.AppendEventsRequest(
store_id="default_store",
stream_id="users-1",
expected_version=reckon_db.AnyVersion,
events=[streams_pb.ProposedEvent(
event_type="user_registered_v1",
data=b'{"name": "Alice"}',
tags=["email:alice@example.com"],
)],
))
Available proto modules
| Module | Service |
|---|---|
reckon_db._proto.reckon_streams_pb2[_grpc] |
Streams (append, read, watch, indexed reads) |
reckon_db._proto.reckon_dcb_pb2[_grpc] |
DCB (cross-aggregate conditional append) |
reckon_db._proto.reckon_subscriptions_pb2[_grpc] |
Persistent subscriptions |
reckon_db._proto.reckon_snapshots_pb2[_grpc] |
Snapshots |
reckon_db._proto.reckon_temporal_pb2[_grpc] |
Temporal reads (read until or between points in time, version at a time) |
reckon_db._proto.reckon_schema_pb2[_grpc] |
Schemas (register, list, version, upcast events) |
reckon_db._proto.reckon_stores_pb2[_grpc] |
Store discovery |
reckon_db._proto.reckon_admin_pb2[_grpc] |
Administration (store and stream stats, scavenge, stream links, catalogue) |
reckon_db._proto.reckon_health_pb2[_grpc] |
Health checks |
reckon_db._proto.reckon_shared_pb2 |
Shared types |
Sentinels
reckon_db.AnyVersion # -2 append regardless of current stream version
reckon_db.NoStream # -1 append only if the stream does not exist
reckon_db.StreamExists # -4 append only if the stream exists
reckon_db.SEQ_CUTOFF_SAW_NOTHING # -1 DCB: treat any match as a conflict
DCB TagFilter helpers
import reckon_db
from reckon_db._proto import reckon_dcb_pb2 as dcb_pb
from reckon_db._proto import reckon_dcb_pb2_grpc as dcb_grpc
stub = dcb_grpc.DcbServiceStub(channel)
f = reckon_db.and_(
reckon_db.event_type("seat_reserved_v1"),
reckon_db.match_any("seat:FL-42:A3"),
)
ctx = stub.ReadDcbContext(dcb_pb.ReadDcbContextRequest(
store_id="default_store",
tag_filter=f,
))
cutoff = ctx.max_seq if ctx.events else reckon_db.SEQ_CUTOFF_SAW_NOTHING
resp = stub.AppendIfNoTagMatches(dcb_pb.AppendIfNoTagMatchesRequest(
store_id="default_store",
tag_filter=f,
seq_cutoff=cutoff,
events=[...],
))
if resp.HasField("committed"):
print("done", resp.committed.last_seq)
All helpers return reckon_dcb_pb2.TagFilter objects directly.
| Helper | Proto field |
|---|---|
match_any(*tags) |
TagFilter.match_any |
match_all(*tags) |
TagFilter.match_all |
event_type(t) |
TagFilter.event_type_match |
and_(*filters) |
TagFilter.conjunction |
or_(*filters) |
TagFilter.disjunction |
TLS
# Plaintext (lab / loopback only)
channel = reckon_db.connect("localhost:50051", insecure=True)
# System root pool
channel = reckon_db.connect("reckon.example.com:50051")
# Private CA
channel = reckon_db.connect("reckon.example.com:50051", ca_cert="/path/to/ca.pem")
# IP dial with SNI override
channel = reckon_db.connect("10.0.0.5:50051", server_name_override="reckon.example.com")
Regenerating stubs
If you update the proto definitions:
pip install grpcio-tools
./scripts/gen_proto.sh
License
Apache-2.0
Release files for reckon-py 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| reckon_py-0.2.0.tar.gz | 50.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| reckon_py-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 106.5 kB
Release files / reckon_py-0.2.0.tar.gz
| Download URL | reckon_py-0.2.0.tar.gz |
|---|---|
| Size | 50.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3eeb52bf5f9005fc735e66b89887f32b67ef086d57a92a34208e3d54e285cc06
|
|
BLAKE2b-256 checksum How to use checksums |
e8e134dce0ce47f61577ae8020aac91218d731128dd88bab2d7138c450267ca1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Sep 26, 2026.
Transparency logRelease files / reckon_py-0.2.0-py3-none-any.whl
| Download URL | reckon_py-0.2.0-py3-none-any.whl |
|---|---|
| Size | 55.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cafa9544fb020e956e651acaa09ee2627dc7a9ad49d9337f9bc84f12143cf6da
|
|
BLAKE2b-256 checksum How to use checksums |
947b24fcd491c5263bd7b3467da0c8384ffcbf5c02ba1e09aca0f35a09b65f37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Sep 26, 2026.
Transparency log