I find full-blown orm's both restrictive and clumsy for smaller projects. But also i like to use a base layer that allows me to connect to different db's with a unified syntax.<p>The syntax/structure below seems pretty clean (suggestions welcome), and because it doesn't do that much, it seems unlikely to stop working randomly.<p><pre><code> db = notanorm.SqliteDb(":memory:")
db.query("create table foo(bar)")
db.insert("foo", bar=22)
db.select("foo")
db.select("foo", bar=[22,33,44])
</code></pre>
(that last statement is a placeholder-generated IN clause)<p>It's left as an exercise for the reader to structure create statements properly (mysql and sqlite syntax is actually pretty compatible).<p>But realistically, your DBA doesn't want you running create statements from python anyway.<p>Many libs I write wind up being discarded eventually or replaced with something better. This one has stuck around for 4 years now, and seems to be pretty useful.<p>It currently only has mysql/python drivers but writing a new driver is pretty simple.