Skip to main content

OpenKache Python client

openkache is the maintained synchronous Python client for the frozen OpenKache v1 Gate 0 (v1-gate0) contract. It exposes only the five contract operations:

Operation Result
Client.connect(address) A connected client
client.get(key) Found(value) or Missing
client.set(key, value) SetOutcome
client.delete(key) DeleteOutcome.DELETED or DeleteOutcome.NOT_FOUND
client.close() Idempotent resource release

Mapped keys accept UTF-8 str, signed 64-bit int, and bytes-like values. Every public value read and write uses StructuredValue-CBOR-v1; JSON, raw operations, TTL and retry overrides, cancellation controls, and certificate configuration are outside this Gate 0 facade.

SetOutcome contains only CREATED and REPLACED. A conditional NOT_STORED response is outside Gate 0 and raises OpenKacheIncompatibleServerError, because the facade never sends conditional writes. A mutation whose response is lost raises the distinct OpenKacheUnknownMutationError.

Install

python -m pip install openkache

Quick start

The package-local example is intentionally development-only. It uses QUIC-over-TLS 1.3 with server-certificate verification disabled; do not use it for production credentials or internet-facing deployments.

OPENKACHE_ADDRESS=127.0.0.1:4433 python examples/basic.py
from openkache import Client, DeleteOutcome, Found, Missing

client = Client.connect("127.0.0.1:4433")
try:
    client.set("profile", {"name": "OpenKache", "visits": 1})
    result = client.get("profile")
    if isinstance(result, Found):
        print(result.value)
    elif isinstance(result, Missing):
        print("missing")
    if client.delete("profile") is DeleteOutcome.DELETED:
        print("deleted")
finally:
    client.close()

client.get always returns model wrappers that preserve Undefined, None/Null, booleans, arbitrary integers, Float16/32/64 width and raw bits, bytes, text, arrays, and ordered scalar-key maps. This lossless contract keeps every StructuredValue kind observable to Python callers.

Configuration

Gate 0 has no certificate, timeout, retry, TTL, or transport configuration. The development example reads only OPENKACHE_ADDRESS.

The lossless constructors and codec helpers are available for applications that need an explicit model value:

from openkache import FloatValue, IntegerValue, MapValue, UNDEFINED

value = MapValue([
    ("count", IntegerValue(2**80)),
    ("missing", UNDEFINED),
    ("half", FloatValue(16, 0x3C00)),
])

Build and verify

Run these commands from openkache/clients/python in a checkout with the repository development tools:

python -m compileall src examples
OPENKACHE_GENERATION_TARGET=python ../generate.ts
python -m unittest ../../../tests/clients/python_value_test.py
python -m build --sdist --wheel --outdir dist

The generated Smithy modules and platform-native adapter are package build outputs. Do not commit dist/, build/, generated modules, or native libraries.

Package layout

  • src/openkache/_client.py — Gate 0 facade and key/result mapping.
  • src/openkache/_native.py — ctypes ownership and native ABI conversion.
  • src/openkache/_value.py — lossless StructuredValue-CBOR-v1 codec.
  • src/openkache/_generated/ — generated contract and ABI modules.
  • native/ — thin Rust cdylib adapter over the shared client core.
  • examples/basic.py — clearly labeled development-only TLS example.

License

The Python client and native adapter are distributed under the Apache License 2.0. Package artifacts include the license text.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openkache-0.1.1.tar.gz (514.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openkache-0.1.1-py3-none-manylinux_2_38_x86_64.whl (4.1 MB view details)

Uploaded Python 3manylinux: glibc 2.38+ x86-64

File details

Details for the file openkache-0.1.1.tar.gz.

File metadata

  • Download URL: openkache-0.1.1.tar.gz
  • Upload date:
  • Size: 514.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for openkache-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2f4b58a0f72f70b28243f8b8658b71c2bbd5d0ff6873eefc1a764137a0dfa7b8
MD5 ee61b182643ad66dc40c2d772f6bbae3
BLAKE2b-256 3dd8804d76d1407815ad5a40db550bffab4866a065a4f4833afeb4e3cc8dba43

See more details on using hashes here.

Provenance

The following attestation bundles were made for openkache-0.1.1.tar.gz:

Publisher: publish-pypi.yml on openkache/openkache

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openkache-0.1.1-py3-none-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for openkache-0.1.1-py3-none-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 eb553e3fbc2bf56065a7d1c9ca3bdd90a0eaa484dba4cf149a86ee9f081b328e
MD5 4e6f0d028beb96689c195e7929eb2d1b
BLAKE2b-256 962c4110887e95bffabddda9bd12e55943e8aa63c56b0f32897981134a5da67d

See more details on using hashes here.

Provenance

The following attestation bundles were made for openkache-0.1.1-py3-none-manylinux_2_38_x86_64.whl:

Publisher: publish-pypi.yml on openkache/openkache

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.3

7 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

0.0.2

2 files

0.0.1

2 files

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