https://github.com/justanotherbyte/asyncredis
An asyncio compatible Redis driver, written purely in Python. This is really just a pet-project for me.
https://github.com/justanotherbyte/asyncredis
asyncio driver python redis redis-client redis-driver
Last synced: 10 months ago
JSON representation
An asyncio compatible Redis driver, written purely in Python. This is really just a pet-project for me.
- Host: GitHub
- URL: https://github.com/justanotherbyte/asyncredis
- Owner: justanotherbyte
- License: agpl-3.0
- Created: 2021-12-23T11:10:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-25T12:45:22.000Z (over 4 years ago)
- Last Synced: 2025-08-18T18:46:20.438Z (10 months ago)
- Topics: asyncio, driver, python, redis, redis-client, redis-driver
- Language: Python
- Homepage: https://asyncredis.readthedocs.io/en/latest/
- Size: 55.7 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
asyncredis
An asyncio compatible Redis driver. Just a pet-project.
Read the documentation.
## Information
`asyncredis` is, like I've said above, just a pet-project for me. I really just wanted to experiment with database protocols, and try to write my first database driver!
`asyncredis` internally connects with `asyncio`, allowing for asynchronous socket states. It also supports retrying connections. Please DO NOT use this in production. I recommend `aioredis` for production usage.
#### Internals
Internally, `asyncredis` uses `hiredis` to parse messages that are received from the Redis server. `hiredis` ensures speedy parsing, thanks to being C based.
## Examples
If you do decide to test out this driver for yourself, I'll leave some examples below.
```py
import asyncio
import asyncredis
async def main():
rds = await asyncredis.connect("redis://localhost:6379")
await rds.set("hello", "world")
value = await rds.get("hello")
exists = await rds.exists("hello")
seralized = await rds.dump("hello")
await rds.delete("hello")
print(value)
print(exists)
print(seralized)
await rds.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```
```powershell
>>> world
>>> True
>>> b'\x00\x05world\t\x00\xc9#mH\x84/\x11s'
```