NoneGG / aredis

redis client for Python asyncio (has support for redis server, sentinel and cluster)

Home Page:http://aredis.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aredis

Latest Version in PyPI CircleCI build status Supported Python versions

An efficient and user-friendly async redis client ported from redis-py (which is a Python interface to the Redis key-value)

To get more information please read full document

Installation

aredis requires a running Redis server.

To install aredis, simply:

or from source:

Getting started

More examples

Tip: since python 3.8 you can use asyncio REPL:

single node client

cluster client

loop = asyncio.get_event_loop() loop.run_until_complete(example()) # {(10923, 16383): [{'host': b'172.17.0.2', 'node_id': b'332f41962b33fa44bbc5e88f205e71276a9d64f4', 'server_type': 'master', 'port': 7002}, # {'host': b'172.17.0.2', 'node_id': b'c02deb8726cdd412d956f0b9464a88812ef34f03', 'server_type': 'slave', 'port': 7005}], # (5461, 10922): [{'host': b'172.17.0.2', 'node_id': b'3d1b020fc46bf7cb2ffc36e10e7d7befca7c5533', 'server_type': 'master', 'port': 7001}, # {'host': b'172.17.0.2', 'node_id': b'aac4799b65ff35d8dd2ad152a5515d15c0dc8ab7', 'server_type': 'slave', 'port': 7004}], # (0, 5460): [{'host': b'172.17.0.2', 'node_id': b'0932215036dc0d908cf662fdfca4d3614f221b01', 'server_type': 'master', 'port': 7000}, # {'host': b'172.17.0.2', 'node_id': b'f6603ab4cb77e672de23a6361ec165f3a1a2bb42', 'server_type': 'slave', 'port': 7003}]}

Benchmark

Please run test script in benchmarks dir to confirm the benchmark.

For benchmark in my environment please see: benchmark

Contributing

Enhancement, bug reports and Pull requests are welcomed, please make an issue to let me know. Fork me please~

About

redis client for Python asyncio (has support for redis server, sentinel and cluster)

http://aredis.readthedocs.io/en/latest/

License:MIT License


Languages

Language:Python 99.3%Language:C 0.7%