export_schemas¶
src.models.export_schemas
¶
Export JSON Schema files from Pydantic models.
Generates one .schema.json file per model, matching the layout in the
data-schemas repository. Run this after modifying any model in
src/models/ to keep schemas in sync.
Usage
python -m src.models.export_schemas --output_dir ../data-schemas/schemas
export_all(output_dir: str) -> list[str]
¶
Export all registered schemas. Returns list of written file paths.
Source code in src/models/export_schemas.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
tag_schema_repo(schema_repo: str | Path) -> str | None
¶
Create a git tag v{SCHEMA_VERSION} in the data-schemas repo.
If the tag already exists the function is a no-op. Returns the tag
name on success, None when the tag was already present.
Source code in src/models/export_schemas.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |