What About? What is Mother?

Mother is a python module that hides SQL syntax and gives you a set of intelligent
classes and methods. By `intelligent` we mean that the classes are able to understand autonomously various situations.

Think of Mother as an Object Relational Mapper with strong introspection.

When dealing with ORMs you usually need configuration files, tables, fields and keys declarations, but not with Mother because Mother knows the database structure herself.

Mother currently works with PostgreSQL and SQLite.

Mother is released under the BSD License and is already used in production environments.


Our goal is to develop an intelligent ORM. Therefore Mother is able to handle foreign keys, relations and children automatically, in effect it understands the database structure.

The machine has to do the dirty work.

We accomplish this by using the mothermapper which does all the work we would normally have to do. Models, xml, or other configuration files are gone.

Another goal is that the ORM has to be light, fast and simple. With the ability to be easily extended. So extensions (or plugins) must also be easy to code.

Finally, we don't want to create the Definitive ORM: SQL is a complex language and it's impossible to wrap it without rewriting it: just let the machine do the dirty work, maintaining at the same time a complete database interface.

What About Features?

Mother can:

  • Avoids manual specification of foreign keys and relationships because she knows about the tables relationships and she is able to fill records with the correct values.

  • Methods used to insert children and relations are auto-created and self-adapting.

  • The Mother classes can be declared by the user: it's sufficient to inherit from some Mother class: so, class extensions are very easy to code.

  • An example of an extension is the Triggers function. Using this example one can see how easy it is to write other plugins.

  • Able to handle threaded environments, Mother implements connection pooling. It's possible to choose three types of Pool: Limited, Elastic, Growing.

  • Handle complex transactions transparently. Mother takes care of the details of commit and rollback statements and even nested transactions are not a problem.

  • Debug support through the logger called Speaker which can output to standard out, a log file with rotation capabilities, syslog, and SMTP.

  • Mother is able to cast multiple python types automatically: when inserting a datetime field, for example, there is no need to format: just use a datetime object or a date object. When selecting, a datetime object will be returned. The same applies to numeric types and so on.
  • Fast.