skillfed

libvalkey

Python wrapper for libvalkey

libvalkey v4.1.0 919.7K downloads/30d#4,720 on PyPI3
Permissive license MIT Active released

What it is and what it does

libvalkey is a Python extension that wraps the C library libvalkey to speed up parsing of Valkey and Redis protocol replies. It provides a `Reader` class that buffers incoming data and parses RESP (Redis Serialization Protocol) replies incrementally. The extension is designed to integrate with Valkey/Redis client libraries to accelerate reply parsing, particularly for multi-bulk replies where the performance gains are most significant.

The package requires Python 3.9 or later and needs C compilation during installation, which means you need a C compiler and Python development headers available on your system. It has no runtime dependencies and is designed as a low-level parsing component rather than a standalone client library—it handles protocol parsing only and does not provide I/O functionality.

Use it for:

  • Accelerate Valkey/Redis client performance when handling large multi-bulk replies like LRANGE results
  • Integrate into custom Valkey/Redis client implementations that need faster protocol parsing
  • Reduce latency in high-throughput Valkey/Redis workloads where reply parsing is a bottleneck
  • Parse RESP protocol data with custom encoding support (UTF-8, etc.) and error handling

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

libvalkey is a Python C extension that accelerates parsing of Valkey/Redis protocol replies, particularly multi-bulk responses, by wrapping protocol parsing code from the libvalkey C library.

Yes, if you are using Valkey or Redis with Python and handle large multi-bulk replies. The performance gains are modest for simple operations (1.1x for SET/GET) but dramatic for larger replies (83.2x for LRANGE 0 999). Install friction is medium due to C compilation requirements. No security vulnerabilities and actively maintained. MIT license poses no restrictions.

Install

libvalkey on PyPI

pip

pip install libvalkey

uv

uv add libvalkey

poetry

poetry add libvalkey

Installing libvalkey

Before you install

Medium install friction due to compiled C extension requiring build tools and Python development headers. Active maintenance with recent releases (27 days since last update); repository has low star count but is actively developed.

License in practice

MIT license is permissive; you can use this package freely in commercial and private projects without restriction or obligation to share modifications.

Quickstart

pip install libvalkey

import libvalkey
reader = libvalkey.Reader()
reader.feed(b"$5\r\nhello\r\n")
result = reader.gets()
print(result)  # b'hello'

Requires C compiler (gcc) and Python development headers (python3-dev on Ubuntu/Debian). Python 3.9 or later required.

Verify before relying

  • Whether performance improvements apply to your specific workload patterns and Valkey/Redis usage
  • Compatibility with alternative Valkey/Redis client libraries beyond valkey-py

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 27 days since the last release
Last repo commit
First released
Downloads 919,709/month — #4,720 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: libvalkey-4.1.0-cp310-cp310-macosx_11_0_arm64.whl; libvalkey-4.1.0-cp310-cp310-macosx_11_0_universal2.whl; libvalkey-4.1.0-cp310-cp310-macosx_11_0_x86_64.whl; libvalkey-4.1.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; libvalkey-4.1.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl; libvalkey-4.1.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl; libvalkey-4.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; libvalkey-4.1.0-cp310-cp310-musllinux_1_2_aarch64.whl; libvalkey-4.1.0-cp310-cp310-musllinux_1_2_ppc64le.whl; libvalkey-4.1.0-cp310-cp310-musllinux_1_2_s390x.whl; libvalkey-4.1.0-cp310-cp310-musllinux_1_2_x86_64.whl; libvalkey-4.1.0-cp310-cp310-win32.whl; libvalkey-4.1.0-cp310-cp310-win_amd64.whl; libvalkey-4.1.0-cp311-cp311-macosx_11_0_arm64.whl; libvalkey-4.1.0-cp311-cp311-macosx_11_0_universal2.whl; libvalkey-4.1.0-cp311-cp311-macosx_11_0_x86_64.whl; libvalkey-4.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; libvalkey-4.1.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl; libvalkey-4.1.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl; libvalkey-4.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Keywords: Valkey

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: POSIXProgramming Language :: CProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development

Tags

redis protocol parservalkey reply parsingfast protocol parsingredis bulk reply parserprotocol parsing acceleration
protocol-parsingperformance-optimizationvalkey-redis

More Software Development packages