A micro python orm for mysql and sqlite3. (Original named CURD.py
).
Latest version: v0.9.1
Development status: 4 - Beta
>>> from models import User
>>> user = User(name='Tom', email='[email protected]')
>>> user.save() # insert
1
>>> user.email = '[email protected]'
>>> user.save() # update
1
>>> [user.name for user in User.select()] # select
[u'Tom']
>>> query = User.where(name='Tom').delete()
>>> query.execute() # delete
1
>>> user = User.create(name='Kate', email='[email protected]') # another insert
>>> user
{'email': '[email protected]', 'name': 'Kate', 'id': 2}
>>> user.destroy() # another delete
1
More examples: sample/, snippets
-
Python >= 2.6 or >= 3.3
-
For mysql users: MySQLdb(MySQL-python) or PyMySQL
$ pip install skylark
Documentation: http://skylark.readthedocs.org/
Strongly recommend that you read Quick Start at first.
NOTE: skylark is not currently threading safe.
- A simple message board built with skylark and Flask: examples/messageboard
https://github.com/hit9/skylark/graphs/contributors
Many ideas are inspired by peewee, thanks a lot to @coleifer. (#34)
CHANGES](CHANGES)