# Python Redis libraries

Python Redis libraries connect applications to Redis, the in-memory key-value store, to read and write keys and run its commands. Higher-level libraries map Python containers and object models onto Redis keys rather than exposing raw commands. These libraries let web apps, task workers, and AI agents share cached data across processes.

## Popularity

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [redis-py](#redis-py) | 247.7M | 13.7K | Jul 2026 | MIT |
| [Fakeredis](#fakeredis) | 44.4M | 473 | Oct 2026 | BSD-3-Clause |
| [hiredis](#hiredis) | 39.1M | 527 | Oct 2026 | MIT |
| [coredis](#coredis) | 2.5M | 118 | Aug 2026 | MIT |
| [RedisVL](#redisvl) | 2.2M | 437 | Nov 2026 | MIT |
| [Pottery](#pottery) | 764.0K | 1.2K | Mar 2025 | Apache-2.0 |
| [Walrus](#walrus) | 155.7K | 1.2K | Jan 2026 | MIT |
| [Redis OM Python](#redis-om) | 148.6K | 1.3K | Oct 2026 | BSD-3-Clause |

Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[redis-py](#redis-py) has the most monthly downloads in this comparison, at 247.7M.

## Capabilities

| Library | Asynchronous API | Active-record models |
| --- | --- | --- |
| [redis-py](#redis-py) | Yes | No |
| [Fakeredis](#fakeredis) | Yes | No |
| [hiredis](#hiredis) | No | No |
| [coredis](#coredis) | Yes | No |
| [RedisVL](#redisvl) | Yes | No |
| [Pottery](#pottery) | Yes | No |
| [Walrus](#walrus) | No | Yes |
| [Redis OM Python](#redis-om) | Yes | Yes |

## Libraries

### redis-py

[GitHub](https://github.com/redis/redis-py) · [PyPI](https://pypi.org/project/redis) · [Docs](https://redis.readthedocs.io/en/latest/)

Provides a Python client interface to the Redis key-value store.

- Downloads / mo: 247.7M
- Stars: 13.7K
- Last release: 8.1.0
- License: MIT
- Capabilities: [From the redis-py docs](https://redis.readthedocs.io/en/latest/)

**Strengths**

- **Provides synchronous and asynchronous clients.** Use blocking clients or the asyncio API from the same package.
- **Groups commands into atomic transactions.** Use transactional pipelines to execute buffered commands atomically.

**Watch out for**

- **Pipelines cannot cross thread boundaries.** Keep PubSub and Pipeline objects within their owning thread.

```sh
pip install redis
```

**django/django** (91.8K stars)

[django/django](https://github.com/django/django) 

```python
def set_many(self, data, timeout):
    client = self.get_client(None, write=True)
    pipeline = client.pipeline()
    pipeline.mset({k: self._serializer.dumps(v) for k, v in data.items()})

    if timeout is not None:
        # Setting timeout for each key as redis does not support timeout
        # with mset().
        for key in data:
            pipeline.expire(key, timeout)
    pipeline.execute()
```

[django/core/cache/backends/redis.py](https://github.com/django/django/blob/f24f38c6b2825f15628c07bf2892f1664eed9361/django/core/cache/backends/redis.py#L152-L162) · [More projects using redis-py →](https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20redis%20for%20cache%20pipelines%2C%20Sentinel-managed%20connections%2C%20Lua-backed%20rate%20limiting%20or%20incremental%20response%20parsing&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
import redis
client = redis.Redis(host='localhost', port=6379, db=0)
client.set('foo', 'bar')

```

From [README.md](https://github.com/redis/redis-py)

### Fakeredis

[GitHub](https://github.com/cunla/fakeredis-py) · [PyPI](https://pypi.org/project/fakeredis) · [Docs](https://fakeredis.moransoftware.ca/)

Implements the Redis API in Python for testing.

- Downloads / mo: 44.4M
- Stars: 473
- Last release: 2.40.0
- License: BSD-3-Clause
- Capabilities: [From the Fakeredis docs](https://fakeredis.moransoftware.ca/)

```sh
pip install fakeredis
```

**Quickstart**

```python
import fakeredis
client = fakeredis.FakeStrictRedis()
client.set('foo', 'bar')

```

From [README.md](https://github.com/cunla/fakeredis-py) · [Find projects using Fakeredis →](https://dashboard.exa.ai/playground/search?q=fakeredis%20GitHub%20projects)

### hiredis

[GitHub](https://github.com/redis/hiredis-py) · [PyPI](https://pypi.org/project/hiredis) · [Docs](https://pypi.org/project/hiredis/)

Parses Redis protocol replies from byte streams without handling network I/O.

- Downloads / mo: 39.1M
- Stars: 527
- Last release: 3.5.0
- License: MIT
- Capabilities: [From the hiredis docs](https://pypi.org/project/hiredis/)

**Strengths**

- **Parses incomplete reply streams.** Feed byte chunks and retrieve replies when a complete response is buffered.
- **Decodes Unicode bulk replies.** Choose an encoding and error policy when constructing Reader.

**Watch out for**

- **Needs separate networking code.** Provide connection management and the network read loop elsewhere.
- **False can mean incomplete data.** Choose a custom sentinel when parsing native RESP booleans.

```sh
pip install hiredis
```

**redis/redis-py** (13.7K stars)

[redis/redis-py](https://github.com/redis/redis-py) 

```python
async def read_response(
    self, disable_decoding: bool = False, push_request: bool = False
) -> Union[EncodableT, List[EncodableT]]:
    while True:
        # If `on_disconnect()` has been called, prohibit any more reads
        # even if they could happen because data might be present.
        # We still allow reads in progress to finish
        if not self._connected:
            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None

        if disable_decoding:
            response = self._reader.gets(False)
        else:
            response = self._reader.gets()

        while response is NOT_ENOUGH_DATA:
            await self.read_from_socket()
            if disable_decoding:
                response = self._reader.gets(False)
            else:
                response = self._reader.gets()
        if self._hiredis_PushNotificationType is None or not isinstance(
            response, self._hiredis_PushNotificationType
        ):
            break
        response = await self.handle_push_response(response)
        if push_request:
            return response
        # Otherwise read the reply the push interleaved with. Looping
        # instead of recursing keeps a burst of consecutive push frames
        # from growing the stack.

    # if the response is a ConnectionError or the response is a list and
    # the first item is a ConnectionError, raise it as something bad
    # happened
    if isinstance(response, ConnectionError):
        raise response
    elif (
        isinstance(response, list)
        and response
        and isinstance(response[0], ConnectionError)
    ):
        raise response[0]
    return response
```

[redis/_parsers/hiredis.py](https://github.com/redis/redis-py/blob/68b1342409df85537264b50418fc8a8bcb2dd0c7/redis/_parsers/hiredis.py#L382-L425) · [More projects using hiredis →](https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20hiredis%20for%20cache%20pipelines%2C%20Sentinel-managed%20connections%2C%20Lua-backed%20rate%20limiting%20or%20incremental%20response%20parsing&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
import hiredis
reader = hiredis.Reader()
reader.feed(b'$5\r\nhello\r\n')
print(reader.gets())

```

From [README.md](https://github.com/redis/hiredis-py)

### coredis

[GitHub](https://github.com/alisaifee/coredis) · [PyPI](https://pypi.org/project/coredis) · [Docs](https://coredis.readthedocs.org)

Provides an asynchronous typed Redis client with cluster and Sentinel support.

- Downloads / mo: 2.5M
- Stars: 118
- Last release: 6.9.0
- License: MIT
- Capabilities: [From the coredis docs](https://coredis.readthedocs.org)

**Strengths**

- **Uses native asynchronous call sites.** Await Redis commands in an asynchronous application.
- **Connects to clusters and Sentinel.** Use the RedisCluster and Sentinel client interfaces.

**Watch out for**

- **Requires asynchronous call sites.** Await commands instead of using a blocking client interface.

```sh
pip install coredis
```

**alisaifee/limits** (657 stars)

[alisaifee/limits](https://github.com/alisaifee/limits) 

```python
def register_scripts(self) -> None:
    self.lua_moving_window = self.get_connection().register_script(
        self.SCRIPT_MOVING_WINDOW
    )
    self.lua_acquire_moving_window = self.get_connection().register_script(
        self.SCRIPT_ACQUIRE_MOVING_WINDOW
    )
    self.lua_clear_keys = self.get_connection().register_script(
        self.SCRIPT_CLEAR_KEYS
    )
    self.lua_incr_expire = self.get_connection().register_script(
        self.SCRIPT_INCR_EXPIRE
    )
    self.lua_sliding_window = self.get_connection().register_script(
        self.SCRIPT_SLIDING_WINDOW
    )
    self.lua_acquire_sliding_window = self.get_connection().register_script(
        self.SCRIPT_ACQUIRE_SLIDING_WINDOW
    )
```

[limits/aio/storage/redis/coredis.py](https://github.com/alisaifee/limits/blob/0492c4fbef45c0f66c88c5feb00cb1270af238fa/limits/aio/storage/redis/coredis.py#L95-L113) · [More projects using coredis →](https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20coredis%20for%20cache%20pipelines%2C%20Sentinel-managed%20connections%2C%20Lua-backed%20rate%20limiting%20or%20incremental%20response%20parsing&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
import anyio
import coredis

async def main():
    async with coredis.Redis(host='127.0.0.1', port=6379, db=0) as client:
        await client.set('foo', 1)

anyio.run(main)

```

From [README.md](https://raw.githubusercontent.com/alisaifee/coredis/6.9.0/README.md)

### RedisVL

[GitHub](https://github.com/redis/redis-vl-python) · [PyPI](https://pypi.org/project/redisvl) · [Docs](https://docs.redisvl.com)

Uses Redis as a vector database through a Python client and CLI.

- Downloads / mo: 2.2M
- Stars: 437
- Last release: 0.32.1
- License: MIT
- Capabilities: [From the RedisVL docs](https://docs.redisvl.com)

```sh
pip install redisvl
```

**Quickstart**

```python
from redisvl.index import SearchIndex
index = SearchIndex.from_dict({'index': {'name': 'my-index', 'prefix': 'rvl', 'storage_type': 'hash'}, 'fields': [{'name': 'doc-id', 'type': 'tag'}]}, redis_url='redis://localhost:6379')
index.create()

```

From [searchindex.html](https://docs.redisvl.com/en/stable/api/searchindex.html) · [Find projects using RedisVL →](https://dashboard.exa.ai/playground/search?q=redisvl%20GitHub%20projects)

### Pottery

[GitHub](https://github.com/brainix/pottery) · [PyPI](https://pypi.org/project/pottery) · [Docs](https://pypi.org/project/pottery/)

Provides a Python interface to Redis.

- Downloads / mo: 764.0K
- Stars: 1.2K
- Last release: 3.0.1
- License: Apache-2.0
- Capabilities: [From the Pottery docs](https://pypi.org/project/pottery/)

```sh
pip install pottery
```

**Quickstart**

```python
from redis import Redis
from pottery import RedisDict
client = Redis.from_url('redis://localhost:6379/1')
tel = RedisDict({'jack': 4098, 'sape': 4139}, redis=client, key='tel')

```

From [README.md](https://github.com/brainix/pottery) · [Find projects using Pottery →](https://dashboard.exa.ai/playground/search?q=pottery%20GitHub%20projects)

### Walrus

[GitHub](https://github.com/coleifer/walrus) · [PyPI](https://pypi.org/project/walrus) · [Docs](https://walrus.readthedocs.io/)

Extends redis-py with Python-style containers and higher-level Redis utilities.

- Downloads / mo: 155.7K
- Stars: 1.2K
- Last release: 0.9.8
- License: MIT
- Capabilities: [From the Walrus docs](https://walrus.readthedocs.io/)

**Strengths**

- **Adds Python-style Redis containers.** Work with hashes, lists, sets, and other container wrappers.
- **Reuses existing Redis client methods.** Use Redis methods alongside the higher-level helper API.

**Watch out for**

- **Nested atomic blocks commit separately.** An inner atomic block commits independently of its outer block.

```sh
pip install walrus
```

**Quickstart**

```python
from walrus import Database
db = Database(decode_responses=True)
h = db.Hash('charlie')
h.update(name='Charlie', favorite_cat='Huey')

```

From [full-text-search.html](https://walrus.readthedocs.io/en/latest/containers.html) · [Find projects using Walrus →](https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20walrus%20for%20cache%20pipelines%2C%20Sentinel-managed%20connections%2C%20Lua-backed%20rate%20limiting%20or%20incremental%20response%20parsing&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

### Redis OM Python

[GitHub](https://github.com/redis/redis-om-python) · [PyPI](https://pypi.org/project/redis-om) · [Docs](https://pypi.org/project/redis-om/)

Maps Python objects to Redis.

- Downloads / mo: 148.6K
- Stars: 1.3K
- Last release: 1.2.0
- License: BSD-3-Clause
- Capabilities: [From the Redis OM Python docs](https://pypi.org/project/redis-om/)

```sh
pip install redis-om
```

**Quickstart**

```python
from redis_om import HashModel

class Customer(HashModel):
    first_name: str

customer = Customer(first_name='Andrew')
customer.save()

```

From [README.md](https://redis.github.io/redis-om-python/getting_started/) · [Find projects using Redis OM Python →](https://dashboard.exa.ai/playground/search?q=redis-om%20GitHub%20projects)

## FAQ

### Which Python Redis library should I use?

[redis-py](#redis-py) suits most applications, with synchronous and asynchronous clients and atomic transactions. [coredis](#coredis) suits async code that wants a typed client with cluster and Sentinel support. [Fakeredis](#fakeredis) suits tests that need the Redis API without a server.

### What is redis-py?

[redis-py](#redis-py) is the Python client for the Redis database and key-value store. It provides synchronous and asynchronous clients and groups commands into atomic transactions.

### What is hiredis?

[hiredis](#hiredis) is a Python wrapper for the hiredis parser. It reads Redis protocol replies from byte streams and does no network I/O of its own.

### What is RedisVL?

[RedisVL](#redisvl) is a Python client library and CLI for using Redis as a vector database.

### Can redis-py Pipeline or PubSub objects be shared between threads?

No. A redis-py Pipeline or PubSub object should stay in the thread that created it.

## How this page was built

Data checked Nov 20, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "Best Python Redis libraries redis-py coredis Walrus hiredis examples",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
