Skip to main content

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

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.

Release history Release notifications | RSS feed

This release

1.7.0 This release

1 file

1.6.4

1 file

1.6.3

1 file

1.6.2

1 file

1.6.1

1 file

1.6.0

1 file

1.5.1

1 file

1.5.0

1 file

1.4.1

1 file

1.4.0

1 file

1.3.0

1 file

1.2.2

1 file

1.2.1

1 file

1.2.0

1 file

1.1.1

1 file

1.1.0

1 file

1.0.3

1 file

1.0.2

1 file

1.0.1

1 file

1.0.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page