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.5.tar.gz
(33.9 kB
view hashes)
Built Distributions
Close
Hashes for redis_rs-0.6.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f3310fa3ebcc332d00b39ce62d9caa488df719c9f9c9086f55082299c392851 |
|
MD5 | 2be0c8078b204962b2184b2f02836037 |
|
BLAKE2b-256 | 0ff28e7dea738c76ff6026fc6db6979fb8f90c8d77581548e2556e87e7946bab |
Close
Hashes for redis_rs-0.6.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7585172a7888b8174be967f38e497c382c5eeeee29a89db9899ff442b938400b |
|
MD5 | 9ed73e2af8478bfbc5d865e49294749e |
|
BLAKE2b-256 | a2e18a8ba695bc84ddd595c7610c195f9959415fa6ba354f24d85a0cb0140915 |
Close
Hashes for redis_rs-0.6.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 602e855126b15951da940b89d7563f80a589febb56c3fbca398c8342abcfeece |
|
MD5 | f4f148b973c27ddc5edfc3482e672d01 |
|
BLAKE2b-256 | e9a11141b8b023c16b6625291e8e43bf4986d66673381d714b4a9cec7cae236b |
Close
Hashes for redis_rs-0.6.5-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dd6f49b69273cb76d9391ac79eeafc473e8593d157c104ebe651ee84cfa9187 |
|
MD5 | 912b68573e2e59d072e16321188c0996 |
|
BLAKE2b-256 | c153de443e149766ed0196e7ade647f8a75230c12f01d09ea6d3c208b9d3f71e |
Close
Hashes for redis_rs-0.6.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20137bcbfa4a7c9bce49a7dffbe0fe876f7d6cccb01a10dac9449626b4d8e58f |
|
MD5 | 46bfb9dd5f1b91a13fe5964de29fc45c |
|
BLAKE2b-256 | 9cff693accca1bd3f28486762322c94b29ca76b8ffd874b262355365a9093a38 |
Close
Hashes for redis_rs-0.6.5-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98a1ce55b21bbde2f667b26962166f78e9bed6e530e8fa59ed2d1c92d47afc11 |
|
MD5 | df8509c5417f962fb93d9dbec45dfbe2 |
|
BLAKE2b-256 | d886d65079d85b76a0250a567799457f51de735e7e555bad7256c04e1ace04fb |
Close
Hashes for redis_rs-0.6.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b63c00f66e820a7e0223b4e7138bfceef3592df735abf7b13b62b85a07bd2550 |
|
MD5 | 1b5a7b10d0747afceb739bc23bdeb676 |
|
BLAKE2b-256 | 7908f0c2008b875687b63e0526a1feb76653d7ffad14c0ae4f7310820b44cf2a |
Close
Hashes for redis_rs-0.6.5-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 412113eae7c872d87f012ae86cf5a99a4723d616ced6fe8829dbce0d28ee19d4 |
|
MD5 | b8544b5d5df28840b63d173cb786f751 |
|
BLAKE2b-256 | c6cd4cbec27567932a4755219b4fe5b75ffe5a6c49d047118f3640fe423ff9a7 |
Close
Hashes for redis_rs-0.6.5-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8f919f1f52bc6044c858a9b7827fc514a17377e512aaf545431c4520a98355f |
|
MD5 | 899172ecaae4f328315f3627d36a71ec |
|
BLAKE2b-256 | 740bb49eac20da226847c740429a9a41f4f0127c8b6e4444df67c8c339bf30b7 |
Close
Hashes for redis_rs-0.6.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f145d933208f4e7d408b3909cd30015cd9954d3de7aa2f6305677ac52afd9b3 |
|
MD5 | a2edf4fcac9f505d17620dd46c528d5d |
|
BLAKE2b-256 | 3d898544915a972e4b0c61e5bc81a5f900ba95f10ef7f1435df1cc2415854d8a |
Close
Hashes for redis_rs-0.6.5-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f4d4a283427eb0be4b0030038cb51267e33e29966578dde7062f1e605e62e4e |
|
MD5 | 8adf9086abd2b3b35dbcd212bcfa7676 |
|
BLAKE2b-256 | a3640c52f87c87c563e0dc1208d07c7d51ceca51eda94ff1a0570370af51f189 |
Close
Hashes for redis_rs-0.6.5-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbe060c45fce5632c89cd2bac989d1d35c65f8d9411efce6f04379b72b2ff332 |
|
MD5 | 20361abf4185356d9e9b9a015481daa7 |
|
BLAKE2b-256 | 2d4b5b6608230fdf78690db8ab787723de56b83db031aa9052cf2a0dc854a7ee |
Close
Hashes for redis_rs-0.6.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0ab9b6c2df7eede393c48a3239a3e760f29c25cd3bb992bac6fd08097cf440d |
|
MD5 | 621121abe50b8f896b0b5ef92a74bbb5 |
|
BLAKE2b-256 | 6f1c38afc5f94b82d2758f05aa96d8925069a788a59bc4a50cfe14adef54c7a5 |
Close
Hashes for redis_rs-0.6.5-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6c22171cb577cb0cb3202f85a8b60ccadf627429fd2c35e33260f917f6ff200 |
|
MD5 | bd6f413c6091b44ada6f2407a8d52330 |
|
BLAKE2b-256 | f1e475b1d5f3f41c3489b826be56bf12c7bac0dbc618575ccaddfaaf26070818 |
Close
Hashes for redis_rs-0.6.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 952b09c11218d698811065d8efa066e23705faa2f6ab954f41f76b6fb7175ab8 |
|
MD5 | a082d0863f2838c0163e9def74af7362 |
|
BLAKE2b-256 | 598e246f0c7bb6ba3dc2906a6293d7a69f29d92b932539cdd97f8eceaa5baffb |