Auto Create Retrieve Update Delete ORM Functionality for Param models using SQL alchemy.
Project description
auto_crud_param
Auto Create Retrieve Update Delete ORM Functionality for Param models using SQL alchemy.
Installation:
Install with pip:
pip install auto-crud-param
Example Usage:
import param as pm
from sqlalchemy import create_engine
from sqlalchemy.orm import declarative_base, sessionmaker
from auto_crud_param import parameterized_to_model
Base = declarative_base()
# Example usage
class A(pm.Parameterized):
name = pm.String(default='Item A')
value = pm.Number(default=0)
AModel = parameterized_to_model(A, Base)
# Set up the database (for example, using SQLite)
engine = create_engine('sqlite:///mydatabase.db')
Base.metadata.create_all(engine)
Session = sessionmaker(bind=engine)
Development
To run the package locally you need python, git, and poetry.
git clone git@github.com:longtailfinancial/auto_crud_param.git
cd git@github.com:longtailfinancial/auto_crud_param.git
poetry install
poetry shell
python example.py
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
auto_crud_param-0.2.0.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for auto_crud_param-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6cb9b99f1b5fa1dfe1f851c460e4f5240686b51a585dfdb4f3a950715199d59 |
|
MD5 | f909e2597027a45d38d2b37d861f7781 |
|
BLAKE2b-256 | bf8d7a0122e3e60fea4fb135226e2a361039350a2dc6868e8a871c1f5072e507 |