eliangcs / dache

A Python library that provides a unified cache API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dache

image

image

image

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 pylibmc memcached://HOST:PORT 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')

About

A Python library that provides a unified cache API

License:Other


Languages

Language:Python 100.0%