All Projects → NoneGG → Aredis

NoneGG / Aredis

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

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Aredis

aioredis-cluster
Redis Cluster support extension for aioredis
Stars: ✭ 21 (-96.35%)
Mutual labels:  redis-cluster, redis-client, asyncio
Sqlalchemy aio
Asyncio strategy for SQLAlchemy.
Stars: ✭ 299 (-48.09%)
Mutual labels:  async, asyncio
Xredis
Redis C++ client, support the data slice storage, support redis cluster, thread-safe,multi-platform,connection pool, read/write separation.
Stars: ✭ 285 (-50.52%)
Mutual labels:  redis-client, redis-cluster
Tornado Celery
Non-blocking Celery client for Tornado
Stars: ✭ 561 (-2.6%)
Mutual labels:  async, asyncio
Example Scalping
A working example algorithm for scalping strategy trading multiple stocks concurrently using python asyncio
Stars: ✭ 267 (-53.65%)
Mutual labels:  async, asyncio
Aiologger
Asynchronous logging for python and asyncio
Stars: ✭ 284 (-50.69%)
Mutual labels:  async, asyncio
Fastoredis
FastoRedis is a crossplatform Redis GUI management tool.
Stars: ✭ 316 (-45.14%)
Mutual labels:  redis-client, redis-cluster
redis-developer.github.io
The Home of Redis Developers
Stars: ✭ 28 (-95.14%)
Mutual labels:  redis-cluster, redis-client
Picoweb
Really minimal web application framework for the Pycopy project (minimalist Python dialect) and its "uasyncio" async framework
Stars: ✭ 361 (-37.33%)
Mutual labels:  async, asyncio
Github Stats
Better GitHub statistics images for your profile, no external server required
Stars: ✭ 338 (-41.32%)
Mutual labels:  async, asyncio
Requests Threads
🎭 Twisted Deferred Thread backend for Requests.
Stars: ✭ 366 (-36.46%)
Mutual labels:  async, asyncio
Aiowebsocket
Async WebSocket Client. Advantage: Flexible Lighter and Faster
Stars: ✭ 263 (-54.34%)
Mutual labels:  async, asyncio
salad
Asynchronous Scala Redis Client supporting Sentinel and Redis Cluster
Stars: ✭ 14 (-97.57%)
Mutual labels:  redis-cluster, redis-client
Redisson
Redisson - Redis Java client with features of In-Memory Data Grid. Over 50 Redis based Java objects and services: Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Publish / Subscribe, Bloom filter, Spring Cache, Tomcat, Scheduler, JCache API, Hibernate, MyBatis, RPC, local cache ...
Stars: ✭ 17,972 (+3020.14%)
Mutual labels:  redis-client, redis-cluster
racompass
An advanced GUI for Redis. Modern. Efficient. Fast. A faster and robust Redis management tool. For developers that need to manage data with confidence.It supports Redis modules now!
Stars: ✭ 26 (-95.49%)
Mutual labels:  redis-cluster, redis-client
Async Techniques Python Course
Async Techniques and Examples in Python Course
Stars: ✭ 314 (-45.49%)
Mutual labels:  async, asyncio
Lettuce Core
Advanced Java Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.
Stars: ✭ 4,319 (+649.83%)
Mutual labels:  redis-client, redis-cluster
rueidis
A Fast Golang Redis RESP3 client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, RedisAI, RedisGears, etc.
Stars: ✭ 422 (-26.74%)
Mutual labels:  redis-cluster, redis-client
Example Hftish
Example Order Book Imbalance Algorithm
Stars: ✭ 355 (-38.37%)
Mutual labels:  async, asyncio
Lahja
Lahja is a generic multi process event bus implementation written in Python 3.6+ to enable lightweight inter-process communication, based on non-blocking asyncio
Stars: ✭ 374 (-35.07%)
Mutual labels:  async, asyncio

aredis

|pypi-ver| |circleci-status| |python-ver|

An efficient and user-friendly async redis client ported from redis-py <https://github.com/andymccurdy/redis-py>_ (which is a Python interface to the Redis key-value)

To get more information please read full document_

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

Installation

aredis requires a running Redis server.

To install aredis, simply:

.. code-block:: bash

$ pip3 install aredis[hiredis]

or from source:

.. code-block:: bash

$ python setup.py install

Getting started

More examples_

.. _More examples: https://github.com/NoneGG/aredis/tree/master/examples

Tip: since python 3.8 you can use asyncio REPL:

.. code-block:: bash

$ python -m asyncio

single node client ^^^^^^^^^^^^^^^^^^

.. code-block:: python

import asyncio
from aredis import StrictRedis

async def example():
    client = StrictRedis(host='127.0.0.1', port=6379, db=0)
    await client.flushdb()
    await client.set('foo', 1)
    assert await client.exists('foo') is True
    await client.incr('foo', 100)

    assert int(await client.get('foo')) == 101
    await client.expire('foo', 1)
    await asyncio.sleep(0.1)
    await client.ttl('foo')
    await asyncio.sleep(1)
    assert not await client.exists('foo')

loop = asyncio.get_event_loop()
loop.run_until_complete(example())

cluster client ^^^^^^^^^^^^^^

.. code-block:: python

import asyncio
from aredis import StrictRedisCluster

async def example():
    client = StrictRedisCluster(host='172.17.0.2', port=7001)
    await client.flushdb()
    await client.set('foo', 1)
    await client.lpush('a', 1)
    print(await client.cluster_slots())

    await client.rpoplpush('a', 'b')
    assert await client.rpop('b') == b'1'

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_

.. _benchmark: http://aredis.readthedocs.io/en/latest/benchmark.html

.. |circleci-status| image:: https://img.shields.io/circleci/project/github/NoneGG/aredis/master.svg :alt: CircleCI build status :target: https://circleci.com/gh/NoneGG/aredis/tree/master

.. |pypi-ver| image:: https://img.shields.io/pypi/v/aredis.svg :target: https://pypi.python.org/pypi/aredis/ :alt: Latest Version in PyPI

.. |python-ver| image:: https://img.shields.io/pypi/pyversions/aredis.svg :target: https://pypi.python.org/pypi/aredis/ :alt: Supported Python versions

Contributing

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].