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 Distribution

LazyDB-0.1.80.tar.gz (7.1 kB view details)

Uploaded Source

File details

Details for the file LazyDB-0.1.80.tar.gz.

File metadata

  • Download URL: LazyDB-0.1.80.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for LazyDB-0.1.80.tar.gz
Algorithm Hash digest
SHA256 19d6bd761fe2c5c6410a8fd3ec6c85d6cd55be3a4fc95103aa87f8c10de0a4eb
MD5 5390581a4f3002e3feabec2a6093d197
BLAKE2b-256 3676c4b6e7f82be90cb2311e6fc0280b04cacb63e39ff15635b38cb4de84ad1d

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