Skip to main content

talkiq/yaaredis

CircleCI Test Status Latest PyPI Release Compatible Python Versions

yaaredis (Yet Another Async Redis (client)) is a fork of aredis, which itself was ported from redis-py. yaaredis provides an efficient and user-friendly async redis client with support for Redis Server, Cluster, and Sentinels.

To get more information please read the full documentation managed by the upstream aredis repo. We are working on hosting our own as the projects diverge – stay tuned!

Installation

yaaredis requires a running Redis server. To install yaaredis, simply:

python3 -m pip install yaaredis

or from source:

python3 -m pip install .

Note that yaaredis also supports using hiredis as a drop-in performance improvements. You can either install hiredis separately or make use of the PyPI extra to make use of this functionality:

python3 -m pip install yaaredis[hiredis]

Getting started

We have various examples in this repo which you may find useful. A few more specific cases are listed below.

Single Node Client

import asyncio
from yaaredis import StrictRedis

async def example():
    client = StrictRedis(host='127.0.0.1', port=6379, db=0)
    await client.flushdb()
    await client.set('foo', 1)
    assert await client.exists('foo') is True
    await client.incr('foo', 100)

    assert int(await client.get('foo')) == 101
    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 yaaredis import StrictRedisCluster

async def example():
    client = StrictRedisCluster(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}]}

Benchmark

Please run test scripts in the benchmarks directory to confirm the benchmarks. For a benchmark in the original yaaredis author’s environment please see: benchmark.

Contributing

Developer? See our guide on how you can contribute.

Metadata

Release files for yaaredis 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yaaredis 3.0.0
File Size Uploaded
yaaredis-3.0.0.tar.gz 80.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for yaaredis 3.0.0
File
yaaredis-3.0.0-cp310-cp310-manylinux_2_31_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.31+ x86-64 Details
yaaredis-3.0.0-cp310-cp310-macosx_12_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 12.0+ x86-64 Details
yaaredis-3.0.0-cp39-cp39-manylinux_2_31_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.31+ x86-64 Details
yaaredis-3.0.0-cp39-cp39-macosx_12_0_x86_64.whl CPython 3.9 CPython 3.9 macOS 12.0+ x86-64 Details
yaaredis-3.0.0-cp38-cp38-manylinux_2_31_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.31+ x86-64 Details
yaaredis-3.0.0-cp38-cp38-macosx_12_0_x86_64.whl CPython 3.8 CPython 3.8 macOS 12.0+ x86-64 Details
yaaredis-3.0.0-cp37-cp37m-manylinux_2_31_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.31+ x86-64 Details
yaaredis-3.0.0-cp37-cp37m-macosx_12_0_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 12.0+ x86-64 Details
yaaredis-3.0.0-cp36-cp36m-manylinux_2_31_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.31+ x86-64 Details

Total release size: 978.4 kB

Release files / yaaredis-3.0.0.tar.gz

Download URL yaaredis-3.0.0.tar.gz
Size 80.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d459912a84c035e6173cfb595b7fe52bbaecba3198c8b19f051112c42ec4b4b9
BLAKE2b-256 checksum
How to use checksums
9d8e980cb1fd05c2c141e370f39fef4fcc7a5890df026a838d0a4aa85524cd45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.11.0-1022-aws

Release files / yaaredis-3.0.0-cp310-cp310-manylinux_2_31_x86_64.whl

Download URL yaaredis-3.0.0-cp310-cp310-manylinux_2_31_x86_64.whl
Size 102.3 kB
Tags CPython 3.10 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
bc1d640693749c57fcd97a826c5e45dc14a88a15d24503c0c445f5bf34867d54
BLAKE2b-256 checksum
How to use checksums
7ef74af87df2659feb8622be67ccd544e5734bf60a65738db73e66c737daab32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.11.0-1022-aws

Release files / yaaredis-3.0.0-cp310-cp310-macosx_12_0_x86_64.whl

