Skip to main content

dictature -- A generic wrapper around dict-like interface with mulitple backends

Project description

SQLiDictature

A wrapper for Python's dictionary with multiple backends.

Installation

pip install dictature

Dictature usage

This package also includes a class that allows you to use your SQLite db as a Python dictionary:

from dictature import Dictature
from dictature.backend import DictatureBackendDirectory, DictatureBackendSQLite

# will use/create the db directory
# dictionary = Dictature(DictatureBackendDirectory('test_data'))
# will use/create the db file
dictionary = Dictature(DictatureBackendSQLite('test_data.sqlite3'))

# will create a table db_test and there a row called foo with value bar
dictionary['test']['foo'] = 'bar'

# also support anything that can be jsonized
dictionary['test']['list'] = ['1', 2, True]
print(dictionary['test']['list'])  # prints ['1', 2, True]

# or anything, really (that can be serialized with pickle)
from threading import Thread
dictionary['test']['thread'] = Thread
print(dictionary['test']['thread'])  # prints <class 'threading.Thread'>

# and deleting
del dictionary['test']['list']  # deletes the record
del dictionary['test']  # drops whole table

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

dictature-0.9.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dictature-0.9.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file dictature-0.9.0.tar.gz.

File metadata

  • Download URL: dictature-0.9.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dictature-0.9.0.tar.gz
Algorithm Hash digest
SHA256 6c36f4e7f4ae776b48b6ec453ddbc4c82937d2852e3dede8aca7524b0e7c2a77
MD5 c275cc1b836ed68fc80c071d1374c734
BLAKE2b-256 5744245c6aa3aa28f01aeed478bc3efb3d1f7b1fece74eda5c817885951795e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for dictature-0.9.0.tar.gz:

Publisher: pypi-deploy.yml on esoadamo/dictature

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dictature-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: dictature-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dictature-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b881466042952e32381e69241312fcf331cb452d667be361b0f0892e09dd6550
MD5 0f76e9084a36904ac994bf9a86965a43
BLAKE2b-256 ef910ef492c1a11e775e94a92c09d6138c28791e7fcff85955dbbe2ec4b4c2cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for dictature-0.9.0-py3-none-any.whl:

Publisher: pypi-deploy.yml on esoadamo/dictature

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page