SQLObject is a popular and open source ORM (Object Relational Manager) that can be used as an object interface to a database, with tables as classes, columns as attributes and rows as instances.
Example
>>> from sqlobject import *
>>>
>>> sqlhub.processConnection = connectionForURI('sqlite:/:memory:')
>>>
>>> class Person(SQLObject):
... fname = StringCol()
... mi = StringCol(length=1, default=None)
... lname = StringCol()
...
>>> Person.createTable()
Here's how you would use the object:
>>> p = Person(fname="John", lname="Doe")
>>> p
>>> p.fname
'John'
>>> p.mi = 'Q'
>>> p2 = Person.get(1)
>>> p2
>>> p is p2
True
Product's homepage
Requirements:
· Python
What's New in This Release: [ read full changelog ]
· PostgresConnection was optimized.
· SQLObject now uses INSERT...RETURNING id to get the autoincremented ID in one query instead of two (INSERT + SELECT id) (PostgreSQL 8.2 required).
· SQLObject now generates NCHAR/NVARCHAR and N''-quoted strings for MS SQL.