Saturday, November 26, 2005

PAT, Python's Easy Tables

I started to get a little tired with SQLObject. Although it is nice for most uses, it can be overkill and can be difficult when you dont actually want an ORM, but just a better way than writing all of your own queries. So, I looked around, couldn't find a simple table wrapping module, and wrote my own. The result is Pat, which stands for "Python's Easy Tables".

Pat is very easy to use, but still pretty rough around the edges. It is very much a prototype, but as they say, "Release Early, Release Often", so I'm doing that. I've registered the project at the cheeseshop.

What it Doesn't Do:
  • Create tables
  • Verify integrity
  • Bake cookies like Grandma makes
  • A lot of things
What it Does Do:
  • Represent named tables with python objects
  • Allow you to table.where(id=5) to select rows
  • Allow you to T.where(id=1).update(name="One")
  • You can string multiple where calls and end with an update and only trigger a single query, as all the where clauses are combined. No query is done on a select until you actually iterate over the returned Results object.
Project Page
Pat 0.1 (source)

Please, send me any bug reports, comments, complaints, etc.

No comments: