aredis


Namearedis JSON
Version 1.1.8 PyPI version JSON
download
home_pagehttps://github.com/NoneGG/aredis
SummaryPython async client for Redis key-value store
upload_time2020-03-01 16:24:14
maintainer
docs_urlNone
authorJason Chen
requires_python
licenseMIT
keywords redis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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

    $ sudo pip3 install aredis

or alternatively (you really should be using pip though):

.. code-block:: bash

    $ sudo easy_install aredis

or from source:

.. code-block:: bash

    $ sudo python setup.py install


Getting started
---------------

`For more example`_

.. _For more example: https://github.com/NoneGG/aredis/tree/master/examples

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~

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NoneGG/aredis",
    "name": "aredis",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Redis",
    "author": "Jason Chen",
    "author_email": "847671011@qq.com",
    "download_url": "https://files.pythonhosted.org/packages/57/be/88a14ad051da02c261fedde9adbd73aeed172a8d484fd76be634168d2300/aredis-1.1.8.tar.gz",
    "platform": "",
    "description": "aredis\n======\n|pypi-ver| |circleci-status| |python-ver|\n\nAn efficient and user-friendly async redis client ported from `redis-py <https://github.com/andymccurdy/redis-py>`_\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    $ sudo pip3 install aredis\n\nor alternatively (you really should be using pip though):\n\n.. code-block:: bash\n\n    $ sudo easy_install aredis\n\nor from source:\n\n.. code-block:: bash\n\n    $ sudo python setup.py install\n\n\nGetting started\n---------------\n\n`For more example`_\n\n.. _For more example: https://github.com/NoneGG/aredis/tree/master/examples\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",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python async client for Redis key-value store",
    "version": "1.1.8",
    "project_urls": {
        "Homepage": "https://github.com/NoneGG/aredis"
    },
    "split_keywords": [
        "redis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57be88a14ad051da02c261fedde9adbd73aeed172a8d484fd76be634168d2300",
                "md5": "1ff3630906f395ddfef12b9dbf2b850e",
                "sha256": "880bcf91c4f89b919311cc93626bbc70901c6e5c4fdb3dcba643411e3ee40bcf"
            },
            "downloads": -1,
            "filename": "aredis-1.1.8.tar.gz",
            "has_sig": false,
            "md5_digest": "1ff3630906f395ddfef12b9dbf2b850e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 128775,
            "upload_time": "2020-03-01T16:24:14",
            "upload_time_iso_8601": "2020-03-01T16:24:14.504400Z",
            "url": "https://files.pythonhosted.org/packages/57/be/88a14ad051da02c261fedde9adbd73aeed172a8d484fd76be634168d2300/aredis-1.1.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-03-01 16:24:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NoneGG",
    "github_project": "aredis",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "circle": true,
    "test_requirements": [
        {
            "name": "mock",
            "specs": []
        },
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "pytest-asyncio",
            "specs": []
        },
        {
            "name": "contextvars",
            "specs": []
        }
    ],
    "lcname": "aredis"
}
        
Elapsed time: 1.43966s