pehrs
pehrs

Reputation: 1531

Lightweight Object->Database in Python

I am in need of a lightweight way to store dictionaries of data into a database. What I need is something that:

  1. Creates a database table from a simple type description (int, float, datetime etc)
  2. Takes a dictionary object and inserts it into the database (including handling datetime objects!)
  3. If possible: Can handle basic references, so the dictionary can reference other tables

I would prefer something that doesn't do a lot of magic. I just need an easy way to setup and get data into an SQL database.

What would you suggest? There seems to be a lot of ORM software around, but I find it hard to evaluate them.

Upvotes: 1

Views: 1274

Answers (4)

cit
cit

Reputation: 2605

From it's description, perhaps Axiom is a pythonic tool for this .

Upvotes: 1

muckabout
muckabout

Reputation: 1941

SQLAlchemy offers an ORM much like django, but does not require that you work within a web framework.

Upvotes: 3

Ants Aasma
Ants Aasma

Reputation: 54882

SQLAlchemy's SQL expression layer can easily cover the first two requirements. If you also want reference handling then you'll need to use the ORM, but this might fail your lightweight requirement depending on your definition of lightweight.

Upvotes: 4

user257111
user257111

Reputation:

Seeing as you have mentioned sql, python and orm in your tags, are you looking for Django? Of all the web frameworks I've tried, I like this one the best. You'd be looking at models, specifically. This could be too fancy for your needs, perhaps, but that shouldn't stop you looking at the code of Django itself and learning from it.

Upvotes: 0

Related Questions