Metadata-Version: 2.0
Name: dache
Version: 0.0.4
Summary: Unify API across various cache backends
Home-page: https://github.com/eliangcs/dache
Author: Chang-Hung Liang
Author-email: eliang.cs@gmail.com
License: BSD
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Requires-Dist: six (>=1.8.0,<1.9.0)
Provides-Extra: redis
Requires-Dist: hiredis (>=0.1.5,<0.2.0); extra == 'redis'
Requires-Dist: redis (>=2.10.3,<2.11.0); extra == 'redis'
Provides-Extra: pylibmc
Requires-Dist: pylibmc (>=1.3.0,<1.4.0); extra == 'pylibmc'
Provides-Extra: leveldb
Requires-Dist: leveldb (==0.193); extra == 'leveldb'
Provides-Extra: memcached
Requires-Dist: python-memcached (>=1.53); extra == 'memcached'
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: leveldb (==0.193); extra == 'test'
Requires-Dist: python-memcached (>=1.53); extra == 'test'
Requires-Dist: pylibmc (>=1.3.0,<1.4.0); extra == 'test'
Requires-Dist: hiredis (>=0.1.5,<0.2.0); extra == 'test'
Requires-Dist: redis (>=2.10.3,<2.11.0); extra == 'test'

Dache
=====

.. image:: https://badge.fury.io/py/dache.svg
    :target: http://badge.fury.io/py/dache

.. image:: https://travis-ci.org/eliangcs/dache.svg?branch=master
    :target: https://travis-ci.org/eliangcs/dache

.. image:: https://coveralls.io/repos/eliangcs/dache/badge.png?branch=master
    :target: https://coveralls.io/r/eliangcs/dache

Forked from Django's cache framework, Dache is a Python library that provides
a unified API across various cache backends.

**WARNING**: This package is still in development. **Do NOT use it in
production!**


Installation
------------
::

    pip install dache


Usage
-----
::

    >>> import dache
    >>> cache = dache.Cache('locmem://')
    >>> cache.set('key', {'value': 1234})
    >>> cache.get('key')
    {'value': 1234}

Built-in backends:

+--------------+-----------------------------------------------+--------------------------------------------------+
| Backend      | Required Python Package(s)                    | URL                                              |
+==============+===============================================+==================================================+
| File         |                                               | ``file:///DIR_PATH``                             |
+--------------+-----------------------------------------------+--------------------------------------------------+
| LevelDB      | ``leveldb``                                   | ``leveldb:///DIR_PATH``                          |
+--------------+-----------------------------------------------+--------------------------------------------------+
| Local memory |                                               | ``locmem://``                                    |
+--------------+-----------------------------------------------+--------------------------------------------------+
| Memcached    | ``python-memcached`` or ``python3-memcached`` | ``memcached://HOST:PORT``                        |
|              | ``pylibmc``                                   | ``pylibmc://HOST:PORT``                          |
+--------------+-----------------------------------------------+--------------------------------------------------+
| Redis        | ``redis`` and ``hiredis``                     | ``redis:///HOST:PORT/DB``                        |
+--------------+-----------------------------------------------+--------------------------------------------------+

To register a custom backend, you can use ``register_backend()``::

    >>> import dache
    >>> dache.register_backend('awesome', 'my.backend.MyAwesomeCache')


