Skip to main content

1.7.0

Project description

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

Project details


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)

Uploaded Source

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

Hashes for chemist-1.7.0.tar.gz
Algorithm Hash digest
SHA256 c997e06ef540804364ae9c05c3b4bccb3895076613b750882561ccead15c7cd6
MD5 d5fb5df20e95f5e4eb015a9080be0bd6
BLAKE2b-256 36e19f0a774ff73828064a66aadf5b1336d389dfdb1bea1609f79a613a731f5c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page