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 the shared TLS 1.3 transport 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 Rustcdylibadapter 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openkache-0.1.0.tar.gz.
File metadata
- Download URL: openkache-0.1.0.tar.gz
- Upload date:
- Size: 514.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc66deb07b707d919a85db89a9422b355f94aa90cd1e761938f23ac8b9fd8376
|
|
| MD5 |
eaf120b28671b0cfcf995e8baadf9b27
|
|
| BLAKE2b-256 |
7a46c4d7fde12c49c897d5cc5ec2b92b7ddea6a8b190db007229a432021a470a
|
Provenance
The following attestation bundles were made for openkache-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on openkache/openkache
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openkache-0.1.0.tar.gz -
Subject digest:
dc66deb07b707d919a85db89a9422b355f94aa90cd1e761938f23ac8b9fd8376 - Sigstore transparency entry: 2582687347
- Sigstore integration time:
-
Permalink:
openkache/openkache@7a536c42a90280dac6c5de29f67be898fdf95da5 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/openkache
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7a536c42a90280dac6c5de29f67be898fdf95da5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file openkache-0.1.0-py3-none-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: openkache-0.1.0-py3-none-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 4.0 MB
- Tags: Python 3, manylinux: glibc 2.38+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6e9725bdd50d8a7d363c14fae88579df21dcde71fda1975afdb84781f69914b
|
|
| MD5 |
2830bf5b285e3bb30dc628baebbdb638
|
|
| BLAKE2b-256 |
590620c3ce2f6ac0b3f74d070795bf7c4ae0c1fa765b002f9277cf1bb7379e2f
|
Provenance
The following attestation bundles were made for openkache-0.1.0-py3-none-manylinux_2_38_x86_64.whl:
Publisher:
publish-pypi.yml on openkache/openkache
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openkache-0.1.0-py3-none-manylinux_2_38_x86_64.whl -
Subject digest:
b6e9725bdd50d8a7d363c14fae88579df21dcde71fda1975afdb84781f69914b - Sigstore transparency entry: 2582687351
- Sigstore integration time:
-
Permalink:
openkache/openkache@7a536c42a90280dac6c5de29f67be898fdf95da5 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/openkache
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7a536c42a90280dac6c5de29f67be898fdf95da5 -
Trigger Event:
workflow_dispatch
-
Statement type: