Skip to main content

Dict-style DBM based on sqlite3.

Project description

Dict-style DBM based on sqlite3.

>>> import sqlite_dbm
>>> db = sqlite_dbm.open(':memory:')
>>> db['foo'] = ['bar', {'baz': 1}]
>>> db['foo']
['bar', {'baz': 1}]
>>> del db['foo']
>>> len(db)
0
>>> db.close()

Fast insert:

>>> db = sqlite_dbm.open(':memory:', auto_commit=False)
>>> for i in range(1000):
...     db[str(i)] = 'foo'
>>> db.commit()
>>> len(db)
1000
>>> db.clear()
>>> db.close()

sqlite_dbm.open options

  • filename - first required argument

  • auto_commit=True - auto commit after each db update

  • dumper=’pickle’ - one of ‘pickle’, ‘json’ or ‘marshal’ or ‘str’

  • compress_level=9 - if set it to 0, compression will be disabled

  • smart_compress=True - compress only if compressed size less than raw

  • pickle_protocol=2 - see pickle docs

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

sqlite_dbm-3.2.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

sqlite_dbm-3.2.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file sqlite_dbm-3.2.1.tar.gz.

File metadata

  • Download URL: sqlite_dbm-3.2.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for sqlite_dbm-3.2.1.tar.gz
Algorithm Hash digest
SHA256 9d7e57615d3bf89d9704c28f1688ebb2a6a0fa3935e1aee1652bb5965dbde54f
MD5 8611de0761562c8824ae70b49085dfd5
BLAKE2b-256 32b96413e05d117e4643150e4f0d60fbbc280bcc4e73d41829e61f55037de441

See more details on using hashes here.

File details

Details for the file sqlite_dbm-3.2.1-py3-none-any.whl.

File metadata

  • Download URL: sqlite_dbm-3.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for sqlite_dbm-3.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e152fe1a56e12140edca470a440c92f137e8346efdf3f2afe0f21eeed1f6565
MD5 8e5e061289af224071e6d27063f8e5e3
BLAKE2b-256 4e5291ca03fce8f08475eccc8d55e4303359c253b4010411e664f19d2fed1076

See more details on using hashes here.

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