A Python package for calvincTools. This is the client-server version, not the standalone version.
You can install the package using pip:
pip install calvincToolsOr install from source:
git clone https://github.com/yourusername/calvincTools.git
cd calvincTools
pip install -e .import calvincTools
# Add usage examples here- Feature 1
- Feature 2
- Feature 3
calvincTools.models.init_cDatabase(...) supports adapting to legacy schemas in two ways:
-
Table name only differs
- Use
cTools_tablenames. - Keys:
menuGroups,menuItems,cParameters,cGreetings,User.
- Use
-
Columns/types differ
- Use
cTools_modelswith caller-provided SQLAlchemy models for one or more keys.
- Use
cTools_tablenames = {
'menuGroups': 'cMenu_menugroups',
'User': 'WICS4_users',
}
cTools_models = {
'menuItems': WICS3_menuItems,
'cParameters': WICS3_cParameters,
}
calvincTools_init(
app,
app_db,
cTools_tablenames=cTools_tablenames,
cTools_models=cTools_models,
)If a caller-provided model uses relationship(...), ensure the target class resolves in the same SQLAlchemy registry as that model. String targets such as 'menuGroups' can fail when the target class is dynamically created in a different registry.
Recommended options for caller-provided legacy models:
- Omit cross-registry relationships and let
init_cDatabaseattach compatible links. - Or use class-object targets only when both models are guaranteed to be in the same registry.
To install the package with development dependencies:
pip install -e ".[dev]"Run tests:
pytestFormat code:
black .Lint code:
flake8 calvincToolsContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Calvin C - calvinc404@gmail.com
- Initial release