Fast, async, fully-typed Redis client with support for cluster and sentinel
Project Links
Meta
Author: Ali-Akber Saifee
Maintainer: Ali-Akber Saifee
Requires Python: >=3.10
Classifiers
Development Status
- 5 - Production/Stable
Framework
- AnyIO
- AsyncIO
- Trio
Intended Audience
- Developers
- Information Technology
- System Administrators
Operating System
- OS Independent
Programming Language
- Python
- Python :: 3
- Python :: 3 :: Only
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
- Python :: Implementation :: PyPy
Topic
- Software Development :: Libraries :: Python Modules
- System :: Distributed Computing
Typing
- Typed
[!IMPORTANT] To learn about breaking changes and migration steps for version 6 please see Migrating from 5.x to 6.0.
If you are looking for the 5.x implementation, please refer to the 5.x branch.
coredis
Fast, async, fully-typed Redis client with support for cluster and sentinel
Features
- Fully typed, even when using pipelines, Lua scripts, and libraries
- Redis Cluster and Sentinel support
- Built with structured concurrency on
anyio, supports bothasyncioandtrio - Smart command routing: multiplexing when possible, pooling otherwise
- Server-assisted client-side caching implementation
- Redis Stack modules support
- Redis PubSub
- Pipelining
- Lua scripts and Redis functions with support for typing
- Convenient Stream Consumers implementation
- Comprehensive documentation
- Optional runtime type validation (via beartype)
Installation
$ pip install coredis
Getting started
Single node or cluster
import anyio
import coredis
async def main() -> None:
client = coredis.Redis(host='127.0.0.1', port=6379, db=0, decode_responses=True)
# or cluster
# client = coredis.RedisCluster(startup_nodes=[coredis.connection.TCPLocation("127.0.0.1", 6379)], decode_responses=True)
async with client:
await client.flushdb()
await client.set("foo", 1)
assert await client.exists(["foo"]) == 1
assert await client.incr("foo") == 2
assert await client.expire("foo", 1)
await anyio.sleep(0.1)
assert await client.ttl("foo") == 1
await anyio.sleep(1)
assert not await client.exists(["foo"])
async with client.pipeline() as pipeline:
pipeline.incr("foo")
value = pipeline.get("foo")
pipeline.delete(["foo"])
assert await value == "1"
anyio.run(main, backend="asyncio") # or trio
Sentinel
import anyio
import coredis
async def main() -> None:
sentinel = coredis.Sentinel(sentinels=[("localhost", 26379)])
async with sentinel:
primary: coredis.Redis = sentinel.primary_for("myservice")
replica: coredis.Redis = sentinel.replica_for("myservice")
async with primary, replica:
assert await primary.set("fubar", 1)
assert int(await replica.get("fubar")) == 1
anyio.run(main, backend="asyncio") # or trio
Compatibility
To see a full list of supported Redis commands refer to the Command compatibility documentation. Details about supported Redis modules and their commands can be found here.
coredis is tested against redis versions >= 7.0
The test matrix status can be reviewed
here
coredis is additionally tested against:
uvloop >= 0.15.0trio
Supported python versions
- 3.10
- 3.11
- 3.12
- 3.13
- 3.14
- PyPy 3.10
- PyPy 3.11
Redis API compatible databases
coredis is known to work with the following databases that have redis protocol compatibility:
References
6.4.0
Apr 01, 2026
6.3.0
Mar 23, 2026
6.2.0
Mar 07, 2026
6.1.0
Feb 13, 2026
6.0.0
Feb 09, 2026
6.0.0rc3
Feb 07, 2026
6.0.0rc2
Jan 30, 2026
6.0.0rc1
Jan 18, 2026
5.7.0
Feb 06, 2026
5.6.0
Jan 20, 2026
5.5.0
Jan 13, 2026
5.4.0
Dec 18, 2025
5.3.0
Oct 10, 2025
5.2.0
Oct 02, 2025
5.1.0
Sep 10, 2025
5.0.1
Jul 18, 2025
5.0.0
Jul 17, 2025
5.0.0rc2
Jul 11, 2025
5.0.0rc1
Jul 07, 2025
4.24.0
Jul 06, 2025
4.23.1
Jun 21, 2025
4.23.0
Jun 19, 2025
4.22.0
May 07, 2025
4.21.0
May 03, 2025
4.20.0
Mar 06, 2025
4.19.0
Mar 03, 2025
4.18.0
Dec 11, 2024
4.18.0rc4
Dec 09, 2024
4.18.0rc3
Dec 09, 2024
4.17.0
Apr 19, 2024
4.16.0
Aug 31, 2023
4.16.0rc1
Aug 12, 2023
4.15.1
Aug 10, 2023
4.15.0
Aug 10, 2023
4.14.0
May 23, 2023
4.13.3
May 11, 2023
4.13.2
May 09, 2023
4.13.1
May 04, 2023
4.13.0
May 04, 2023
4.12.4
Apr 29, 2023
4.12.3
Apr 28, 2023
4.12.2
Apr 23, 2023
4.12.1
Apr 23, 2023
4.12.0
Apr 22, 2023
4.12.0rc1
Apr 20, 2023
4.12.0b4
Apr 11, 2023
4.12.0b3
Apr 05, 2023
4.12.0b2
Mar 27, 2023
4.12.0b1
Mar 27, 2023
4.11.6
Apr 23, 2023
4.11.5
Apr 04, 2023
4.11.3
Mar 12, 2023
4.11.2
Mar 10, 2023
4.11.1
Mar 10, 2023
4.11.0
Mar 09, 2023
4.10.3
Mar 08, 2023
4.10.2
Dec 25, 2022
4.10.1
Dec 12, 2022
4.10.0
Nov 22, 2022
4.9.0
Nov 10, 2022
4.8.3
Nov 05, 2022
4.8.2
Nov 01, 2022
4.8.1
Oct 30, 2022
4.8.0
Oct 28, 2022
4.7.1
Nov 01, 2022
4.7.0
Oct 26, 2022
4.6.0
Oct 11, 2022
4.5.6
Aug 31, 2022
4.5.5
Aug 22, 2022
4.5.4
Aug 09, 2022
4.5.3
Aug 04, 2022
4.5.2
Aug 03, 2022
4.5.1
Aug 03, 2022
4.5.0
Jul 31, 2022
4.4.0
Jul 27, 2022
4.3.1
Jul 23, 2022
4.3.0
Jul 23, 2022
4.2.1
Jul 21, 2022
4.2.0
Jul 20, 2022
4.1.1
Jul 19, 2022
4.1.0
Jul 19, 2022
4.0.2
Jul 17, 2022
4.0.1
Jul 16, 2022
4.0.0
Jul 15, 2022
4.0.0b2
Jul 15, 2022
4.0.0b1
Jul 15, 2022
3.757
May 20, 2022
3.11.5
Jul 13, 2022
3.11.4
Jul 10, 2022
3.11.3
Jul 08, 2022
3.11.2
Jun 30, 2022
3.11.1
Jun 30, 2022
3.11.0
Jun 25, 2022
3.10.1
Jun 19, 2022
3.10.0
Jun 18, 2022
3.9.3
Jun 15, 2022
3.9.2
Jun 14, 2022
3.9.1
Jun 13, 2022
3.9
Jun 13, 2022
3.8.12
Jun 10, 2022
3.8.11
Jun 08, 2022
3.8.10
Jun 07, 2022
3.8.9
Jun 07, 2022
3.8.7
Jun 04, 2022
3.8.6
May 27, 2022
3.8.5
May 25, 2022
3.8.0
May 21, 2022
3.7.57
May 25, 2022
3.6.0
May 16, 2022
3.5.1
May 13, 2022
3.5.0
May 11, 2022
3.4.7
May 05, 2022
3.4.6
May 01, 2022
3.4.5
Apr 22, 2022
3.4.3
Apr 22, 2022
3.4.2
Apr 22, 2022
3.4.1
Apr 13, 2022
3.4.0
Apr 12, 2022
3.3.0
Apr 05, 2022
3.2.0
Apr 03, 2022
3.1.1
Mar 25, 2022
3.1.0
Mar 24, 2022
3.0.3
Mar 21, 2022
3.0.2
Mar 21, 2022
3.0.1
Mar 21, 2022
3.0.0
Mar 21, 2022
3.0.0rc2
Mar 17, 2022
3.0.0rc1
Mar 17, 2022
2.3.2
Jan 09, 2023
2.3.1
Jan 31, 2022
2.3.0
Jan 24, 2022
2.2.3
Jan 22, 2022
2.2.2
Jan 22, 2022
2.2.1
Jan 22, 2022
2.1.0
Jan 15, 2022
2.0.1
Jan 15, 2022
2.0.0
Jan 05, 2022
2.0.0b1
Jan 05, 2022
Wheel compatibility matrix
Files in release
coredis-6.4.0-cp310-cp310-macosx_10_9_x86_64.whl (368.4KiB)
coredis-6.4.0-cp310-cp310-macosx_11_0_arm64.whl (363.7KiB)
coredis-6.4.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (380.4KiB)
coredis-6.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (382.5KiB)
coredis-6.4.0-cp311-cp311-macosx_10_9_x86_64.whl (367.6KiB)
coredis-6.4.0-cp311-cp311-macosx_11_0_arm64.whl (362.8KiB)
coredis-6.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (379.3KiB)
coredis-6.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (381.4KiB)
coredis-6.4.0-cp312-cp312-macosx_10_13_x86_64.whl (370.2KiB)
coredis-6.4.0-cp312-cp312-macosx_11_0_arm64.whl (365.4KiB)
coredis-6.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (380.0KiB)
coredis-6.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (383.3KiB)
coredis-6.4.0-cp313-cp313-macosx_10_13_x86_64.whl (370.2KiB)
coredis-6.4.0-cp313-cp313-macosx_11_0_arm64.whl (365.4KiB)
coredis-6.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (379.7KiB)
coredis-6.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (382.8KiB)
coredis-6.4.0-cp314-cp314-macosx_10_13_x86_64.whl (369.8KiB)
coredis-6.4.0-cp314-cp314-macosx_11_0_arm64.whl (365.3KiB)
coredis-6.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (381.2KiB)
coredis-6.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (382.7KiB)
coredis-6.4.0-cp314-cp314t-macosx_10_13_x86_64.whl (379.7KiB)
coredis-6.4.0-cp314-cp314t-macosx_11_0_arm64.whl (376.2KiB)
coredis-6.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (394.6KiB)
coredis-6.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (395.0KiB)
coredis-6.4.0-py3-none-any.whl (242.5KiB)
coredis-6.4.0.tar.gz (200.5KiB)