Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1000 Bytes

README.md

File metadata and controls

49 lines (33 loc) · 1000 Bytes

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