Git Product home page Git Product logo

gabrielfalcao / chemist Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 215 KB

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

Home Page: https://chemist.readthedocs.io

Makefile 4.08% Python 93.80% Shell 2.12%
python sqlalchemy flask active-record unit-testing functional-testing sql postgresql psycopg2 mysql mysql-orm

chemist's Introduction

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

chemist's People

Contributors

gabrielfalcao avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tarliton bellyfat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.