fakeredis
Python implementation of redis API, can be used for testing purposes.
Decision gist · record as of 2026-08-14
Yes. fakeredis is actively maintained, has no known vulnerabilities, carries a permissive license, and solves a real testing problem with minimal friction. Install it if you write tests for Redis-dependent code and want to avoid server setup; skip it only if you need production-grade performance benchmarking or exact behavioral fidelity for advanced Redis features.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with just three runtime dependencies (redis, sortedcontainers, typing-extensions).
- Active maintenance with a recent release 23 days ago and ongoing commits.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows use in most projects, including proprietary software, with minimal restrictions.
last release 2026-07-22 (23 days) · last repo commit 2026-08-10 · 452 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 50,665,879 downloads/mo, #572 on PyPI
Alternatives
Verify before relying
pip install fakeredis
import fakeredis
r = fakeredis.FakeStrictRedis()
r.set("foo", "bar")
print(r.get("foo")) # b'bar'- Completeness of Redis command coverage beyond the documented 'supported commands' list
- Performance characteristics compared to actual Redis for large datasets or high-throughput scenarios
- Behavior fidelity for edge cases in Lua scripting, transactions, or cluster-specific features
What it is and what it does
fakeredis is a drop-in replacement for the redis-py and valkey-py clients that runs entirely in memory without requiring a Redis server, Docker container, or network connection. It implements the Redis protocol in pure Python and supports synchronous, asynchronous, and multi-client patterns. You can use it to write and run tests that depend on Redis, Valkey, DragonflyDB, or KeyDB without infrastructure overhead.
The package supports core Redis commands plus optional extras for Lua scripting, JSON operations, Bloom and probabilistic filters, and TimeSeries commands. You can pin a specific server type and version to test compatibility, share state across multiple in-memory clients, or isolate each test with independent servers. It's designed for testing workflows where speed and simplicity matter more than production-grade performance.
Use it for
- Write unit tests for cache-backed applications without spinning up a Redis container or managing ports
- Test multi-client Redis interactions by creating multiple FakeStrictRedis instances sharing one FakeServer
- Verify Lua script behavior during development using the lua extra without a real Redis instance
- Emulate specific Redis or Valkey versions to test compatibility before upgrading production systems
- Prototype Redis-based features in CI/CD pipelines where container overhead is undesirable
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
fakeredis is actively maintained, has no known vulnerabilities, carries a permissive license, and solves a real testing problem with minimal friction. Install it if you write tests for Redis-dependent code and want to avoid server setup; skip it only if you need production-grade performance benchmarking or exact behavioral fidelity for advanced Redis features.
Install
fakeredis on PyPI
Before you install
Low friction: pure Python wheel with just three runtime dependencies (redis, sortedcontainers, typing-extensions). Active maintenance with a recent release 23 days ago and ongoing commits.
License in practice
BSD-3-Clause permissive license allows use in most projects, including proprietary software, with minimal restrictions.
Quickstart
pip install fakeredis
import fakeredis
r = fakeredis.FakeStrictRedis()
r.set("foo", "bar")
print(r.get("foo")) # b'bar'
Verify before relying
- Completeness of Redis command coverage beyond the documented 'supported commands' list
- Performance characteristics compared to actual Redis for large datasets or high-throughput scenarios
- Behavior fidelity for edge cases in Lua scripting, transactions, or cluster-specific features
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesredissortedcontainerstyping-extensions |
| Maintenance | Actively maintained 23 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 50,665,879 / month, #572 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableDevelopment Status :: 6 - MatureIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules |
Evidence: fakeredis-2.37.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “redis testing mock”
- fakeredisfakeredis provides an in-memory, pure-Python implementation of the…
- pytest-mock-resourcesProvides pytest fixtures that spin up real database and service…
- flask-redisIntegrates Redis into Flask applications as a managed extension,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also redis · burner-redis · redislite · libvalkey · py-redis · redis-cli · hiredis · valkey · flask-redis · redis-entraid