Skip to main content

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


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.1.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

auto_crud_param-0.2.1-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

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