Download URL yaaredis-3.0.0-cp310-cp310-macosx_12_0_x86_64.whl
Size 96.4 kB
Tags CPython 3.10 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
7a972b5ed6255903458895712ac7df16df6bcdd1398333d568743f8de1c18126
BLAKE2b-256 checksum
How to use checksums
648a449a2c030fbb2462e75e288ce3f7ca57310264cd03a5ede6bb13ebbe8563
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.7.12 Darwin/21.2.0

Release files / yaaredis-3.0.0-cp39-cp39-manylinux_2_31_x86_64.whl

Download URL yaaredis-3.0.0-cp39-cp39-manylinux_2_31_x86_64.whl
Size 102.1 kB
Tags CPython 3.9 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
b487511ab5875942fd61506a31d616eb2fb9931e2bb5dd6ef98984d660abe151
BLAKE2b-256 checksum
How to use checksums
4d1aae5db80cd75eaf745267521f1f0dd1d3a9e9009a7a99c2170109306cdb1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.11.0-1022-aws

Release files / yaaredis-3.0.0-cp39-cp39-macosx_12_0_x86_64.whl

Download URL yaaredis-3.0.0-cp39-cp39-macosx_12_0_x86_64.whl
Size 96.4 kB
Tags CPython 3.9 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
bb656e1b8c16264297bb4a84c999bcdc750c98806e6af8225d1dde2314a53230
BLAKE2b-256 checksum
How to use checksums
c858ea700c50d19369957ae6c3282532d316c026e2662c3b6c68476e29c3c690
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.7.12 Darwin/21.2.0

Release files / yaaredis-3.0.0-cp38-cp38-manylinux_2_31_x86_64.whl

Download URL yaaredis-3.0.0-cp38-cp38-manylinux_2_31_x86_64.whl
Size 102.7 kB
Tags CPython 3.8 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
224f716cbf09bf16abe0d8c116bac3416ad6a9753726d426430ccc67d6757528
BLAKE2b-256 checksum
How to use checksums
105ce73afc99e9069ab9f6410495bfbca9a6f534852659323e7b6667781f2de8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.11.0-1022-aws

Release files / yaaredis-3.0.0-cp38-cp38-macosx_12_0_x86_64.whl

Download URL yaaredis-3.0.0-cp38-cp38-macosx_12_0_x86_64.whl
Size 96.4 kB
Tags CPython 3.8 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
935263de853f3d18f8a3b6dc3f4b8ca8c78107c2e4bd25712a2143e4831a2cc3
BLAKE2b-256 checksum
How to use checksums
384ba53b04ab0d49643863e70a3fdfc450c13d695c1102b46038adc22648a8c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.7.12 Darwin/21.2.0

Release files / yaaredis-3.0.0-cp37-cp37m-manylinux_2_31_x86_64.whl

Download URL yaaredis-3.0.0-cp37-cp37m-manylinux_2_31_x86_64.whl
Size 102.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
b612c4db5d2dc57b210a16f4e593d6650bd321e929fbbf1650c4aa6cc602aa0a
BLAKE2b-256 checksum
How to use checksums
dc54410acdcb576d6153e35833260478bf7ada18b66a18de9974c9273fc0aea2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.11.0-1022-aws

Release files / yaaredis-3.0.0-cp37-cp37m-macosx_12_0_x86_64.whl

Download URL yaaredis-3.0.0-cp37-cp37m-macosx_12_0_x86_64.whl
Size 96.4 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
a77f33b99c1581ea8cfd72115f3a03698a3acc414eeec0c14390655bf02bf7b5
BLAKE2b-256 checksum
How to use checksums
fde8eeca134675efad84756dc9237459dcd8c76bfc19566ae38761e4cfa41a52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.7.12 Darwin/21.2.0

Release files / yaaredis-3.0.0-cp36-cp36m-manylinux_2_31_x86_64.whl

Download URL yaaredis-3.0.0-cp36-cp36m-manylinux_2_31_x86_64.whl
Size 102.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
988236d9cb80bc590d5e42b1305bc53e8a8eeacee35f752222e9968df4cefcee
BLAKE2b-256 checksum
How to use checksums
da53f18be0b660f572de37af3b642072c5674cb94c91be723a773fbea591a1aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.11.0-1022-aws
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page