Skip to main content

Python wrapper for redis-rs

Project description

https://img.shields.io/badge/License-MIT-blue.svg https://img.shields.io/pypi/v/redis-rs.svg Python versions Documentation Status https://github.com/aamalev/redis-rs-py/workflows/Tests/badge.svg https://img.shields.io/pypi/dm/redis-rs.svg

https://img.shields.io/badge/Rustc-1.73.0-blue.svg https://img.shields.io/badge/PyO3-maturin-blue.svg https://img.shields.io/badge/PyO3-asyncio-blue.svg Code style: ruff Code style: black Code style: Mypy Hatch project
Python wrapper for:
redis_cluster_async,
bb8-redis,
bb8-redis-cluster,
deadpool-redis-cluster,

Features

  • Async client for single and cluster

  • Support typing

  • Encoding values to str, int, float

Install

pip install redis-rs

Using

import asyncio
import redis_rs


async def main():
    async with redis_rs.create_client(
        "redis://redis-node001",
        "redis://redis-node002",
        max_size=1,
        cluster=True,
    ) as x:
        print(await x.execute(b"HSET", "fooh", "a", b"asdfg"))
        print(await x.fetch_int("HSET", "fooh", "b", 11234567890))
        print(await x.fetch_int("HGET", "fooh", "b"))
        print(await x.fetch_str("HGET", "fooh", "a"))
        print(await x.fetch_dict("HGETALL", "fooh", encoding="utf-8"))
        print(await x.execute("CLUSTER", "NODES"))
        print(await x.fetch_bytes("GET", "foo"))
        print(await x.fetch_int("GET", "foo"))
        print(await x.execute("HGETALL", "fooh"))
        print(await x.execute("ZADD", "fooz", 1.5678, "b"))
        print(await x.fetch_scores("ZRANGE", "fooz", 0, -1, "WITHSCORES"))
        print(x.status())

        stream = "redis-rs"
        print("x.xadd", await x.xadd(stream, "*", {"a": "1234", "d": 4567}))
        print("x.xadd", await x.xadd(stream, items={"a": "1234", "d": 4567}))
        print("x.xadd", await x.xadd(stream, {"a": "1234", "d": 4567}))
        print("x.xadd", await x.xadd(stream, "*", "a", "1234", "d", 4567))
        print("x.xadd", await x.xadd(stream, "a", "1234", "d", 4567))
        print("xadd", await x.fetch_str("XADD", stream, "*", "a", "1234", "d", 4567))
        print("xread", await x.execute("XREAD", "STREAMS", stream, 0))
        print("xread", await x.fetch_dict("XREAD", "STREAMS", stream, 0, encoding="int"))
        print("x.xread", await x.xread({stream: 0}, encoding="int"))


asyncio.run(main())

Development

cargo fmt
cargo clippy
maturin develop

or use hatch envs:

hatch run fmt
hatch run check
hatch run build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redis_rs-0.5.2.tar.gz (17.9 kB view details)

Uploaded Source

Built Distributions

redis_rs-0.5.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

redis_rs-0.5.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

redis_rs-0.5.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

redis_rs-0.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

redis_rs-0.5.2-cp311-none-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

redis_rs-0.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

