[ANN] PyDAO - Python Hibernate-like Object-Relational Mapper

cieslak.dariusz at gmail.com cieslak.dariusz at gmail.com
Wed Jun 27 21:06:38 CEST 2007

PyDAO is very thin object-relational mapper similar to Hibernate (but
much simpler). It's created to speed-up application development. It's
very simple, but powerful, based on POPO (Plain Old Python Objects).


Main features:

 - can use any database that has DB-API interface (MySQLdb, psycopg
 - can work without database at all (useful for early phases of
 - speeds up unit testing (dedicated in memory database)

What is not handled:

 - automatic scheme generation
 - separate query language
 - automated handling of associations (replaced by filtering by
   foreign keys)

Here's an example how to use PyDAO:

    class User:
        def __init__(self):
            self.id = None
            self.login = None
            self.password = None

    dao = pydao.InMemoryDao()

    # filling database
    user = User()
    user.login = "user1"
    user.password = "roh8OoPh"

    # filtering based on example
    userSearch = User()
    userSearch.login = "user1"
    userList = dao.list(userSearch)

    # updating
    user.password = "eew8Me8g"


Dariusz Cieslak
http://aplikacja.info - custom software systems

More information about the Python-announce-list mailing list