Simple dict-like class for TinyDB
Project description
tinydb-config
Simple dict-like class for TinyDB
Usage
from tinydb import TinyDB
from tinydb.storages import MemoryStorage
from tinydb_dict import TinyDBDict
# Pass any TinyDB argument to TinyDBDict
config = TinyDBDict('db.json')
config = TinyDBDict(storage=MemoryStorage)
# Then use it as a dictionary
config['key'] = 1
config['key'] # 1
config['key'] = 2
config['key'] # 2
config['unknown_key'] # KeyError: 'unknown_key'
# You can also pass a TinyDB instance
db = TinyDB('db.json')
config = TinyDBDict(tinydb=db)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tinydb-dict-0.1.1.tar.gz
(1.9 kB
view hashes)
Built Distribution
Close
Hashes for tinydb_dict-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6f3f94153ab959f07e775af6dcb7de7d72ba9dc83e2dd97b5ac2353037ce0ca |
|
MD5 | 61c0fa73d7d5ffe0a11d3deff5275090 |
|
BLAKE2b-256 | 24d502457e117a50a72eca2a51f9aa42f425b284c5c93ad1add0021440ce39d0 |