redis_rs-0.5.2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (3.4 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

redis_rs-0.5.2-cp310-none-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.10Windows x86-64

redis_rs-0.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

redis_rs-0.5.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (3.4 MB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

redis_rs-0.5.2-cp39-none-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.9Windows x86-64

redis_rs-0.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

redis_rs-0.5.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (3.4 MB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

redis_rs-0.5.2-cp38-none-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.8Windows x86-64

redis_rs-0.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

redis_rs-0.5.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (3.4 MB view details)

Uploaded CPython 3.8macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

File details

Details for the file redis_rs-0.5.2.tar.gz.

File metadata

  • Download URL: redis_rs-0.5.2.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.3.0

File hashes

Hashes for redis_rs-0.5.2.tar.gz
Algorithm Hash digest
SHA256 6632e70ad0682ab1cc81d51f49f3a61bb1a72e921b3939c7ca28d57ab3023711
MD5 c6c80ff97fe30532e2200bea1805b6e3
BLAKE2b-256 b88780dd6fc148605c3434442e41bbf638db10eebd306479857326c458dfd6fd

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa0624dc92c3286b97401c9a00484cee2a4d5365b4cb24954460e66d4085cbe5
MD5 941ea93fe5f17acd5aa40d7fe37470aa
BLAKE2b-256 dee84fcbb0f5360e62ddda80b04762e4e057c84e9de6198f15f0bdc49d4393c0

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 804bbc901d6de2279297e0de1966d5d15c8fe0de6e7afbfd97440ce8b7d9f6a6
MD5 68ac9d61d6543f1e60b225f5915cc145
BLAKE2b-256 b52520ed1cc5ef4c282ca83fd697e8c1f6af520ee1a63678e5d37be095d1fc6b

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ba794bd41216b50556ef9093b3b71dbba5d6de71bf2b36750c52ad5a6601dec
MD5 202555ad40c263d63cd2462bb34da621
BLAKE2b-256 3083fa233132f0467b1ef0f31842e9d51ff6f1feb8dbe7a8e78d23fae4c41735

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ce1107d01db4fd8229497b55ae96c551d32082ae98e6255c31771d70a1c0aa73
MD5 13e08e2842c9d8aeaabf4c538da9858e
BLAKE2b-256 7c1fc88bdfcd89ac8e594c4c9428f1dc3163b2ca01ee22a165238c233a7b5e06

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp311-none-win_amd64.whl.

File metadata

  • Download URL: redis_rs-0.5.2-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.3.0

File hashes

Hashes for redis_rs-0.5.2-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 54e94bfa906a372af830aaf791391bf7c4926a374cb345ea079b0d431bb851c9
MD5 2058909f471e2304b67f61a32ff7133f
BLAKE2b-256 b6bb0abf5db94ab0874f6353d5e65448d262f1813e5f17263379ae357a1a56f5

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3a258045f6c88232476b2c05ae7141669dca86829690db24bf0f8555e881c7a1
MD5 619d6b62ae212310ac2e58ab4cb808d1
BLAKE2b-256 e648c270b1588b9f0d8a0a7b994b28b7f372a53c03d0ff5f169dc2f4e9aa1916

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5c6ae0c213e653c354206b9eb938f4abb0f39d143942ec787a49b6869598b1eb
MD5 6a559c3a9c308490a86f1cdca1fb0eeb
BLAKE2b-256 f054a99f88d468b92bcfab05033d6b79a633414d197a056f799dadca164981d5

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp310-none-win_amd64.whl.

File metadata

  • Download URL: redis_rs-0.5.2-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.3.0

File hashes

Hashes for redis_rs-0.5.2-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 9c281fe922ef8abc705e09ce77f137181b86dc321abdae1d1e94f9cc4edf1344
MD5 6ab7542a750f7b7336e80452c4cd3927
BLAKE2b-256 f27be970a353ae4eb3092a4225fe069603662b628273ba21b2272b9beea9b035

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2fb55360b139c54cccc924c1dfa6ebaf8467ee493f6fea5bf77cdb806c7aea23
MD5 e80fdbc38dd25ef64ca6d93cddcb8455
BLAKE2b-256 a3d24feecfd7d764422830170407db9a9381ad329dbf9d5a1c842153417ac305

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 cc7b7cc40b56325ff67f785e5287a1a4d0d7d97a83e170c3eb6645c7318986aa
MD5 cbb648b420df38603daa837aa94f78d9
BLAKE2b-256 6be792196ca6331c406743a8c5d3ca099c3cb2456a1453021ea3657a96089a0d

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp39-none-win_amd64.whl.

File metadata

  • Download URL: redis_rs-0.5.2-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.3.0

File hashes

Hashes for redis_rs-0.5.2-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 b360b9b13666675e0d69bab4dabb4b798158693efda25b1b0bb670cd2264286d
MD5 b2df87dd4b7463c0edb4b53eb8c88a94
BLAKE2b-256 d9336861c89259714db4907f106d44279dd376e603940f9fc2ee8484614a3013

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 15836622fdbd8af0046c45423bbb83bcb570bfa05482c80acbbdea90760eb6cf
MD5 d6b842afc25cede689677ee67a5ec73e
BLAKE2b-256 bee41dd8c859556b211da887506948e9c170ac674afa9a6771c72db52fbc79b7

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 08b5b9908aee3b87f71ef25293ffe15b18ab761ddd0d666911e4601284f4f932
MD5 3f9c177df6f5c294781b3a1ccfc17dcf
BLAKE2b-256 3b0914f615d56ee31ae021f458892b8e964ac16b06ee2712ac8197d1a3efcc78

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp38-none-win_amd64.whl.

File metadata

  • Download URL: redis_rs-0.5.2-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.3.0

File hashes

Hashes for redis_rs-0.5.2-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 4939359ba7175cb27ae431a78c5789fb6236b0c41bb718cf16dc76b3ed9c74bc
MD5 b6e36e36f781d868747c3bc7210af793
BLAKE2b-256 17eb9ad4709a5468dd870a40d0c87e6f50c6bf055c387362c3bd1ecb001348a4

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4ef390f8c497fb16ad4f726c760e45c7809d1cb215464009375203ed3ce78aad
MD5 cecb8be10b3316849392f426353ebf97
BLAKE2b-256 d0bc719ede9d3c57c85a2188fae87432d2e4425a1f11f93c2895b53546eb8e0f

See more details on using hashes here.

File details

Details for the file redis_rs-0.5.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for redis_rs-0.5.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c546dd95529eacee3bed1d98a3acac2b9cadd92a46598c3f6e331c31608c0eca
MD5 34a74d4a83b78e1665f02fa38f5d3e67
BLAKE2b-256 1be9ce6cc1f9509c9b5e04c7adb8374ef20efade98e859a0c8dbf1960e31ca09

See more details on using hashes here.

Supported by

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