Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

Journaling dbm

Project description

Journaling dbm

Allowed backends

  • ‘memory’ (mostly for tests)
  • ‘tc’ (tokyo cabinet)

Usage

>>> from jdbm import jdbm
>>> db = jdbm('tc', filename='var/readme-test.tc',
...     journal_filename='var/readme-test.journal.tc')

Standard operations:

>>> db.put('a', 'foo')
>>> db.put('b', 'bar')
>>> db.get('a')
'foo'
>>> set(k for k in db)
set(['a', 'b'])
>>> db.exists('a')
True
>>> db.delete('a')
>>> db.length()
1

Restore db from journal:

>>> db.clear(journaling=False)
>>> db.length()
0
>>> db.restore_from_journal()
>>> db.length()
1

Project details


Release history Release notifications

This version
History Node

1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
jdbm-1.0.tar.gz (2.8 kB) Copy SHA256 hash SHA256 Source None Jan 20, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page