Skip to main content

Cross platform (fast) DBM interface in python

Project description

Overview

https://secure.travis-ci.org/jamesls/semidbm.png?branch=master https://coveralls.io/repos/jamesls/semidbm/badge.png?branch=master Latest Version Supported Python versions Supported Python implementations License Wheel Status

Semidbm is a fast, pure python implementation of a dbm, which is a persistent key value store. It allows you to get and set keys through a dict interface:

import semidbm
db = semidbm.open('testdb', 'c')
db['foo'] = 'bar'
print db['foo']
db.close()

These values are persisted to disk, and you can later retrieve these key/value pairs:

# Then at a later time:
db = semidbm.open('testdb', 'r')
# prints "bar"
print db['foo']

It was written with these things in mind:

  • Pure python, supporting python 2.6, 2.7, 3.3, and 3.4.

  • Cross platform, works on Windows, Linux, Mac OS X.

  • Supports CPython, pypy, and jython (versions 2.7-b3 and higher).

  • Simple and Fast (See Benchmarking Semidbm).

Supported Python Versions

Semidbm supports python 2.6, 2.7, 3.3, and 3.4.

Official Docs

Read the semidbm docs for more information and how to use semidbm.

Features

Semidbm originally started off as an improvement over the dumbdbm library in the python standard library. Below are a list of some of the improvements over dumbdbm.

Single Data File

Instead of an index file and a data file, the index and data have been consolidated into a single file. This single data file is always appended to, data written to the file is never modified.

Data File Compaction

Semidbm uses an append only file format. This has the potential to grow to large sizes as space is never reclaimed. Semidbm addresses this by adding a compact() method that will rewrite the data file to a minimal size.

Performance

Semidbm is significantly faster than dumbdbm (keep in mind both are pure python libraries) in just about every way. The documentation shows the results of semidbm vs. other dbms, along with how to run the benchmarking script yourself.

Limitations

  • Not thread safe; can’t be accessed by multiple processes.

  • The entire index must fit in memory. This essentially means that all of the keys must fit in memory.

Post feedback and issues on github issues, or check out the latest changes at the github repo.

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

semidbm-0.5.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

semidbm-0.5.1-py2.py3-none-any.whl (13.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file semidbm-0.5.1.tar.gz.

File metadata

  • Download URL: semidbm-0.5.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for semidbm-0.5.1.tar.gz
Algorithm Hash digest
SHA256 0dd74b5e9276eb5af186ace8b74165acec0c887e746bdae60340be91b99cffaf
MD5 e0e45cf55fb0cfca1da04368619ff116
BLAKE2b-256 8e6c594eb65efd3d69e843fe5c3f9ebf4a9718d675a156f8e5f4be5cedadb89b

See more details on using hashes here.

File details

Details for the file semidbm-0.5.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for semidbm-0.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 add3e644dd6afcce83d1752b34ff80fa4e2b37b4ce6bce3289ad19d6f0bcd6ae
MD5 b8c4d449778db17f1e6ae59cf19dbda3
BLAKE2b-256 d69d44d4d3716844aa51b57123cdb1c7e7fedabcfd38781d58fa95cebbcddaf7

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