Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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
Release History

Release History

This version
History Node

3.2.0

History Node

3.1.0

History Node

3.0.0

History Node

2.1.1

History Node

2.1.0

History Node

2.0.0

History Node

1.1.0

History Node

1.0.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
sqlite_dbm-3.2.0.tar.gz (2.9 kB) Copy SHA256 Checksum SHA256 Source Aug 15, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting