Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Object wrapper for dbms

Project description


$ pip install odbm


>>> from datetime import datetime
>>> import odbm

>>> class User(odbm.Model):
...     username = odbm.UnicodeProperty(primary_key=True)
...     friends  = odbm.Property(default=[], key='f')
...     created  = odbm.DateTimeProperty(key='c')
...     __backend__ = staticmethod(lambda: dict())

>>> User(
...     username = 'foo',
...     friends  = ['bar', 'baz'],
...     created =,
... ).save()
>>> User(username='bar', created =
>>> User(username='baz', created =

>>> User.get('foo').friends
['bar', 'baz']

>>> [u.username for u in User.find(
...     filter  = lambda u: not u.friends,
...     order   = lambda x: x.created)]
[u'bar', u'baz']

>>> User.count()
>>> User.count(lambda u: 'baz' in u.friends)
>>> User.find_one().delete()
>>> User.count()

Project details

Download files

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

Files for odbm, version 0.5.6
Filename, size File type Python version Upload date Hashes
Filename, size odbm-0.5.6.tar.gz (5.0 kB) File type Source Python version None Upload date Hashes View hashes

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