Metadata-Version: 2.1
Name: pyApp-Redis
Version: 1.0b1
Summary: Redis Extension for PyApp
Home-page: https://github.com/pyapp-org/pae.redis
Author: Tim Savage
Author-email: tim@savage.company
License: BSD
Keywords: application,framework
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.6
Requires-Dist: pyapp (>=4.0b4)
Requires-Dist: redis (>=3.0)
Provides-Extra: dev
Requires-Dist: docutils ; extra == 'dev'
Requires-Dist: black ; extra == 'dev'
Provides-Extra: hiredis
Requires-Dist: hiredis ; extra == 'hiredis'

#############
pyApp - Redis
#############

*Let us handle the boring stuff!*

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://github.com/ambv/black
      :alt: Once you go Black...

This extension provides a `Redis` client factory to allow configuration to be
configured via pyApp settings.

The extension also provides checks to confirm the settings are correct and
that the application is able to connect to the redis instance.


Installation
============

Install using *pip*::

    pip install pyapp-redis

Install using *pipenv*::

    pipenv install pyapp-redis


Add `pae.redis` into the `EXT` list in your applications
`default_settings.py`.

Add the `REDIS` block into your runtime settings file::

    REDIS = {
        "default": {
            "url": "redis://user:pass@host:port/1",
        },
    }


.. note::

    The URL is a defined by Redis client see the
    `documentation <https://github.com/andymccurdy/redis-py/blob/master/redis/client.py#L599>`_.
    In addition to the url any argument that can be provided to `Redis.from_url` can be provided.


Usage
=====

The following example creates both `Connection` and `Session` instances::

    from pae.redis import get_client

    # Get connection
    redis = get_client()

    redis.set("foo")


API
===

`pae.redis.get_client(default: str = None) -> Redis`

    Get named `Redis` client instance


