Skip to content

Repository files navigation

tinydb-smartcache

Build StatusCoverageVersion

tinydb-smartcache provides a smart query cache for TinyDB. It updates the query cache when inserting/removing/updating elements so the cache doesn't get invalidated. It's useful if you perform lots of queries while the data changes only a little.

Installation

$ pip install tinydb_smartcache

Usage

>>>fromtinydbimportTinyDB>>>fromtinydb_smartcacheimportSmartCacheTable>>>db=TinyDB('db.json')
>>>db.table_class=SmartCacheTable>>>db.table('foo')
>>># foo will now use the smart query cache

If you want to enable TinyDB for all databases in a session, run:

>>>fromtinydbimportTinyDB>>>fromtinydb_smartcacheimportSmartCacheTable>>>TinyDB.table_class=SmartCacheTable>>># All databases/tables will now use the smart query cache

Changelog

v1.0.2 (2015-11-17)

  • Account for changes in TinyDB 3.0

v1.0.1 (2015-11-17)

  • Fix installation via pip

v1.0.0 (2015-09-17)

  • Initial release on PyPI

About

A smarter cache for TinyDB

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages