Skip to main content

kronotop-py

CI License

Official Python client for Kronotop.

Kronotop speaks RESP2 and RESP3 on the wire. The client is built on redis-py.

Install

pip install kronotop-py
# or, with the C parser:
pip install "kronotop-py[hiredis]"

Usage

See Kronotop's Quickstart document first.

from kronotop import Kronotop

client = Kronotop()  # localhost:5484
with client.session() as session:
    session.ping()

One TCP connection is one session, and the session holds the open transaction. The client keeps a pool, so a session pins one connection until it is closed. Every command is on the session.

with client.session() as session:
    session.zmap.set("greeting", "Hello")  # commits on its own
    session.zmap.get("greeting")  # b'Hello'

    with session.transaction(returning="committed-version") as tx:
        session.zmap.set("a", "1")
        session.zmap.set("b", "2")
    # COMMIT on a clean exit, ROLLBACK when the block raises
    print(tx.committed_version)

KronotopConfig carries the session attributes and the namespace. Every session opened on the client starts from it.

from kronotop import KronotopConfig

client = Kronotop(config=KronotopConfig(namespace="app", batch=500))
from kronotop.asyncio import Kronotop

client = Kronotop()

async with client.session() as session:
    async with session.transaction():
        ...

await client.aclose()

Examples

The examples folder has small programs that show the client in use.

Packages

This repository is a monorepo. Each directory under packages/ ships as its own distribution.

Development

uv sync --all-extras --all-packages
uv run ruff check . && uv run ruff format --check .
uv run mypy

Tests

uv run pytest                        # integration tests skip without a server
uv run pytest -m "not integration"   # never touches the network
uv run pytest -m integration         # only the tests that need a server

uv run pytest also runs the tests of the packages under packages/. Their dependencies, mem0 among them, are installed by uv sync --all-packages. Without them, pytest stops while it collects those tests. To run one tree alone:

uv run pytest tests                          # the client only
uv run pytest packages/mem0-kronotop/tests   # mem0-kronotop only

Integration tests connect to kronotop://localhost:5484, and the Admin tests to the admin port of that member, localhost:3320. Use --kronotop-url and --kronotop-admin-host to point them somewhere else. The tests that need a password are skipped unless --kronotop-password names the auth.requirepass of the server.

uv run pytest -m integration --kronotop-url kronotop://192.168.1.10:5484
uv run pytest -m integration --kronotop-admin-host 192.168.1.10:3320
uv run pytest -m integration --kronotop-password devpass

Start a Kronotop first. docker/docker-compose.yaml brings up FoundationDB and one Kronotop node:

docker compose -f docker/docker-compose.yaml up

License

Apache License 2.0. See LICENSE.

Metadata

Release files for kronotop-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)

Source distribution for kronotop-py 0.2.0
File Size Uploaded Provenance Actions
kronotop_py-0.2.0.tar.gz 309.9 kB With provenance Details for kronotop_py-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kronotop-py 0.2.0
File Interpreter ABI Platform Actions
kronotop_py-0.2.0-py3-none-any.whl Python 3 none any Details for kronotop_py-0.2.0-py3-none-any.whl

Total release size: 416.6 kB

Release files / kronotop_py-0.2.0.tar.gz

Download URL kronotop_py-0.2.0.tar.gz
Size 309.9 kB
Tags Source
SHA-256 checksum
How to use checksums
de8c402afd8d700f3dc469a743656f46c1900732667f3df26e3a6272cd84b69a
BLAKE2b-256 checksum
How to use checksums
1fee0310b8baa3703dadf2354bff7b14e5a03929b6e303db468529d4ecce778b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 18, 2026.

Transparency log

Release files / kronotop_py-0.2.0-py3-none-any.whl

Download URL kronotop_py-0.2.0-py3-none-any.whl
Size 106.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e41c288e0d420840a7cd11faf3c6b99eca859356421728c2d491f6ed44fee63
BLAKE2b-256 checksum
How to use checksums
b7496d11a89cb2fd57d18033e969f23c2c951be2fb92a6794a0bb90331bad442
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 18, 2026.

Transparency log

Security for kronotop-py 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kronotop_py-0.2.0.tar.gz

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 Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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