views:

59

answers:

2

Hello Friends, I am a PHP developer and recently migrated to Python. In PHP, there are many classes available at for example phpclasses.org which saves a lot of developer's time. I am looking for similar kind of repository for python. I need a database wrapper class for accessing the database with python. One of the class i found was at http://www.devx.com/dbzone/Article/22093 . But i didnt find any other similar class. So i m wondering no one in this world has created such kind of classes. Is there any better approach to access database in Python. Am i on the wrong track? I m aware of the ORM and its advantage but for small projects it doesnt make sense to me to use ORM's. Can anyone suggest some suitable python database wrapper class.

Thanks in advance.

+3  A: 

Following Skurmedel's advice, I remembered reading about SQLAlchemy before. It's pretty well documented and maintained. Here's a good start point http://www.sqlalchemy.org/docs/ormtutorial.html#connecting

Tudorizer
thanks for the suggestion.
thesensemakers
+1  A: 

Most databases you choose to use will have a module available that conforms to the DBAPI. That gives you access that is quite easy to use and reasonably portable across different types of database (though not entirely). You can see an example of the API in action with the built-in SQLite support.

If you'll reconsider your opposition to ORMs however, as well as SQLAlchemy mentioned in another answer, SQLObject is another ORM, and is very simple to use. There's also Storm.

Kylotan
thanks for the suggestion.
thesensemakers