Structure:
- db-meta/schemas/001_domain.yaml: single YAML domain definition (entities, types, enums)
- templates/: Jinja2 templates for SQLAlchemy models and SQLite DDL
- generator.py: generator that renders the templates for each entity
How to use:
- Install dependencies:
pip install -r requirements.txt - Run the generator:
python generator.py - Check
generated/for the auto-created SQLAlchemy models (undergenerated/python) and SQLite DDL (undergenerated/sql).
-
Install dependencies (preferably in a virtual environment):
pip install -e .[dev]
-
Run the generator pointing to the domain YAML and output directory:
boteco-generate --input db-meta/tables/001_domain.yaml --out generated
The command writes Python models to
generated/pythonand SQL scripts togenerated/sql. -
Run tests:
pytest
db-meta/tables/001_domain.yaml- Source domain definition.src/botecopro_meta/- Generator implementation and Jinja2 templates.templates/- Legacy templates kept for reference.generated/- Output directory when running the generator.tests/- Basic generation tests.