--- id: libvalkey version: "4.1.0" license: MIT license_treatment: permissive maintenance: active --- # libvalkey — Python wrapper for libvalkey License: permissive · Maintenance: active · Downloads: 919.7K/mo ## 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 above — 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 pip install libvalkey uv add libvalkey 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_current - Install friction: medium - Maintenance: active - Downloads: 919.7K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags redis protocol parser, valkey reply parsing, fast protocol parsing, redis bulk reply parser, protocol parsing acceleration, protocol-parsing, performance-optimization, valkey-redis [View on SkillFed](https://skillfed.io/packages/libvalkey) · [View on PyPI](https://pypi.org/project/libvalkey/)