{"id":13936603,"url":"https://github.com/NoneGG/aredis","last_synced_at":"2025-07-19T22:31:11.039Z","repository":{"id":14919531,"uuid":"76640818","full_name":"NoneGG/aredis","owner":"NoneGG","description":"redis client for Python asyncio (has support for redis server, sentinel and cluster)","archived":false,"fork":false,"pushed_at":"2023-07-14T14:13:11.000Z","size":723,"stargazers_count":646,"open_issues_count":63,"forks_count":96,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-11-17T14:03:45.382Z","etag":null,"topics":["async","asyncio","redis-client","redis-cluster"],"latest_commit_sha":null,"homepage":"http://aredis.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NoneGG.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-12-16T09:30:46.000Z","updated_at":"2024-09-05T15:59:31.000Z","dependencies_parsed_at":"2023-01-13T18:11:10.772Z","dependency_job_id":"4e101703-7f03-4986-b154-e441a4f3aac5","html_url":"https://github.com/NoneGG/aredis","commit_stats":{"total_commits":272,"total_committers":25,"mean_commits":10.88,"dds":0.2941176470588235,"last_synced_commit":"b46e67163692cd0796763e5c9e17394821d9280c"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoneGG%2Faredis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoneGG%2Faredis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoneGG%2Faredis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoneGG%2Faredis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NoneGG","download_url":"https://codeload.github.com/NoneGG/aredis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226686729,"owners_count":17666928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","asyncio","redis-client","redis-cluster"],"created_at":"2024-08-07T23:02:50.197Z","updated_at":"2024-11-27T04:31:15.105Z","avatar_url":"https://github.com/NoneGG.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"aredis\n======\n|pypi-ver| |circleci-status| |python-ver|\n\nAn efficient and user-friendly async redis client ported from `redis-py \u003chttps://github.com/andymccurdy/redis-py\u003e`_\n(which is a Python interface to the Redis key-value)\n\nTo get more information please read `full document`_\n\n.. _full document: http://aredis.readthedocs.io/en/latest/\n\nInstallation\n------------\n\naredis requires a running Redis server.\n\nTo install aredis, simply:\n\n.. code-block:: bash\n\n    $ pip3 install aredis[hiredis]\n\nor from source:\n\n.. code-block:: bash\n\n    $ python setup.py install\n\n\nGetting started\n---------------\n\n`More examples`_\n\n.. _More examples: https://github.com/NoneGG/aredis/tree/master/examples\n\nTip: since python 3.8 you can use asyncio REPL:\n\n.. code-block:: bash\n\n    $ python -m asyncio\n\nsingle node client\n^^^^^^^^^^^^^^^^^^\n\n.. code-block:: python\n\n    import asyncio\n    from aredis import StrictRedis\n\n    async def example():\n        client = StrictRedis(host='127.0.0.1', port=6379, db=0)\n        await client.flushdb()\n        await client.set('foo', 1)\n        assert await client.exists('foo') is True\n        await client.incr('foo', 100)\n\n        assert int(await client.get('foo')) == 101\n        await client.expire('foo', 1)\n        await asyncio.sleep(0.1)\n        await client.ttl('foo')\n        await asyncio.sleep(1)\n        assert not await client.exists('foo')\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(example())\n\ncluster client\n^^^^^^^^^^^^^^\n\n.. code-block:: python\n\n    import asyncio\n    from aredis import StrictRedisCluster\n\n    async def example():\n        client = StrictRedisCluster(host='172.17.0.2', port=7001)\n        await client.flushdb()\n        await client.set('foo', 1)\n        await client.lpush('a', 1)\n        print(await client.cluster_slots())\n\n        await client.rpoplpush('a', 'b')\n        assert await client.rpop('b') == b'1'\n\n   loop = asyncio.get_event_loop()\n   loop.run_until_complete(example())\n   # {(10923, 16383): [{'host': b'172.17.0.2', 'node_id': b'332f41962b33fa44bbc5e88f205e71276a9d64f4', 'server_type': 'master', 'port': 7002},\n   # {'host': b'172.17.0.2', 'node_id': b'c02deb8726cdd412d956f0b9464a88812ef34f03', 'server_type': 'slave', 'port': 7005}],\n   # (5461, 10922): [{'host': b'172.17.0.2', 'node_id': b'3d1b020fc46bf7cb2ffc36e10e7d7befca7c5533', 'server_type': 'master', 'port': 7001},\n   # {'host': b'172.17.0.2', 'node_id': b'aac4799b65ff35d8dd2ad152a5515d15c0dc8ab7', 'server_type': 'slave', 'port': 7004}],\n   # (0, 5460): [{'host': b'172.17.0.2', 'node_id': b'0932215036dc0d908cf662fdfca4d3614f221b01', 'server_type': 'master', 'port': 7000},\n   # {'host': b'172.17.0.2', 'node_id': b'f6603ab4cb77e672de23a6361ec165f3a1a2bb42', 'server_type': 'slave', 'port': 7003}]}\n\nBenchmark\n---------\n\nPlease run test script in benchmarks dir to confirm the benchmark.\n\nFor benchmark in my environment please see: `benchmark`_\n\n.. _benchmark: http://aredis.readthedocs.io/en/latest/benchmark.html\n\n.. |circleci-status| image:: https://img.shields.io/circleci/project/github/NoneGG/aredis/master.svg\n    :alt: CircleCI build status\n    :target: https://circleci.com/gh/NoneGG/aredis/tree/master\n\n.. |pypi-ver| image::  https://img.shields.io/pypi/v/aredis.svg\n    :target: https://pypi.python.org/pypi/aredis/\n    :alt: Latest Version in PyPI\n\n.. |python-ver| image:: https://img.shields.io/pypi/pyversions/aredis.svg\n    :target: https://pypi.python.org/pypi/aredis/\n    :alt: Supported Python versions\n\nContributing\n------------\n\nEnhancement, bug reports and Pull requests are welcomed, please make an issue to let me know.\nFork me please~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNoneGG%2Faredis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNoneGG%2Faredis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNoneGG%2Faredis/lists"}