OnroerendErfgoed / dcextensions

A library of dogpile.cache extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extensions for dogpile.cache

This library provides extensions for dogpile.cache. For the time being only one extension is provided, a memory backend that can be limited in size (number of items to cache).

https://badge.fury.io/py/dcextensions.png https://travis-ci.org/OnroerendErfgoed/dcextensions.svg?branch=master https://coveralls.io/repos/OnroerendErfgoed/dcextensions/badge.png?branch=master

Installation

To install dcextensions, use pip

pip install dcextensions

Usage

To use the memory backend

from dogpile.cache import make_region

region = make_region().configure(
    'dogpile.cache.memory.limited',
    expiration_time = 3600,
    arguments = {
        'cache_size': 100,
        'cache_dict': my_dict
    }
)

Both arguments are optional. When use my_dict must be an instance of OrderedDict.

About

A library of dogpile.cache extensions

License:Other


Languages

Language:Python 100.0%