An open API service indexing awesome lists of open source software.

https://github.com/gabrielfalcao/chemist

Simple, flexible and testable active-record powered by SQLAlchemy - supports seamless encryption of fields through PyNaCL
https://github.com/gabrielfalcao/chemist

active-record flask functional-testing mysql mysql-orm postgresql psycopg2 python sql sqlalchemy unit-testing

Last synced: 4 months ago
JSON representation

Simple, flexible and testable active-record powered by SQLAlchemy - supports seamless encryption of fields through PyNaCL

Awesome Lists containing this project

README

        

.. Flask Chemist documentation master file, created by
sphinx-quickstart on Sun Nov 19 22:16:39 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Chemist
=======

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

.. image:: https://readthedocs.org/projects/chemist/badge/?version=latest
:target: http://chemist.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://travis-ci.org/gabrielfalcao/chemist.svg?branch=master
:target: https://travis-ci.org/gabrielfalcao/chemist
.. |PyPI python versions| image:: https://img.shields.io/pypi/pyversions/chemist.svg
:target: https://pypi.python.org/pypi/chemist
.. |Join the chat at https://gitter.im/gabrielfalcao/chemist| image:: https://badges.gitter.im/gabrielfalcao/chemist.svg
:target: https://gitter.im/gabrielfalcao/chemist?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

Install
-------

.. code:: bash

pip install chemist

Documentation
-------------

`chemist.readthedocs.io `_

Basic Usage
-----------

.. code:: python

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
--------

1. `flask app `_