Skip to main content

A smarter query cache for TinyDB

Project description

Build Status Coverage Version

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

>>> from tinydb import TinyDB
>>> from tinydb_smartcache import SmartCacheTable
>>> 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:

>>> from tinydb import TinyDB
>>> from tinydb_smartcache import SmartCacheTable
>>> TinyDB.table_class = SmartCacheTable
>>> # All databases/tables will now use the smart query cache

Changelog

v2.0.0 (2020-08-25)

  • Add support for TinyDB v4. Drops support for TinyDB <= 3 and Python 2.

v1.0.3 (2019-10-26)

  • Make SmartCacheTable work again after breakage with TinyDB v3.12.0

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinydb-smartcache-2.0.0.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

tinydb_smartcache-2.0.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page