Python Data abstraction layer (ORM)
Project description
DStore (DataStore) is a Python Object Relational Mapper (ORM) that allows easy description of data models.
Installing
PyMan is available from the PyPi repository.
This means that all you have to do to install PyMan is run the following in a console:
$ pip install dstore
Minimal Example
from dstore import MemoryStore, Model, var, mod
class Car( Model ):
_namespace = "cars.make"
_vars = [
var.RowID,
var.String( "manufacturer", 32, mods = [ mod.NotNull() ] ),
var.String( "make", 32, mods = [ mod.NotNull() ] ),
var.Number( "year", mods = [ mod.NotNull(), mod.Min( 1950 ), mod.Max( 2017 ) ] ),
]
# Create the MemoryStore instance, and add Models to it
store = MemoryStore( [ Car ] )
store.init_app()
store.connect()
store.create_all()
# Destroy all instances and shut down the application
store.destroy_all()
store.disconnect()
store.destroy_app()
Documentation: ReadTheDocs
Source Code: GitHub
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
DStore-0.1.0a1.tar.gz
(7.5 kB
view hashes)
Built Distribution
Close
Hashes for DStore-0.1.0a1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66c81ac2ead1175c601b36c3663bf7335b7c3f0fef4ca42f158f1412fd8bac82 |
|
MD5 | 02c50d87e17a7664c5b0f453b86d6191 |
|
BLAKE2b-256 | c8a1570f541a639dfb5ec1a4db2be62aab69c0ff4086a4ade41d0bb74b07aa68 |