Python async client for Redis key-value store
Project description
coredis
coredis is an async redis client with support for redis server, cluster & sentinel.
Installation
To install coredis:
$ pip install coredis
Feature Summary
Deployment topologies
Application patterns
- Connection Pooling
- PubSub
- Sharded PubSub [
>= Redis 7.0] - Stream Consumers
- Pipelining
- Client side caching
Server side scripting
- LUA Scripting
- Redis Libraries and functions [
>= Redis 7.0]
Miscellaneous
- Public API annotated with type annotations
- Optional Runtime Type Validation (via beartype)
Quick start
Single Node client
import asyncio
from coredis import Redis
async def example():
client = Redis(host='127.0.0.1', port=6379, db=0)
await client.flushdb()
await client.set('foo', 1)
assert await client.exists(['foo']) == 1
await client.incr('foo')
await client.incrby('foo', increment=100)
assert int(await client.get('foo')) == 102
await client.expire('foo', 1)
await asyncio.sleep(0.1)
await client.ttl('foo')
await asyncio.sleep(1)
assert not await client.exists(['foo'])
asyncio.run(example())
Cluster client
import asyncio
from coredis import RedisCluster
async def example():
client = RedisCluster(host='172.17.0.2', port=7001)
await client.flushdb()
await client.set('foo', 1)
await client.lpush('a', [1])
print(await client.cluster_slots())
await client.rpoplpush('a', 'b')
assert await client.rpop('b') == b'1'
asyncio.run(example())
# {(10923, 16383): [{'host': b'172.17.0.2', 'node_id': b'332f41962b33fa44bbc5e88f205e71276a9d64f4', 'server_type': 'master', 'port': 7002},
# {'host': b'172.17.0.2', 'node_id': b'c02deb8726cdd412d956f0b9464a88812ef34f03', 'server_type': 'slave', 'port': 7005}],
# (5461, 10922): [{'host': b'172.17.0.2', 'node_id': b'3d1b020fc46bf7cb2ffc36e10e7d7befca7c5533', 'server_type': 'master', 'port': 7001},
# {'host': b'172.17.0.2', 'node_id': b'aac4799b65ff35d8dd2ad152a5515d15c0dc8ab7', 'server_type': 'slave', 'port': 7004}],
# (0, 5460): [{'host': b'172.17.0.2', 'node_id': b'0932215036dc0d908cf662fdfca4d3614f221b01', 'server_type': 'master', 'port': 7000},
# {'host': b'172.17.0.2', 'node_id': b'f6603ab4cb77e672de23a6361ec165f3a1a2bb42', 'server_type': 'slave', 'port': 7003}]}
To see a full list of supported redis commands refer to the Command compatibility documentation
Compatibility
coredis is tested against redis versions 6.0.x, 6.2.x & 7.0.x. The
test matrix status can be reviewed
here
coredis is additionally tested against:
uvloop >= 0.15.0
Supported python versions
- 3.7
- 3.8
- 3.9
- 3.10
- PyPy 3.8
Redis-like backends
coredis is known to work with the following databases that have redis protocol compatibility:
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coredis-4.5.4.tar.gz.
File metadata
- Download URL: coredis-4.5.4.tar.gz
- Upload date:
- Size: 188.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb2f34c43bcaf8823f6779cbbfd9adc2d9a064644e963458b0fb728ef558a464
|
|
| MD5 |
55e7b6d6d296910143d4eef13cedc572
|
|
| BLAKE2b-256 |
4701b1cf599f2516a8a991c94ccc3dc29d1c4e82ff988acd7798d87fc538fff8
|
File details
Details for the file coredis-4.5.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: coredis-4.5.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 341.6 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7287fa1f66bf253f482e3a50ce4deaeeeaf7f81e7b381306dca74e07a4d3bea
|
|
| MD5 |
c3ca195329dbf62602180687f079d2b5
|
|
| BLAKE2b-256 |
ad792c023c8e92a461f98a55b547255f68758a7dbc1e730d7aa7dd9388750a76
|
File details
Details for the file coredis-4.5.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: coredis-4.5.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 345.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56bf58f55c551667805aea4f5ea937ca25707c0ce24a3d99ab90918535bb02b0
|
|
| MD5 |
9fa28866658ca775fb7e636a97e89b3b
|
|
| BLAKE2b-256 |
bb7293348497736e0d422ac739f4246c533a35daf2e6954220871b571c2eefcb
|
File details
Details for the file coredis-4.5.4-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: coredis-4.5.4-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 314.9 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab80a7f80c8bd4ee821fde944547460e5bf4d93f913edd055032ca3ef74fd693
|
|
| MD5 |
9904b679daf0f94ad67dd93446c8d89d
|
|
| BLAKE2b-256 |
6dae1963cc9578144f332a07d544e5aa2f05084c570237a102c5ab8e2d0bb0a4
|
File details
Details for the file coredis-4.5.4-cp310-cp310-macosx_10_9_x86_64.whl.
File metadata
- Download URL: coredis-4.5.4-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 319.8 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53ee36da5bae2a4d4769ce6b26f71b8e1edc4b4d3b47d8b7cb3a4fd09679ae25
|
|
| MD5 |
8a04cc365c8dcc80fca9d77f636d6882
|
|
| BLAKE2b-256 |
3703e15be1ff4ee5c177f5eb2e7dfb49f1baeefc8b23db1f5fea63eab39ac729
|
File details
Details for the file coredis-4.5.4-cp310-cp310-macosx_10_9_universal2.whl.
File metadata
- Download URL: coredis-4.5.4-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 397.2 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cae33bd25ec9e1e6cbe449340fd376e05b594efebbecbc43a65983f0b91efae
|
|
| MD5 |
b9c4be4c4656bfe26582000fd54741d7
|
|
| BLAKE2b-256 |
5e75bdfa11e3706ee046dda2b0b25e4d2f392c067ee01893ebd0a8e07d642aa2
|
File details
Details for the file coredis-4.5.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: coredis-4.5.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 341.5 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bf99cd203e442fef967691637d26e0811dbf4a972cefb94cc4f0752686a4f47
|
|
| MD5 |
8455a2792f34c7af43b670eb06e1ece5
|
|
| BLAKE2b-256 |
3d3a4513aeba3d743deb312db9e309d5f267f6488529c34031bf092debcd519d
|
File details
Details for the file coredis-4.5.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: coredis-4.5.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 345.1 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f34dc78ddc905515f727104b71317d243aa97d170914a6f8247f027e26783768
|
|
| MD5 |
5abf3dabbb040b35a0c480f4202b50de
|
|
| BLAKE2b-256 |
96dcf7e858c090e6d69f854dca5f4c6c1ea6dc5e0961844d733eead327ce81e7
|
File details
Details for the file coredis-4.5.4-cp39-cp39-macosx_11_0_arm64.whl.
File metadata
- Download URL: coredis-4.5.4-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 314.9 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3901933b14bcb529efbc9fb2ae93ceaafdc6c39b647c92efa0055d4ddfb2a3f5
|
|
| MD5 |
8b704f9f09ad7dc6875dca4db4e1c765
|
|
| BLAKE2b-256 |
ec13084d02a0f96c94ae75227cf311c98b59e64f134e9fefc541c2793c56c636
|
File details
Details for the file coredis-4.5.4-cp39-cp39-macosx_10_9_x86_64.whl.
File metadata
- Download URL: coredis-4.5.4-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 319.7 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d371fa5aca79938f81308376d52bff9acae14bb2bca1e84f3cefd3b71298cbb
|
|
| MD5 |
ec583045ba677839a8a1711674aa7f72
|
|
| BLAKE2b-256 |
ad5fee1d0990b72d96aeedd5becb83fe60ddec6be90bceb0520a7efbec879462
|
File details
Details for the file coredis-4.5.4-cp39-cp39-macosx_10_9_universal2.whl.
File metadata
- Download URL: coredis-4.5.4-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 397.0 kB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fe172a33239ebc89d284dda58f3e35aeb4b16b4a88a8b43b6fbf1320fedab14
|
|
| MD5 |
f06449b8b0407949e32720364f48d5eb
|
|
| BLAKE2b-256 |
f9ebaf087f8f915853d00d236f9c3bd331f9b261056edccaad1f947cd2a76fb1
|
File details
Details for the file coredis-4.5.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: coredis-4.5.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 340.7 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
614f42ebb9bb1993091169e80309c0e8ee2010eba828577d604c46d1d817b008
|
|
| MD5 |
f8d4cdd59175c49eb5f639a511858089
|
|
| BLAKE2b-256 |
dfb174aded80ea22419d2cfca8e91e15536c6ddd7940a91d7c6c5ca7f9f15665
|
File details
Details for the file coredis-4.5.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: coredis-4.5.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 344.6 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfe6cb3bfc726061aeba59970e83b417a94692ca30aab86b2025c09c504e3b85
|
|
| MD5 |
87dcd4dac5794934aced97daaca23dd9
|
|
| BLAKE2b-256 |
088eeaa45bc24c2434ade70cdd6de53ba755f5c48448db0814d3da96a1d16a10
|
File details
Details for the file coredis-4.5.4-cp38-cp38-macosx_11_0_arm64.whl.
File metadata
- Download URL: coredis-4.5.4-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 313.6 kB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddc7be2cdbb40960ff333113d7f3a19355ccfc2cca146f824d597027cd70b025
|
|
| MD5 |
5fb4848bc04670a1f401519d0840e41d
|
|
| BLAKE2b-256 |
6484576044971e95155ecfd6e8387df0f8796bf82b48f9dd59077cae9af9f5ac
|
File details
Details for the file coredis-4.5.4-cp38-cp38-macosx_10_9_x86_64.whl.
File metadata
- Download URL: coredis-4.5.4-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 317.9 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79eb767a8e6bf0beb914ccc09e5b19b947ea77d2fe10c47d2a1639bdf087aa84
|
|
| MD5 |
7b32b26b5ff4d209c6791d1020da2ae9
|
|
| BLAKE2b-256 |
3ad3b7828db4c7f7c30c17ef049c25b5162f0a0d29011beaa44e1a850cf2be1a
|
File details
Details for the file coredis-4.5.4-cp38-cp38-macosx_10_9_universal2.whl.
File metadata
- Download URL: coredis-4.5.4-cp38-cp38-macosx_10_9_universal2.whl
- Upload date:
- Size: 394.0 kB
- Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c552154a29a9e1e0ce8417a2d11ea2b8142432354472d9817db8647430d20ac7
|
|
| MD5 |
9c1b5b81700e68f6df23bf4103097100
|
|
| BLAKE2b-256 |
bda2d981c26349856de25554522a3e8b2651ccd7a60ad1c1b07bf125d89744bc
|
File details
Details for the file coredis-4.5.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: coredis-4.5.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 333.9 kB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98669afb3a7e99641fe3de63994d2f2cbe77b55f6e57fe7a87e1d75ec952fbca
|
|
| MD5 |
a5e8cd28d3b6e9e4919316758864ee26
|
|
| BLAKE2b-256 |
b0982d0df55566f987d4fdf9ae5c77bf79deb23e8236f992e624c6abdd03a6e2
|
File details
Details for the file coredis-4.5.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: coredis-4.5.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 337.1 kB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05506a018c8472250f89f5a62be647f304f5514b32251170dc0337b7f51912c4
|
|
| MD5 |
0eef5a6a7a6674659c15b0bccaba0c3b
|
|
| BLAKE2b-256 |
f103de13a318ba7c318598580d83eb2c3aba799e443136c67a6c2b553cec74df
|
File details
Details for the file coredis-4.5.4-cp37-cp37m-macosx_10_9_x86_64.whl.
File metadata
- Download URL: coredis-4.5.4-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 313.7 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc4ad54a1bdb57527f224700802a08e9ea7f30c645dafd69b27880c0d9d5e2ac
|
|
| MD5 |
02ef664f06629739c5f26dc7205c7506
|
|
| BLAKE2b-256 |
d8b1fcda04125230eae3addae2e489cc55d80a842c6681463bee85272d20c6ce
|