Skip to content
Simple, flexible and testable active-record powered by SQLAlchemy - supports seamless encryption of fields through PyNaCL
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
chemist
docs
examples
tests
.coveragerc
.flake8
.gitignore
.release
.travis.yml
MANIFEST.in
Makefile
Pipfile
README.rst
development.txt
requirements.txt
setup.cfg
setup.py

README.rst

Chemist

A simple, flexible and testable active-record powered by SQLAlchemy.

Documentation Status https://travis-ci.org/gabrielfalcao/chemist.svg?branch=master

Install

pip install chemist

Documentation

chemist.readthedocs.io

Basic Usage

from chemist import (
    Model, db, MetaData,
    get_or_create_engine,
)

metadata = MetaData()
engine = get_or_create_engine('sqlite:///example.db')

class BlogPost(Model):
      table = db.Table('blog_post',metadata,
          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

  1. flask app
You can’t perform that action at this time.