CURD.py

CURD - Tiny Python ORM for MySQL

Release: v0.5.0 - Beta (Installation)

Tests status:

https://travis-ci.org/hit9/CURD.py.png?branch=master

CURD.py is a tiny orm for mysql database, written in Python.

Sample

>>> from models import User
>>> user = User(name='Tom', email='tom@gmail.com')
>>> user.save()  # insert
1L
>>> user.email = 'tom@github.com'
>>> user.save()  # update
1L
>>> [user.name for user in User.select()]  # select
[u'Tom']
>>> query = User.where(name='Tom').delete()
>>> query.execute()  # delete
1L
>>> user = User.create(name='Kate', email='kate@gmail.com')  # another insert
>>> user.data
{'email': 'kate@gmail.com', 'name': 'Kate', 'id': 2L}
>>> user.destroy()  # another delete
1L

More sample codes here.

Installation

$ pip install CURD.py

Supports

CURD.py only supports 4 types of queries: C, U, R, D, responsing to its name.

Plat

Python2 (2.6+), OS Independent

Documentaion

***
Fork me on GitHub