Python libraries to construct classes from a relational database? (ORM in reverse)
Are there any Python object-relational mapping libraries that, given a database schema, can generate a set of Python classes? I know that the major libraries such as SQLObject, SQLAlchemy, and Django's internal SQL ORM library do a very good job of creating a DB schema given a set of classes, but I'm looking for a library that works in reverse.
There is a related question for Perl libraries on Stack Overflow.
Django had an inspectdb command that creates models.py files out of your database.
SQLAlchemy can actually do what you want. You can either define the mappings yourself manually using the mapper facility, or auto-generate them using reflection.
It's not absolutely necessary to build the database using the metadata facility, you can always use an existing one instead.