1.7.0
Project description
A simple, flexible and testable active-record powered by SQLAlchemy.
Install
pip install chemist
Documentation
Basic Usage
from chemist import (
Model, db, DefaultTable
set_default_uri,
)
engine = set_default_uri('sqlite:///example.db')
class BlogPost(Model):
table = DefaultTable('blog_post'
db.Column('id', db.Integer, primary_key=True),
db.Column('title', db.Unicode(200), nullable=False),
db.Column('content', db.UnicodeText, nullable=False),
)
post1 = BlogPost.create(title='Hello World', content='\n'.join([
'Introduction...',
'Supporting Theory 1...',
'Supporting Theory 2...',
'Supporting Theory 3...',
'Conclusion',
]))
for post in BlogPost.all():
print(post.title, post.id)
Examples
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
chemist-1.7.0.tar.gz
(12.5 kB
view details)
File details
Details for the file chemist-1.7.0.tar.gz.
File metadata
- Download URL: chemist-1.7.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c997e06ef540804364ae9c05c3b4bccb3895076613b750882561ccead15c7cd6
|
|
| MD5 |
d5fb5df20e95f5e4eb015a9080be0bd6
|
|
| BLAKE2b-256 |
36e19f0a774ff73828064a66aadf5b1336d389dfdb1bea1609f79a613a731f5c
|