Skip to main content

ORM that uses __slots__ (for memory saving), plain DBAPI2 connections (to not break threading) and assumes the user knows SQL

Project description

overview

metamod stands for ‘metaclass models’.

  • lightweight ORM (about 200 lines)

  • uses python’s __slots__ so instances are lightweight and classes are self-documenting

vs other ORMs

The goal here is to be a thin layer on SQL. We want to wrap simple, well-understood and often-repeated actions like:

  • create table

  • insert

  • simple select statements (where field=value)

Database writes are emitted as raw SQL that you can pass to a cursor. Database reads operate on a cursor (but not on a connection; you manage your connections yourself).

We don’t want to:

  • generate complex SQL statements, especially for joins

  • provide any type conversions (adapt / mogrify); we’ll trust psycopg2 or pymysql for that

  • normalize behavior across different DBs

  • hide connections & pooling behind classes

See github page for examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metamod-0.0.2.tar.gz (5.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page