Python client library for myredis written in C with Python wrapper. Compatible with original Redis
Why did I choose C and use workarounds for asyncio
and myasync for socket operations in C? Just for practice and fun. In any case, no one but me will use this library.
- Create venv
python -m venv .venv
- Activate venv
. .venv/bin/activate
- Install
myredis-py
pip install myredis-py@git+https://github.com/KrySeyt/myredis-py.git
import asyncio
from myredis import AsyncRedis
async def main() -> None:
async with AsyncRedis(host="localhost", port=6379) as redis:
await redis.set("foo", "bar", lifetime=1.5)
print(await redis.get("foo"))
if __name__ == "__main__":
asyncio.run(main())