[FRPythoneers] Object-relational mapper for Python and MySQL?

Jim Baker jbaker at zyasoft.com
Thu Feb 26 09:50:52 MST 2009


Vince,
I would have to echo Ken here: your best bet will be SQLAlchemy. I'm a fan
of Django for greenfield databases, because it's just so simple to use. (And
that simplicity also makes it easy to adapt to non-RDBMS databases as well.)
But in your case, you need the full functionality of SA.

- Jim

On Wed, Feb 25, 2009 at 5:27 PM, Ken Goodhew <kgoodhew at yahoo.com> wrote:

> Vince,
> My group looked at Django a little, but it seemed better suited to writing
> a web app, that just happens to have a database back-end.
> I would highly recommend SqlAlchemy.  We've been using it heavily for the
> last 7 months with a fairly large Oracle database, and I'm extremely
> impressed.
> It's a bit of a learning curve, but it will do all the things you list
> below, including extracting the data model and joining tables (I haven't
> tried outer_join yet, but it's supported).
> The online docs are good, and there's a good suite of tests and examples
> with the source code but I recommend the O'Reilly book.  The user group is
> active.  I reported a bug, and the maintainer fixed it the same day.
>
> Let me know if you have questions.  I'll be happy to help you get started.
> Good Luck.
>
> Ken Goodhew
> Director of Development
> Boulder Securities.
>
>
>
> ----- Original Message ----
> From: Vince Dean <vdean at ucar.edu>
> To: Front Range Python Users -- General Discussion <
> frpythoneers at lists.community.tummy.com>
> Sent: Wednesday, February 25, 2009 3:13:14 PM
> Subject: [FRPythoneers] Object-relational mapper for Python and MySQL?
>
> I'd appreciate suggestions for Python tools to simplify queries
> against a MySQL database.
>
> I am writing a number of reports in Python against a MySQL
> database, using MySQLdb.  Not surprisingly, I'm writing a
> lot of boilerplate Python and SQL.
>
> I know that there are a number of Python modules to support
> this sort of work (SQLAlchemy, SQLOject, Django, etc.), and
> I'd welcome thoughts on which might be my best fit.  Here is
> our situation.
>
> * I'm doing queries only; the data is maintained by another
> (Java) application.
>
> * Efficiency is not a big issue.  The system has few users
> and the reports are run infrequently.  Ease of development is
> a bigger concern.
>
> * The database already exists; I cannot change column or table
> names to conform to a convention.
>
> * It's not a small database.  We have 123 tables and 770
> columns, but I am writing queries against a relatively small
> fraction of them.
>
> * Queries frequently involve four or more tables.  Some of
> the logic is easily handled by SQL joins; other parts require
> program logic to navigate through the relationships.
>
> * It would be useful, but not essential, if the tool could
> extract some of the data model it needs directly from the
> database schema.
>
> * I just need a tool to help with the database queries and return
> the results to Python, for some pretty simple text reports.
> I'm not building a Web application.
>
> Any thoughts?
>
> Thanks,
> Vince
>
>
> _______________________________________________
> This message sent by the FRPythoneers mailing list.
> Unsubscribe: echo unsubscribe |
> FRPythoneers-request at lists.community.tummy.com
> URL: http://lists.community.tummy.com/mailman/listinfo/frpythoneers
>
>
>
>
> _______________________________________________
> This message sent by the FRPythoneers mailing list.
> Unsubscribe: echo unsubscribe |
> FRPythoneers-request at lists.community.tummy.com
> URL: http://lists.community.tummy.com/mailman/listinfo/frpythoneers
>



-- 
Jim Baker
jbaker at zyasoft.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.community.tummy.com/pipermail/frpythoneers/attachments/20090226/e6266bb9/attachment.html>


More information about the FRPythoneers mailing list