views:

122

answers:

1

is there an activerecord (any similar SQL-wrapper) for python? which is good for:

  • used in a server-side python script
  • light-weight
  • supports MySQL

what I need to do:

  • insert (filename, file size, file md5, the file itself) into (string, int, string, BLOB) columns
  • if the same file (checksum + filename) does not exist in db

thx

+1  A: 

You might consider SQLAlchemy along with Elixir:

Elixir is a declarative layer on top of the SQLAlchemy library. It is a fairly thin wrapper, which provides the ability to create simple Python classes that map directly to relational database tables (this pattern is often referred to as the Active Record design pattern), providing many of the benefits of traditional databases without losing the convenience of Python objects.

ars