Skip to main content

A light weight python ORM without models.

Project description

https://img.shields.io/pypi/v/lorm.svg

Lorm is a light weight ORM library for Python, model-less, Django style lookup expressions. It’s suitable for small standalone database script.

Installation

The last stable release is available on PyPI and can be installed with pip:

$ pip install lorm

Example

CREATE TABLE `pets` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL DEFAULT '',
  `add_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
>>> c = lorm.mysql_connect('localhost', 3306, 'root', 'root', 'test')
>>> id = c.pets.create(name='cat')
1
>>> c.pets.get(id=id)
{u'id': 2, u'name': u'cat'}
>>> c.last_query
select * from pets where id=1 limit 1

For more examples, see test.py and source code.

Features

  • No Model, use table name directly.

  • Auto reconnect

  • Connection pool

  • Django style lookup expressions

  • Threading safe

Requirements

  • pymysql

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

lorm-0.2.11.zip (9.5 kB view details)

Uploaded Source

Built Distribution

lorm-0.2.11.win32.msi (196.6 kB view details)

Uploaded Source

File details

Details for the file lorm-0.2.11.zip.

File metadata

  • Download URL: lorm-0.2.11.zip
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lorm-0.2.11.zip
Algorithm Hash digest
SHA256 899e2372c8816960af0f87c2791bc55b3d936a9019a81b66ff4c5c40daae9063
MD5 185eaed0b46017b2e9a7c9267d9eb2c5
BLAKE2b-256 332533d4822730358fd045fa6b293e2cb544b2e638736dc53ff9b653d9d2bc24

See more details on using hashes here.

File details

Details for the file lorm-0.2.11.win32.msi.

File metadata

  • Download URL: lorm-0.2.11.win32.msi
  • Upload date:
  • Size: 196.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lorm-0.2.11.win32.msi
Algorithm Hash digest
SHA256 aa25d1bc0b257c9ecc4c7bcf2b37a61b76962bb4a648fbfdb7cef08dbe639659
MD5 0ac351a3ef43ef5364299fa3305c9969
BLAKE2b-256 bb7faaae8e9b1c261d47d08f89146bdb4f8fd0ad12a0bdbb8d1564440fbc4c73

See more details on using hashes here.

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