A smarter query cache for TinyDB
Project description
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 little.
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
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-1.0.2.zip
(6.2 kB
view details)
File details
Details for the file tinydb-smartcache-1.0.2.zip
.
File metadata
- Download URL: tinydb-smartcache-1.0.2.zip
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46b3a44dd24fed9956f4a50ca799bc84cff4b3cfe758bcc9552626d12ede96c9 |
|
MD5 | beb8deb7404dadf01154daee0476016d |
|
BLAKE2b-256 | ca2c98735b5e4acdedcfe3bb64b33de80f464d9a059c9f0aced01c53a1197468 |