--- id: valkey version: "6.1.1" license: MIT license_treatment: permissive maintenance: active --- # valkey — Python client for Valkey forked from redis-py License: permissive · Maintenance: active · Downloads: 5.9M/mo ## What it is and what it does Valkey is a Python client library that provides a complete interface to the Valkey key-value store, a fork of Redis. It exposes all standard Valkey commands through native Python methods, handles connection pooling automatically, and supports both synchronous and asynchronous workflows. The library includes built-in support for advanced features like pipelining (batching commands to reduce round-trip overhead), pub/sub messaging, and RESP3 protocol negotiation. The package is designed as a drop-in replacement for redis-py, with backward-compatible aliases available for a smooth migration path. It depends only on async-timeout for its core functionality and optionally integrates a compiled response parser (libvalkey) for improved performance when available. The library supports modern Python versions (3.9 through 3.13) and runs on both CPython and PyPy. Use it for: - Build a session store or cache layer for web applications using synchronous or async connection pools. - Implement real-time messaging or event distribution using pub/sub channels. - Batch multiple database operations into a single round-trip using pipelines to reduce latency. - Migrate existing redis-py code to Valkey with minimal changes using provided compatibility aliases. - Store and retrieve structured data (strings, hashes, lists, sets) in a high-performance key-value store. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Python client library for connecting to and executing commands against a Valkey key-value store, with support for connection pooling, pipelining, pub/sub messaging, and both synchronous and asynchronous operations. Yes. Valkey-py is actively maintained, has no known vulnerabilities, installs with minimal friction, and provides a complete, production-stable Python interface to Valkey. It is the appropriate choice for any Python application that needs to interact with a Valkey server, whether for caching, sessions, pub/sub, or general key-value operations. The MIT license poses no restrictions. ## Install pip install valkey uv add valkey poetry add valkey ## Installing valkey Before you install: Low install friction with a single lightweight runtime dependency (async-timeout). Active maintenance with recent commits and stable production status across Python 3.9–3.13. License in practice: MIT license permits commercial and private use with minimal restrictions; no copyleft obligations. Quickstart: pip install valkey import valkey r = valkey.Valkey(host='localhost', port=6379, db=0) r.set('foo', 'bar') print(r.get('foo')) Requires a running Valkey server (e.g., via Docker or local installation) accessible on the specified host and port. Verify before relying: - Whether the optional libvalkey compiled parser (libvalkey >= 2.3.2) is automatically detected and used when installed. - Performance characteristics and overhead of the async-timeout dependency under high concurrency. - Compatibility guarantees with Valkey server versions beyond what the documentation states. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 5.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags valkey python client, key-value store client, redis-compatible python, valkey connection library, python database client, pub/sub messaging client, async key-value store, key-value-store, async-support, pub-sub [View on SkillFed](https://skillfed.io/packages/valkey) · [View on PyPI](https://pypi.org/project/valkey/)