Python wrapper for redis-rs
Project description
- Python wrapper for:
Features
Async client for single and cluster
Support typing
Encoding values from str, int, float
Decoding values to str, int, float, list, dict
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.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"))
print("x.xread", await x.xread(stream, id=0, encoding="int"))
print("x.xread", await x.xread(stream, stream))
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
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
redis_rs-0.6.11.tar.gz
(19.3 kB
view hashes)
Built Distributions
Close
Hashes for redis_rs-0.6.11-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea54fabd0222e7e6352458649cb4b030be139b6d2ff64cdcfed11ec9123c0784 |
|
MD5 | 7b6465bc2ddb1eab578e4f85bd9ba28d |
|
BLAKE2b-256 | 336cb70c724f9dd93d9b426606d0c82bbaa74c8c1df9dbb5870c232cc8a377c2 |
Close
Hashes for redis_rs-0.6.11-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 060022ac8709f099463ef867510053901d96434d9c5dc45cad3966aabc781be0 |
|
MD5 | 508a0324f5d662b433f175765d75ee15 |
|
BLAKE2b-256 | 8676da11b1d003ebf367a5dd7c3213cc8a980a43317b4ad1caa402add3e5e440 |
Close
Hashes for redis_rs-0.6.11-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 234e245be17d361c684b453aa3fdbbbcaa3e319b6a00269e70c18ba68e890da8 |
|
MD5 | e6f7c1c8f21460450e8bbaf737bb1797 |
|
BLAKE2b-256 | eeff460e53e5896129556551c6a8dce6aa1ce085ecf723ba0784701b1208dfbc |
Close
Hashes for redis_rs-0.6.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91d8f61ab6a0a69362d871aa977098a8baa45dce6ee64f5c87110d469d3854ce |
|
MD5 | e74b8959da73173077add3e8a01f3491 |
|
BLAKE2b-256 | 0743ed515af223f457c47d7fe9f4e208a5d520ac01ae6b41ee79f5ef5d532558 |
Close
Hashes for redis_rs-0.6.11-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5e351fe9da7f33ecec62499e203babeb69e24cf10c7b86eef7ef4ae139d2ba1 |
|
MD5 | 92f3f712d11d9c10087b1835b5a9954e |
|
BLAKE2b-256 | 2c1735042ed1a3768a574bf0f63fed4317e7ccfcae494a7caab5aa13a40e5e8a |
Close
Hashes for redis_rs-0.6.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99ee991a1d447c5b156104d09061a1813fb27f88b39cb5f0dca9daee1e9cf47f |
|
MD5 | 6053e2c43ac66049d9b3053e6760cf0d |
|
BLAKE2b-256 | 7cf128ecaef61e3d254d8f2b987684b463c86c2c76eb54e49b0ff879d66bae28 |
Close
Hashes for redis_rs-0.6.11-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a361926aee897ff25ca8236d3a11e392d8f6297e4a337df980e25ef9709776e9 |
|
MD5 | 561c06261c9494fa63afc67e304a1869 |
|
BLAKE2b-256 | a94067ded4f2fd510999f53f7d9cfabb21d3c77a3a85e5132d88fd4f1f46acd4 |
Close
Hashes for redis_rs-0.6.11-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36479fe5bbd5c229514c3b5f7b720a8a1b705bcb163f7e6831d4c512bc29f64c |
|
MD5 | fdd3de0ea11d399b65f3f83232b1cb5b |
|
BLAKE2b-256 | de57f250c1e09d498bf95a75c55aed717a4c116fa87b2973d577b34b51c9295b |
Close
Hashes for redis_rs-0.6.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56f6ce5c9c031e3aaa886439c4872c31ea1b9d39d6af0743d8fafb5a995ee787 |
|
MD5 | 2bd9f32474e97b205085f573c2d5773a |
|
BLAKE2b-256 | 5be3fa2aa8577f5dd9cdcf76f68baaa786dbb0267ddc69916038dabdf49e4357 |
Close
Hashes for redis_rs-0.6.11-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99d214f49076c66b6e6d80cbc5743c70fa65ed551b26bd3c573fc1e3cc62ac27 |
|
MD5 | 09c12942624a6ce79c6174fd82e6cf78 |
|
BLAKE2b-256 | 6a59da620a3b3185d19c992da50d6e6f7a795fb26ee0165ad61418c5636d0f52 |
Close
Hashes for redis_rs-0.6.11-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb24326745f35b338cbcabfc07493ca0e096eacc4b4cac5015e0e4f7b77ec703 |
|
MD5 | 4aa4e7ea28ff5e27139b156e7f5933d6 |
|
BLAKE2b-256 | 579fdaf90ae0c819e923840c615865f0ce7d61ce17734b8b6a696a577cf5205d |
Close
Hashes for redis_rs-0.6.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07ab53ed39c5b9efea2e0c4218ea3dde7717cd997c857cbc19c96ce954c5ebd2 |
|
MD5 | 83d1efe368ce490a4e2e9f3e881b0f94 |
|
BLAKE2b-256 | 687b93a1f76796c82b2e208586d95187ef7b20eda886b4189702978138cfccc0 |
Close
Hashes for redis_rs-0.6.11-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 905eacc925654e6617ba73383338e0969b427fd6a052fdb0601220310f0f89b6 |
|
MD5 | dc1df4eadaf25a04c2c3298e06451dd2 |
|
BLAKE2b-256 | 03e493597a88eeabe7fd551ad5bee1007139c0f1a1717a7255459fd61733290d |
Close
Hashes for redis_rs-0.6.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c81a654555241d01530e4aecb0d82d45900d77a24f8bf08f3db5e6b78f09dd4 |
|
MD5 | 06d590375a4a3f969fdbea45b837bee7 |
|
BLAKE2b-256 | 7070891f0f4207156a4c3a2a3acc708d8d21b68d28fe55e12ba175099416ffba |