Skip to main content

kevy — Python client

First-party Python client for kevy, the pure-Rust, Redis-compatible engine. One package ships both faces (contract §1.4): a blocking Client and an asyncio AsyncClient — the same shape as redis-py's redis + redis.asyncio.

pip install kevy
import kevy

# Remote — native RESP2/3 over TCP. Standard library only.
r = kevy.connect("kevy://127.0.0.1:6379")
r.set("k", "v")
assert r.get(b"k") == b"v"

# Asyncio — same package, same results.
ac = await kevy.AsyncClient.connect("kevy://127.0.0.1:6379")
await ac.set("k", "v")

# Embedded (in-process), over the C ABI with ctypes. Needs the engine —
# see below; this line raises a message naming where to get it otherwise.
c = kevy.connect("mem://app")        # or  file:///var/lib/app

The embedded engine

mem:// and file:// run kevy inside your process through libkevy_ffi, a per-platform native library. A Python wheel does not carry it: it would work on the handful of targets we happened to build and nowhere else, while the remote client above works everywhere CPython does. So the engine comes from the engine's own repository —

git clone https://github.com/goliajp/kevy
cd kevy && cargo build --release -p kevy-ffi   # → target/release/

— and is found automatically from a kevy checkout, or by pointing KEVY_FFI_LIB at the built library. Without it, the first embedded call raises an error saying exactly this. Nothing else in the API differs.

One URL, two transports (§1.1)

Scheme Backend
mem:// embedded, isolated in-memory store
mem://<name> embedded, shared by name (pub/sub works cross-connect)
file:///abs/path embedded, persistent (snapshot + AOF)
kevy:// / redis:// / tcp:// remote RESP over TCP

rediss:// / kevys:// (TLS) and redis://user:pass@host (AUTH) are rejected — kevy has neither.

Embedded door (§5)

kevy.open_mem() / kevy.open_persistent(dir) return a DB — the in-process store over libkevy_ffi, driven by ctypes (no C-extension build). Every verb is reachable through db.cmd(*argv) -> Reply; db.get / db.set are the scalar fast paths; db.subscribe(chan) gives a polled (next()) + blocking (wait(ms)) subscription. The library is located via $KEVY_FFI_LIB or the repo target/{release,debug} build.

Command families

Every family of the contract (§3): core string/generic, hash, list, set, sorted set, sorted-set algebra, hash-field TTL, declarative indexes (idx_*, remote-only) — with any other IDX.* subcommand reachable through the raw do(*argv) / idx_query_raw escape hatches — change feed (feed_*), pub/sub (Subscriber / AsyncSubscriber), transactions (Transaction), pipelines, blocking pops (blpop/brpop/bzpopmin), and the cluster client (ClusterClient). Bytes and str are both accepted; the wire is bytes (§7).

Errors (§2)

Raised as a KevyError hierarchy inspectable by type: StoreError (WrongTypeError, NotIntegerError, …), ProtocolError, IoError, UnsupportedError, InvalidInputError, NotFoundError, ReadOnlyError, TimedOutError, ClosedError.

Tests

pip install -e '.[test]'
pytest                       # embedded + remote (spawns a real kevy server)

Remote tests build and boot kevy on a temp port; they skip cleanly if the server binary is absent (cargo build --release -p kevy).

Download files

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

Source Distribution

kevy-5.2.0.tar.gz (50.3 kB view details)

Uploaded Source

Built Distribution

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

kevy-5.2.0-py3-none-any.whl (52.2 kB view details)

Uploaded Python 3

File details

Details for the file kevy-5.2.0.tar.gz.

File metadata

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

File hashes

Hashes for kevy-5.2.0.tar.gz
Algorithm Hash digest
SHA256 2f412e8f683687819034dffd33c6dc87572fd83fbf4d438ca09f36e30be22add
MD5 0eac02296e39bca80769e7d9c7d3e893
BLAKE2b-256 c872f3e48ddd82959d0927f72de90fb33a954c56b9acb92460169ebc8c578d99

See more details on using hashes here.

Provenance

The following attestation bundles were made for kevy-5.2.0.tar.gz:

Publisher: pypi.yml on goliajp/kevy

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

File details

Details for the file kevy-5.2.0-py3-none-any.whl.

File metadata

  • Download URL: kevy-5.2.0-py3-none-any.whl
  • Upload date:
  • Size: 52.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for kevy-5.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30e67183e6120560b963835d6fa0a429c06a57fd76d9eb6f7e7d116373d7ef3d
MD5 ad4b00cf62367d03702ef53367b92092
BLAKE2b-256 7dcb98ff8d0022e938453d47c93d464e5a485e455bbd3ee74a62b45be885fac3

See more details on using hashes here.

Provenance

The following attestation bundles were made for kevy-5.2.0-py3-none-any.whl:

Publisher: pypi.yml on goliajp/kevy

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

Release history Release notifications | RSS feed

6.3.0

2 files

6.2.2

2 files

6.2.1

2 files

6.2.0

2 files

6.1.0

2 files

6.0.0

2 files

5.3.0

2 files

This release

5.2.0 This release

2 files

5.1.0

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