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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file tinydb-smartcache-2.0.0.tar.gz.

File metadata

  • Download URL: tinydb-smartcache-2.0.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.3.0-1034-azure

File hashes

Hashes for tinydb-smartcache-2.0.0.tar.gz
Algorithm Hash digest
SHA256 a1f6034d8fe28a72810fdbef46a0547949cbf7e9b43a69343dc0e1adfb47f04a
MD5 f74719985032e73e9fec47a91bd5fe04
BLAKE2b-256 c36d5fd031f52892f834856a1f019d7c15a5981b82385427a5e164da3711b946

See more details on using hashes here.

File details

Details for the file tinydb_smartcache-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: tinydb_smartcache-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.3.0-1034-azure

File hashes

Hashes for tinydb_smartcache-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c162fe6c558bb73ff1e6b33b168807ea87063e47e2b85cb9e84c12d4354aa7c8
MD5 ea3a91c349d6cb7ca672c47af5c53a76
BLAKE2b-256 08c42190b0c9a5ed5f9791df94ccc4596982bad46842356af67144597d65db06

See more details on using hashes here.

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