Skip to main content

Python async client for Redis key-value store

Reason this release was yanked:

This was meant to be 3.7.57

Project description

coredis

docs codecov Latest Version in PyPI ci Supported Python versions

coredis is an async redis client with support for redis server, cluster & sentinel.

Installation

To install coredis:

$ pip install coredis

Feature Summary

Deployment architecture

Application patterns

Server side scripting

Miscellaneous

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:

  • hiredis >= 2.0.0
  • uvloop >= 0.15.0

hiredis if available will be used by default as the RESP (or RESP3) parser as it provides significant performance gains in response parsing. For more details refer to the the documentation section on Parsers

Supported python versions

  • 3.8
  • 3.9
  • 3.10

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

coredis-3.757.tar.gz (175.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

coredis-3.757-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (224.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

coredis-3.757-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (224.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

coredis-3.757-cp310-cp310-macosx_10_9_x86_64.whl (217.6 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

coredis-3.757-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (224.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

coredis-3.757-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (224.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

coredis-3.757-cp39-cp39-macosx_10_9_x86_64.whl (217.6 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

coredis-3.757-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

coredis-3.757-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (225.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

coredis-3.757-cp38-cp38-macosx_10_9_x86_64.whl (217.6 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

File details

Details for the file coredis-3.757.tar.gz.

File metadata

  • Download URL: coredis-3.757.tar.gz
  • Upload date:
  • Size: 175.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for coredis-3.757.tar.gz
Algorithm Hash digest
SHA256 51b43184aadf0e80afef2c8ae8cca51652acd7b6e73a5e807f3e8b0d4951cfe2
MD5 31a651895f72e6964c1272754f0ce832
BLAKE2b-256 d4aaec9b91f9d66e38824bb8e9a175b6a06745703c0e42a7b6ab1c5c4c0f1d1b

See more details on using hashes here.

File details

Details for the file coredis-3.757-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for coredis-3.757-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6a9691952ef4073ed67365c799498a27da79673e5c486766345fdf06bfb8f8e0
MD5 7f35bb7823afa8d66b3ec3cc00359af0
BLAKE2b-256 51942e1b41e14227c8c8d3df7e7c4bf3b28d29e152a313876a5f5e7ba42f93a4

See more details on using hashes here.

File details

Details for the file coredis-3.757-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for coredis-3.757-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 2c2a91fe58537af849fbe6601650e2a204212011b67975d8d1ef7ece8aab05d6
MD5 3fb989ff6fdbd12afc24ae92c2b2854c
BLAKE2b-256 95801a228354e920669bdc0dbe16f6b43eec6a3f3d59b893cf6c39484f7a9ddf

See more details on using hashes here.

File details

Details for the file coredis-3.757-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for coredis-3.757-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 308cb9c223df04e299f161cb55da37105644c965220c3242f37a1797dc64bb9b
MD5 d42057e778d22b1415c26ecc642f2ce6
BLAKE2b-256 4321e9ae86e3297649102e321c7c04ec042106159586ea99a439bea0e4de06a9

See more details on using hashes here.

File details

Details for the file coredis-3.757-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for coredis-3.757-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5744a236c44225ede1e22b1ba689909c1927cb4e100b27278a05ac91a4e3864b
MD5 4fc1a8055766818562185f8ba203b7d0
BLAKE2b-256 81013075f4b32dd25d218b3177d2555ee9c483a3d855e968746bf1f93012242e

See more details on using hashes here.

File details

Details for the file coredis-3.757-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for coredis-3.757-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 830faa645a8208f4d508186e0041b4e28870b001787d8e11847b042194c3567d
MD5 31e2de2b13a2a88994335ed54a23ff28
BLAKE2b-256 69a65dfd800ea4c5fc6e75143541a3ddca13b46b0f88e81d16c2e724eb27df8e

See more details on using hashes here.

File details

Details for the file coredis-3.757-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for coredis-3.757-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ac604b7c9b46128cf1fb852b803e330da7aa8e78a7537c48c6d0e84f1343ff84
MD5 ba72ad51ea507867aedd4f0d4431b566
BLAKE2b-256 34ae8c22f2259492a69498d331919dc9bff3b8b40ab3c451cffd51adb13c0e44

See more details on using hashes here.

File details

Details for the file coredis-3.757-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for coredis-3.757-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 49e04922bf1096b7c13c074c8e21b66a48b5146e1e4a7b37f026175e52e720fb
MD5 14847f11d32b88625650e544154e1b3a
BLAKE2b-256 55b6cca3e6d5ba2bad4e68880b834d6b3e3009af3a220d466395438d39b320f9

See more details on using hashes here.

File details

Details for the file coredis-3.757-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for coredis-3.757-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 617627857f8c22ae8c927010aedbc4b512f147311ada1fc472d307c776c187de
MD5 9cea447439940e8a77311fd98df34c9e
BLAKE2b-256 730dd20bec0da9777dffd0f49a7c75806294bcbe03b970a5dab491e1df811251

See more details on using hashes here.

File details

Details for the file coredis-3.757-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for coredis-3.757-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 13ed6c001ce3599f38f46da63c0ac8de242e977162e72473e729342aa70ffc42
MD5 1c7da6a737e52772d74e2fcede86f20a
BLAKE2b-256 e262852c5f33a628a56673cc406f24655ecacc4ff0b3a98023a6dd45469675be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page