ORM that uses __slots__ (for memory saving) and plain DBAPI2 connections
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: https://github.com/abe-winter/metamod.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.