Skip to main content

LazyDB is a basic wrapper around the Python shelve flatfile dbm module.

Project description

![Build Status](https://travis-ci.org/mekarpeles/lazydb.png)

LazyDB is a basic wrapper around the Python shelve flatfile dbm module. LazyDB provides a couchdb/S3 like layer of abstraction around shelve, allowing convenient access (read and write) to shelve without sacrificing the convenience of writing pickled python objects to disk.

>From the help(shelve) documentation: A “shelf” is a persistent, dictionary-like object. The difference with dbm databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects – anything that the “pickle” module can handle. This includes most class instances, recursive data types, and objects containing lots of shared sub-objects. The keys are ordinary strings.

Disclaimer: I wouldn’t suggest using this module for production projects as I predict it having difficulty scaling. LazyDB is ideal for supporting smaller projects with light data in which the programmer must move quickly and intends to implement an alternate db solution sooner rather than later. The intent is to provide a more elegant interface for utilizing the shelve module, not to create an efficient replacement.

Typical usage often looks like this:

#!/usr/bin/env Python

from lazydb import Db

class LazyUser:
      def __init__(self, name):
          self.name = name

db = Db('/home/user/db')
db.put('user', LazyUser('lazybones'))
u = db.get('user')
u.name

## Contributors

Currently, this project is maintained by Mek.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

LazyDB-0.1.70-py2.py3-none-any.whl (6.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file LazyDB-0.1.70-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for LazyDB-0.1.70-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0ff6f67be15a5341755d4ec4b14fe1669e7ec5004b76f02c72b7a68bf3b2e0b4
MD5 5d10a0a1c1ae2858ea7bde2f8f4009c4
BLAKE2b-256 8175f338f843bb1cfe1251e6037a210da05ce96d788c6dd96162d624d067d54d

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