Skip to main content

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


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

Uploaded Source

Built Distribution

tinydb_dict-0.1.2-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

Details for the file tinydb-dict-0.1.2.tar.gz.

File metadata

  • Download URL: tinydb-dict-0.1.2.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.3 Darwin/18.7.0

File hashes

Hashes for tinydb-dict-0.1.2.tar.gz
Algorithm Hash digest
SHA256 209caab60d76de297caea7895d83fe453611914c004505150642077acfa10770
MD5 59a7c23b7596c72f7d8144a674a7f890
BLAKE2b-256 c65c2e055332daffe8f506826f33e4bdb54fce44c144e63b78776c31a4cdf9bb

See more details on using hashes here.

File details

Details for the file tinydb_dict-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tinydb_dict-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.3 Darwin/18.7.0

File hashes

Hashes for tinydb_dict-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04383b94ab7d133e511ae60cbf9972168e1ab19d0bc0bcf038c5944da8a81dd8
MD5 6971541e1bfaaaf8996909539a1fbe5d
BLAKE2b-256 8676bfa6bc12e30ad5a3da9b036ce9a3b0b8c27a3d44f23edb2a8fd9f6eb5d93

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