Simple dict-like class for TinyDB
Project description
tinydb-dict
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
db_dict = TinyDBDict('db.json')
db_dict = TinyDBDict(storage=MemoryStorage)
# Then use it as a dictionary
db_dict['key'] = 1
db_dict['key'] # 1
db_dict['key'] = 2
db_dict['key'] # 2
db_dict['unknown_key'] # KeyError: 'unknown_key'
# You can also pass a TinyDB instance
db = TinyDB('db.json')
db_dict = 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.2.tar.gz
(2.0 kB
view hashes)
Built Distribution
Close
Hashes for tinydb_dict-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04383b94ab7d133e511ae60cbf9972168e1ab19d0bc0bcf038c5944da8a81dd8 |
|
MD5 | 6971541e1bfaaaf8996909539a1fbe5d |
|
BLAKE2b-256 | 8676bfa6bc12e30ad5a3da9b036ce9a3b0b8c27a3d44f23edb2a8fd9f6eb5d93 |