Python wrapper for redis-rs
Project description
- Python wrapper for:
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.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.8.tar.gz
(19.2 kB
view hashes)
Built Distributions
Close
Hashes for redis_rs-0.6.8-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 222e4e5d49ce8a7516fe35d804faf26e74d41870966366eb7c31bdd24e598563 |
|
MD5 | 688b9a9cbb30a7a67605d0fbf69ca5b8 |
|
BLAKE2b-256 | 918f75fc711f6842ad01ebfb430bed45cdcce7fbc0cfd94ea1ae84996e9880eb |
Close
Hashes for redis_rs-0.6.8-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7313e434535c177657680a23aa172da5814899415ab73400106bddf32418699c |
|
MD5 | c8f5893f373c65497880f288794f3c99 |
|
BLAKE2b-256 | 8aa622d8c67c0a92a326460f97d00e78a9de0df8327c47366c0a85afedd8ef8f |
Close
Hashes for redis_rs-0.6.8-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cd0fe223560cff3ac0553eef4dc1d845e82aab7d03609936609c0e40e1d3ef3 |
|
MD5 | 840caedae4d7031bdf3b1545eb4baa93 |
|
BLAKE2b-256 | a40ee0fc82e43551981b01a1c6ce306f4b4499d22be67cc270325d4ba232784b |
Close
Hashes for redis_rs-0.6.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fc50503a9f73ccb1ba6f9c2690dc0ffda7253ddc8703302152415ad992c4769 |
|
MD5 | 532e07530db39eabe2ee449106d76999 |
|
BLAKE2b-256 | a92b9412c0517bb5e74aa78ddecff3a1a6c944c4e31d862e24753cc5bd518c2c |
Close
Hashes for redis_rs-0.6.8-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57b4b85f7c1fd3cb78fc1ab725f479e9496f865ccbff2bd01aa53cfd2d2da1eb |
|
MD5 | b8592f7861349b22dea6544a33696baf |
|
BLAKE2b-256 | 98908fef93498d9482516182823d8ad1953505c0401ff64b9c1956138b5839ce |
Close
Hashes for redis_rs-0.6.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59be279349d239855b71197b81f54e1bcb956352c86267ce3b57be3179f8f503 |
|
MD5 | cd3f943184aae519185694df0aafd0bc |
|
BLAKE2b-256 | 37802e5817cf59e96500912d3bddab3bc8de396a486a43ab57511505ba311178 |
Close
Hashes for redis_rs-0.6.8-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17fb32f200a3a5ad58c8b143f1f55c3d4c2c3089c75794cd8582a8e1dc0d83f7 |
|
MD5 | 49e7899c7ae5a2812e098cf12a3e7a3e |
|
BLAKE2b-256 | 43d9d7932b582cbefd28138fefa8817e159f339d1855148eead75f43c1a3f518 |
Close
Hashes for redis_rs-0.6.8-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71ff090035fca3392213c810edac8dacec8dd8a4cf8f699cc79695b0bf9b42ae |
|
MD5 | d9825fd11aae616d7792bf293608f1cb |
|
BLAKE2b-256 | 3741a3f422c3deff24846daef102fd5a7f4b580c0827dac2b98430b21c2203cd |
Close
Hashes for redis_rs-0.6.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84749d61a63478fd9aee95f31fb9fe275c00508de5499fc4a3e8674ff6507e3e |
|
MD5 | c1385a5e7632df82bda00d2d6208272b |
|
BLAKE2b-256 | 57d8e12e6b3a40eaeb59f15249d17540c8d0d37c0a7edbc8633b68870ee5fa20 |
Close
Hashes for redis_rs-0.6.8-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97c0bde09ebdf2c434b61fb08d733c8c586f1a44aad90bbe224ec79cdd8103b5 |
|
MD5 | c235120e7efdfcefd0805867a3a2b401 |
|
BLAKE2b-256 | 3a4e5e3cbba0114737fd61ac40aac3646039ba2913e39543bd9c215cb1775a9d |
Close
Hashes for redis_rs-0.6.8-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eee6408e4f04793dae7fdcd3fa6d68db235597bf21ae555e8edf70cbb52ec5fe |
|
MD5 | 2cd340685bc9f516eff6c2ffddde8c52 |
|
BLAKE2b-256 | 01b925c9024545704aac1783baa05f282ff6f2077455ee3411b6ae6aff7ed8c7 |
Close
Hashes for redis_rs-0.6.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1a9506bbe6199c42e9bc1128c515fe5aefbaabfe2b1d4d6ad3fcc4cd7c531ad |
|
MD5 | 72717b4f2b8adf409b230cd4c72e665f |
|
BLAKE2b-256 | c5201caf84128316f2b1d10ae760143692e7894d40c7c4975e7fd383e6dc831f |
Close
Hashes for redis_rs-0.6.8-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14b264ac1d17c302528b9f8f50b0bcc0c631b8011d2133455861b27cca0785a1 |
|
MD5 | 0dea8a4ab9d2352669b2875d7da13023 |
|
BLAKE2b-256 | 9f7d2d2081755f4fe5b272b3aa8ec168422c0bd84ecee3f77cdc1905798b31de |
Close
Hashes for redis_rs-0.6.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e221df0f3dab2c2f4c577a815dbb659316a8f37a540e56f477103847c162d3d |
|
MD5 | 6ed7ba6ae0bb141841f958e883fa19e1 |
|
BLAKE2b-256 | 5bf6abcebbf90ba0cf93adf6211a206b282aee3fa41248170b52619c9a3c03c3 |