model2data 1.12.0__tar.gz → 1.13.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. model2data-1.13.0/PKG-INFO +348 -0
  2. model2data-1.13.0/README.md +443 -0
  3. model2data-1.13.0/README_PYPI.md +301 -0
  4. {model2data-1.12.0 → model2data-1.13.0}/model2data/cli.py +240 -6
  5. {model2data-1.12.0 → model2data-1.13.0}/model2data/guide/triage.md +12 -2
  6. {model2data-1.12.0 → model2data-1.13.0}/model2data/guide/tune.md +29 -1
  7. model2data-1.13.0/model2data/metrics/__init__.py +100 -0
  8. model2data-1.13.0/model2data/metrics/check.py +566 -0
  9. model2data-1.13.0/model2data/metrics/columns.py +66 -0
  10. model2data-1.13.0/model2data/metrics/dbt.py +86 -0
  11. model2data-1.13.0/model2data/metrics/expression.py +209 -0
  12. model2data-1.13.0/model2data/metrics/graph.py +151 -0
  13. model2data-1.13.0/model2data/metrics/infer.py +113 -0
  14. model2data-1.13.0/model2data/metrics/ossie.py +310 -0
  15. model2data-1.13.0/model2data/metrics/reader.py +243 -0
  16. model2data-1.13.0/model2data/metrics/semantic.py +336 -0
  17. model2data-1.13.0/model2data/metrics/sql.py +270 -0
  18. model2data-1.13.0/model2data/metrics/types.py +163 -0
  19. model2data-1.13.0/model2data/metrics/values.py +284 -0
  20. {model2data-1.12.0 → model2data-1.13.0}/model2data/spec/PUBLISHING.md +23 -2
  21. {model2data-1.12.0 → model2data-1.13.0}/model2data/spec/README.md +6 -1
  22. model2data-1.13.0/model2data/spec/examples/coffee_webshop.metrics.yml +58 -0
  23. {model2data-1.12.0 → model2data-1.13.0}/model2data/spec/examples/coffee_webshop.model2data.yml +2 -0
  24. model2data-1.13.0/model2data/spec/metrics/README.md +308 -0
  25. model2data-1.13.0/model2data/spec/metrics/metrics.schema.json +177 -0
  26. model2data-1.13.0/model2data.egg-info/PKG-INFO +348 -0
  27. {model2data-1.12.0 → model2data-1.13.0}/model2data.egg-info/SOURCES.txt +24 -0
  28. {model2data-1.12.0 → model2data-1.13.0}/pyproject.toml +2 -2
  29. {model2data-1.12.0 → model2data-1.13.0}/tests/test_determinism.py +16 -0
  30. {model2data-1.12.0 → model2data-1.13.0}/tests/test_guide.py +6 -1
  31. model2data-1.13.0/tests/test_metrics_cli.py +316 -0
  32. model2data-1.13.0/tests/test_metrics_dbt.py +123 -0
  33. model2data-1.13.0/tests/test_metrics_expression.py +76 -0
  34. model2data-1.13.0/tests/test_metrics_ossie.py +235 -0
  35. model2data-1.13.0/tests/test_metrics_reader.py +753 -0
  36. model2data-1.13.0/tests/test_metrics_semantic.py +441 -0
  37. model2data-1.13.0/tests/test_metrics_spec.py +165 -0
  38. model2data-1.13.0/tests/test_metrics_values.py +286 -0
  39. model2data-1.12.0/PKG-INFO +0 -527
  40. model2data-1.12.0/README.md +0 -758
  41. model2data-1.12.0/README_PYPI.md +0 -480
  42. model2data-1.12.0/model2data.egg-info/PKG-INFO +0 -527
  43. {model2data-1.12.0 → model2data-1.13.0}/LICENSE +0 -0
  44. {model2data-1.12.0 → model2data-1.13.0}/model2data/__init__.py +0 -0
  45. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/__init__.py +0 -0
  46. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/LICENSE +0 -0
  47. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/VENDORED.md +0 -0
  48. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/__init__.py +0 -0
  49. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/__init__.py +0 -0
  50. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/base.py +0 -0
  51. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/column.py +0 -0
  52. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/enum.py +0 -0
  53. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/expression.py +0 -0
  54. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/index.py +0 -0
  55. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/note.py +0 -0
  56. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/project.py +0 -0
  57. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/reference.py +0 -0
  58. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/sticky_note.py +0 -0
  59. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/table.py +0 -0
  60. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/_classes/table_group.py +0 -0
  61. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/classes/__init__.py +0 -0
  62. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/constants.py +0 -0
  63. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/database.py +0 -0
  64. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/__init__.py +0 -0
  65. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/column.py +0 -0
  66. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/common.py +0 -0
  67. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/enum.py +0 -0
  68. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/generic.py +0 -0
  69. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/index.py +0 -0
  70. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/project.py +0 -0
  71. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/records.py +0 -0
  72. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/reference.py +0 -0
  73. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/sticky_note.py +0 -0
  74. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/table.py +0 -0
  75. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/table_group.py +0 -0
  76. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/definitions/table_partial.py +0 -0
  77. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/exceptions.py +0 -0
  78. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/parser/__init__.py +0 -0
  79. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/parser/blueprints.py +0 -0
  80. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/parser/parser.py +0 -0
  81. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/__init__.py +0 -0
  82. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/base.py +0 -0
  83. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/__init__.py +0 -0
  84. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/__init__.py +0 -0
  85. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/column.py +0 -0
  86. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/enum.py +0 -0
  87. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/expression.py +0 -0
  88. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/index.py +0 -0
  89. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/note.py +0 -0
  90. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/project.py +0 -0
  91. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/reference.py +0 -0
  92. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/renderer.py +0 -0
  93. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/sticky_note.py +0 -0
  94. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/table.py +0 -0
  95. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/table_group.py +0 -0
  96. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/dbml/default/utils.py +0 -0
  97. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/__init__.py +0 -0
  98. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/default/__init__.py +0 -0
  99. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/default/column.py +0 -0
  100. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/default/enum.py +0 -0
  101. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/default/expression.py +0 -0
  102. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/default/index.py +0 -0
  103. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/default/note.py +0 -0
  104. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/default/reference.py +0 -0
  105. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/default/renderer.py +0 -0
  106. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/default/table.py +0 -0
  107. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/renderer/sql/default/utils.py +0 -0
  108. {model2data-1.12.0 → model2data-1.13.0}/model2data/_vendor/pydbml/tools.py +0 -0
  109. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/__init__.py +0 -0
  110. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/hint_tests.py +0 -0
  111. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/naming.py +0 -0
  112. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/project.py +0 -0
  113. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/templates/dbt_project.yml.jinja +0 -0
  114. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/templates/hint_macros/model2data_hint_tests.sql +0 -0
  115. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/templates/hint_macros/model2data_when_tests.sql +0 -0
  116. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/templates/history_macros/model2data_history_tests.sql +0 -0
  117. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/templates/macros/generate_schema_name.sql +0 -0
  118. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/templates/profiles.yml.jinja +0 -0
  119. {model2data-1.12.0 → model2data-1.13.0}/model2data/dbt/tests.py +0 -0
  120. {model2data-1.12.0 → model2data-1.13.0}/model2data/defects/__init__.py +0 -0
  121. {model2data-1.12.0 → model2data-1.13.0}/model2data/defects/apply.py +0 -0
  122. {model2data-1.12.0 → model2data-1.13.0}/model2data/defects/checks.py +0 -0
  123. {model2data-1.12.0 → model2data-1.13.0}/model2data/defects/presets.py +0 -0
  124. {model2data-1.12.0 → model2data-1.13.0}/model2data/defects/report.py +0 -0
  125. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/__init__.py +0 -0
  126. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/core.py +0 -0
  127. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/days.py +0 -0
  128. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/faker.py +0 -0
  129. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/hints.py +0 -0
  130. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/history.py +0 -0
  131. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/kinds.py +0 -0
  132. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/options.py +0 -0
  133. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/relationships.py +0 -0
  134. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/timeline.py +0 -0
  135. {model2data-1.12.0 → model2data-1.13.0}/model2data/generate/when.py +0 -0
  136. {model2data-1.12.0 → model2data-1.13.0}/model2data/guide/setup.md +0 -0
  137. {model2data-1.12.0 → model2data-1.13.0}/model2data/model/__init__.py +0 -0
  138. {model2data-1.12.0 → model2data-1.13.0}/model2data/model/_yaml.py +0 -0
  139. {model2data-1.12.0 → model2data-1.13.0}/model2data/model/dbml.py +0 -0
  140. {model2data-1.12.0 → model2data-1.13.0}/model2data/model/document.py +0 -0
  141. {model2data-1.12.0 → model2data-1.13.0}/model2data/model/dump.py +0 -0
  142. {model2data-1.12.0 → model2data-1.13.0}/model2data/model/engine.py +0 -0
  143. {model2data-1.12.0 → model2data-1.13.0}/model2data/model/errors.py +0 -0
  144. {model2data-1.12.0 → model2data-1.13.0}/model2data/model/reader.py +0 -0
  145. {model2data-1.12.0 → model2data-1.13.0}/model2data/model/types.py +0 -0
  146. {model2data-1.12.0 → model2data-1.13.0}/model2data/model/validate.py +0 -0
  147. {model2data-1.12.0 → model2data-1.13.0}/model2data/output.py +0 -0
  148. {model2data-1.12.0 → model2data-1.13.0}/model2data/parse/__init__.py +0 -0
  149. {model2data-1.12.0 → model2data-1.13.0}/model2data/parse/dbml.py +0 -0
  150. {model2data-1.12.0 → model2data-1.13.0}/model2data/spec/model.schema.json +0 -0
  151. {model2data-1.12.0 → model2data-1.13.0}/model2data/utils.py +0 -0
  152. {model2data-1.12.0 → model2data-1.13.0}/model2data.egg-info/dependency_links.txt +0 -0
  153. {model2data-1.12.0 → model2data-1.13.0}/model2data.egg-info/entry_points.txt +0 -0
  154. {model2data-1.12.0 → model2data-1.13.0}/model2data.egg-info/requires.txt +0 -0
  155. {model2data-1.12.0 → model2data-1.13.0}/model2data.egg-info/top_level.txt +0 -0
  156. {model2data-1.12.0 → model2data-1.13.0}/setup.cfg +0 -0
  157. {model2data-1.12.0 → model2data-1.13.0}/tests/test_as_of_anchor.py +0 -0
  158. {model2data-1.12.0 → model2data-1.13.0}/tests/test_cli.py +0 -0
  159. {model2data-1.12.0 → model2data-1.13.0}/tests/test_cli_model.py +0 -0
  160. {model2data-1.12.0 → model2data-1.13.0}/tests/test_column_time_hints.py +0 -0
  161. {model2data-1.12.0 → model2data-1.13.0}/tests/test_coverage_gaps.py +0 -0
  162. {model2data-1.12.0 → model2data-1.13.0}/tests/test_days.py +0 -0
  163. {model2data-1.12.0 → model2data-1.13.0}/tests/test_dbml_parser.py +0 -0
  164. {model2data-1.12.0 → model2data-1.13.0}/tests/test_dbml_parser_fuzz.py +0 -0
  165. {model2data-1.12.0 → model2data-1.13.0}/tests/test_dbt_integration.py +0 -0
  166. {model2data-1.12.0 → model2data-1.13.0}/tests/test_dbt_naming.py +0 -0
  167. {model2data-1.12.0 → model2data-1.13.0}/tests/test_dbt_project.py +0 -0
  168. {model2data-1.12.0 → model2data-1.13.0}/tests/test_dbt_tests.py +0 -0
  169. {model2data-1.12.0 → model2data-1.13.0}/tests/test_defects.py +0 -0
  170. {model2data-1.12.0 → model2data-1.13.0}/tests/test_defects_dbt.py +0 -0
  171. {model2data-1.12.0 → model2data-1.13.0}/tests/test_defects_replay.py +0 -0
  172. {model2data-1.12.0 → model2data-1.13.0}/tests/test_defects_report.py +0 -0
  173. {model2data-1.12.0 → model2data-1.13.0}/tests/test_defects_review.py +0 -0
  174. {model2data-1.12.0 → model2data-1.13.0}/tests/test_distributions.py +0 -0
  175. {model2data-1.12.0 → model2data-1.13.0}/tests/test_examples_model.py +0 -0
  176. {model2data-1.12.0 → model2data-1.13.0}/tests/test_faker_name_inference.py +0 -0
  177. {model2data-1.12.0 → model2data-1.13.0}/tests/test_fast_paths.py +0 -0
  178. {model2data-1.12.0 → model2data-1.13.0}/tests/test_generation.py +0 -0
  179. {model2data-1.12.0 → model2data-1.13.0}/tests/test_hint_tests.py +0 -0
  180. {model2data-1.12.0 → model2data-1.13.0}/tests/test_history.py +0 -0
  181. {model2data-1.12.0 → model2data-1.13.0}/tests/test_issue_lines.py +0 -0
  182. {model2data-1.12.0 → model2data-1.13.0}/tests/test_lone_country.py +0 -0
  183. {model2data-1.12.0 → model2data-1.13.0}/tests/test_model.py +0 -0
  184. {model2data-1.12.0 → model2data-1.13.0}/tests/test_model_dbml.py +0 -0
  185. {model2data-1.12.0 → model2data-1.13.0}/tests/test_model_edges.py +0 -0
  186. {model2data-1.12.0 → model2data-1.13.0}/tests/test_model_messages.py +0 -0
  187. {model2data-1.12.0 → model2data-1.13.0}/tests/test_model_vocabulary.py +0 -0
  188. {model2data-1.12.0 → model2data-1.13.0}/tests/test_options.py +0 -0
  189. {model2data-1.12.0 → model2data-1.13.0}/tests/test_release_stress.py +0 -0
  190. {model2data-1.12.0 → model2data-1.13.0}/tests/test_reproducibility.py +0 -0
  191. {model2data-1.12.0 → model2data-1.13.0}/tests/test_row_identity.py +0 -0
  192. {model2data-1.12.0 → model2data-1.13.0}/tests/test_shaping.py +0 -0
  193. {model2data-1.12.0 → model2data-1.13.0}/tests/test_spec_alignment.py +0 -0
  194. {model2data-1.12.0 → model2data-1.13.0}/tests/test_spec_schema.py +0 -0
  195. {model2data-1.12.0 → model2data-1.13.0}/tests/test_table_seeds.py +0 -0
  196. {model2data-1.12.0 → model2data-1.13.0}/tests/test_timeline.py +0 -0
  197. {model2data-1.12.0 → model2data-1.13.0}/tests/test_when.py +0 -0
@@ -0,0 +1,348 @@
1
+ Metadata-Version: 2.4
2
+ Name: model2data
3
+ Version: 1.13.0
4
+ Summary: Turn a data model into realistic synthetic data, a runnable dbt project and metrics with known values
5
+ Author: JB Analytica
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/JB-Analytica/model2data
8
+ Project-URL: Studio, https://studio.jbanalytica.com
9
+ Project-URL: Repository, https://github.com/JB-Analytica/model2data
10
+ Project-URL: Issues, https://github.com/JB-Analytica/model2data/issues
11
+ Project-URL: Changelog, https://github.com/JB-Analytica/model2data/blob/main/CHANGELOG.md
12
+ Keywords: dbt,dbml,synthetic-data,test-data,analytics-engineering,data-engineering,duckdb,seed-data
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Database
23
+ Classifier: Topic :: Software Development :: Testing
24
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: dbt-core>=1.11
29
+ Requires-Dist: dbt-duckdb>=1.11
30
+ Requires-Dist: faker>=37.12.0
31
+ Requires-Dist: jsonschema>=4.18
32
+ Requires-Dist: pandas>=2.3.3
33
+ Requires-Dist: pyparsing<4,>=3.1
34
+ Requires-Dist: pyyaml>=6.0.3
35
+ Requires-Dist: typer>=0.20.0
36
+ Provides-Extra: postgres
37
+ Requires-Dist: dbt-postgres>=1.11; extra == "postgres"
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest; extra == "dev"
40
+ Requires-Dist: pytest-cov; extra == "dev"
41
+ Requires-Dist: pre-commit; extra == "dev"
42
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
43
+ Requires-Dist: ty>=0.0.4; extra == "dev"
44
+ Requires-Dist: types-pyyaml; extra == "dev"
45
+ Requires-Dist: poethepoet>=0.38.0; extra == "dev"
46
+ Dynamic: license-file
47
+
48
+ # model2data
49
+
50
+ [![PyPI](https://img.shields.io/pypi/v/model2data)](https://pypi.org/project/model2data/)
51
+ [![PyPI downloads](https://img.shields.io/pypi/dm/model2data)](https://pypi.org/project/model2data/)
52
+ [![Python versions](https://img.shields.io/pypi/pyversions/model2data)](https://pypi.org/project/model2data/)
53
+ [![CI](https://github.com/JB-Analytica/model2data/actions/workflows/ci.yml/badge.svg)](https://github.com/JB-Analytica/model2data/actions/workflows/ci.yml)
54
+ [![codecov](https://codecov.io/gh/JB-Analytica/model2data/branch/main/graph/badge.svg)](https://codecov.io/gh/JB-Analytica/model2data)
55
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/JB-Analytica/model2data/blob/main/LICENSE)
56
+
57
+ Built and maintained by [JB Analytica](https://www.jbanalytica.com/) — data platform architecture and analytics engineering.
58
+
59
+ **Turn a data model into a running analytics stack in one command.**
60
+
61
+ Give `model2data` a data model — a `.model2data.yml` file, or a [DBML](https://dbml.dbdiagram.io/docs/)
62
+ schema hand-written or exported from an existing database — and it generates realistic,
63
+ relationship-preserving synthetic data *and* a complete, runnable dbt project around it: seeds,
64
+ staging models, tests, and a DuckDB or Postgres profile. Add a metrics file and it also knows
65
+ what your revenue comes to, and writes a dbt test that proves it. No sample data to hunt down,
66
+ no dbt boilerplate to hand-write, no production data to risk exposing.
67
+
68
+ ![model2data generating a project with metrics and running it with dbt](https://raw.githubusercontent.com/JB-Analytica/model2data/main/assets/demo.gif)
69
+
70
+ ```bash
71
+ pip install model2data
72
+ model2data --file examples/ecommerce.model2data.yml --rows 200 --seed 42 # examples/ is in the GitHub repository
73
+ cd dbt_ecommerce && dbt build
74
+ ```
75
+
76
+ > **Prefer a browser?** [model2data studio](https://studio.jbanalytica.com) is the same
77
+ > engine as a web app: write DBML, watch the entity diagram redraw as you type, see what every
78
+ > column will generate before you generate it, then export CSVs or a runnable dbt project.
79
+ > Nothing to install, free to start.
80
+
81
+ ---
82
+
83
+ ## What you get
84
+
85
+ **Values that look real.** Column names are matched against about 40 common patterns — `email`,
86
+ `first_name`, `city`, `phone`, `company`, ... — so a column called `email` gets real-looking
87
+ emails, not `Lorem ipsum`. Type a column with any Faker provider (`billing_country state`,
88
+ `sku ean13`) to pick its generator outright, and `--locale nl_BE` makes every person and address
89
+ come from one country. → [The model file](https://github.com/JB-Analytica/model2data/blob/main/docs/model-file.md)
90
+
91
+ **Foreign keys that resolve.** Tables are generated in dependency order and every foreign key
92
+ points at a parent row that exists — onto a primary key or a unique one. Composite primary and
93
+ unique keys hold, and a column that repeats a parent's value through a foreign key
94
+ (`orders.customer_email`) holds the email of the order's own customer.
95
+ → [The model file](https://github.com/JB-Analytica/model2data/blob/main/docs/model-file.md)
96
+
97
+ **A dbt project that runs.** Seeds, staging models that `ref()` them, `not_null`, `unique`,
98
+ `relationships` and `accepted_values` tests, data tests written from the model's own hints, and
99
+ a DuckDB (zero-config) or Postgres profile. One `dbt build` loads, builds and tests it, and
100
+ `--unit-tests` adds dbt unit test fixtures. → [The generated dbt project](https://github.com/JB-Analytica/model2data/blob/main/docs/dbt-project.md)
101
+
102
+ **The same files, byte for byte.** The same model, `--seed`, `--as-of` and options give the same
103
+ files on any machine, any day, with the same model2data version — safe to commit as fixtures,
104
+ safe to diff in CI. `--table-seed orders=7` re-rolls one table and leaves every other one
105
+ byte-identical. → [The determinism promise](https://github.com/JB-Analytica/model2data/blob/main/docs/generating.md#the-determinism-promise)
106
+
107
+ **Days after the first.** A table marked `incremental` moves on day by day: `--days 7` or
108
+ `--next` adds new rows and updates existing ones, an enum with `transitions` moves an order from
109
+ `pending` to `shipped`, and each day is written as a batch or a changelog to load incrementally.
110
+ → [Days after the first](https://github.com/JB-Analytica/model2data/blob/main/docs/days.md)
111
+
112
+ **History tables.** `history: true` writes `<table>_history`, every version of every row with
113
+ `valid_from`, `valid_to` and `is_current`: an SCD type 2 source to build snapshots against.
114
+ → [A source that keeps its history](https://github.com/JB-Analytica/model2data/blob/main/docs/history.md)
115
+
116
+ **When things happen.** `--business-hours`, `--growth` and `--seasonality` shape every timestamp
117
+ (weekdays and working hours, a trend, a Q4 peak), or one column at a time. `updated_at` never
118
+ lands before `created_at`, `after` orders any two columns, and `when` gives `shipped_at` a value
119
+ on shipped and delivered orders only. → [When things happen](https://github.com/JB-Analytica/model2data/blob/main/docs/time-shapes.md)
120
+
121
+ **How the data is spread.** `--skew` lets a few customers place most of the orders; `weights`,
122
+ `true_rate`, `null_rate` and `distinct` shape a column; `distribution` draws a number from a
123
+ normal, lognormal or exponential curve. → [How the data is spread](https://github.com/JB-Analytica/model2data/blob/main/docs/distributions.md)
124
+
125
+ **Defects on purpose.** `--defects training` breaks each standard dbt test once, `messy` puts a
126
+ small share of every defect on every table, and a table can list its own: duplicate keys,
127
+ orphans, nulls, invalid values, messy text, late-arriving rows. Every run with defects writes
128
+ `EXPECTED_FAILURES.md`, so a test that does not fire shows. → [Defects on purpose](https://github.com/JB-Analytica/model2data/blob/main/docs/defects.md)
129
+
130
+ **Metrics with known values** (new in 1.13.0). A metrics file beside the model defines revenue,
131
+ orders, average order value. The run writes each metric's value over the generated data to
132
+ `metric_values.json`, overall and per month, a dbt test per metric that must reproduce it on the
133
+ warehouse, and an [Apache Ossie](https://github.com/apache/ossie) semantic model under `osi/`.
134
+ → [Metrics with known values](https://github.com/JB-Analytica/model2data/blob/main/docs/metrics.md)
135
+
136
+ **Validate in CI.** `model2data validate` checks models and metrics files and prints GitHub
137
+ annotations; `uses: JB-Analytica/model2data@v1` fails a pull request that breaks one. A
138
+ pre-commit hook and a GitLab CI snippet do the same. → [Validate models in CI](https://github.com/JB-Analytica/model2data/blob/main/docs/ci.md)
139
+
140
+ **Use it from an agent.** `uvx model2data@latest guide` prints instructions written for a coding
141
+ agent, shipped with the installed version; [LLMS.md](https://github.com/JB-Analytica/model2data/blob/main/LLMS.md) takes an LLM from a plain-English
142
+ description to a running project. → [Agents and LLMs](https://github.com/JB-Analytica/model2data/blob/main/docs/agents.md)
143
+
144
+ **Or in the browser.** [model2data studio](https://studio.jbanalytica.com)
145
+ is the same engine with a DBML editor and a live diagram.
146
+
147
+ ---
148
+
149
+ ## Before and after
150
+
151
+ In: a model (here the `orders` table of
152
+ [`examples/ecommerce.model2data.yml`](https://github.com/JB-Analytica/model2data/blob/main/examples/ecommerce.model2data.yml)) and, optionally, the
153
+ metrics that matter ([`examples/ecommerce.metrics.yml`](https://github.com/JB-Analytica/model2data/blob/main/examples/ecommerce.metrics.yml)):
154
+
155
+ ```yaml
156
+ orders:
157
+ columns:
158
+ id: {type: bigint, pk: true, not_null: true}
159
+ customer_id: {type: bigint, not_null: true, references: customers.id}
160
+ order_date: {type: timestamp, not_null: true}
161
+ total_amount:
162
+ type: numeric
163
+ not_null: true
164
+ generate: {min: 10, max: 5000}
165
+ status: order_status
166
+ ```
167
+
168
+ ```yaml
169
+ metrics:
170
+ revenue:
171
+ label: Revenue
172
+ measure: orders.total_amount
173
+ agg: sum
174
+ where:
175
+ orders.status: [processing, shipped, delivered]
176
+ time: orders.order_date
177
+ format: currency
178
+ orders:
179
+ count: orders
180
+ where:
181
+ orders.status: [processing, shipped, delivered]
182
+ time: orders.order_date
183
+ average_order_value:
184
+ ratio: {numerator: revenue, denominator: orders}
185
+ ```
186
+
187
+ ```bash
188
+ model2data --file examples/ecommerce.model2data.yml --metrics examples/ecommerce.metrics.yml \
189
+ --rows 200 --seed 42 --as-of 2026-01-31
190
+ ```
191
+
192
+ Out: a dbt project.
193
+
194
+ ```
195
+ dbt_ecommerce/
196
+ ├── seeds/raw/ customers.csv, orders.csv, order_items.csv, products.csv,
197
+ │ product_reviews.csv, __seed_config.yml
198
+ ├── models/staging/ stg_<table>.sql + stg_<table>.yml (with tests), for each table
199
+ ├── data-tests/metrics/ metric_revenue.sql, metric_orders.sql,
200
+ │ metric_average_order_value.sql, metric_units_sold.sql
201
+ ├── macros/ generate_schema_name.sql, model2data_hint_tests.sql
202
+ ├── osi/ecommerce.yml the model and its metrics as Apache Ossie 0.1.1
203
+ ├── metric_values.json each metric's known value
204
+ ├── ecommerce.model2data.yml the model, and
205
+ ├── ecommerce.metrics.yml its metrics, copied as given
206
+ ├── dbt_project.yml
207
+ └── profiles.yml DuckDB
208
+ ```
209
+
210
+ `dbt build` loads the seeds, builds the staging models and runs every test, the four metric
211
+ tests included:
212
+
213
+ ```
214
+ Finished running 5 seeds, 49 data tests, 5 view models in 0 hours 0 minutes and 0.71 seconds (0.71s).
215
+
216
+ Completed successfully
217
+
218
+ Done. PASS=59 WARN=0 ERROR=0 SKIP=0 NO-OP=0 REUSED=0 TOTAL=59
219
+ ```
220
+
221
+ And `metric_values.json` says what a dashboard on this data must show:
222
+
223
+ ```json
224
+ {
225
+ "model2data-metrics": "0.1.0",
226
+ "model": "ecommerce",
227
+ "run": {
228
+ "seed": 42,
229
+ "as_of": "2026-01-31"
230
+ },
231
+ "rounding": "counts, and sums, minimums and maximums of integer columns, are exact; every other value is rounded to 6 decimal places, half to even",
232
+ "metrics": {
233
+ "revenue": {
234
+ "kind": "simple",
235
+ "label": "Revenue",
236
+ "value": 220291.8,
237
+ "time": "orders.order_date",
238
+ "by_month": {
239
+ "2025-01": 3967.88,
240
+ "2025-02": 10676.66,
241
+ ...
242
+ "2026-01": 31879.13
243
+ }
244
+ },
245
+ "orders": { "kind": "count", "label": "Orders", "value": 92, ... },
246
+ "average_order_value": { "kind": "ratio", "label": "Average order value", "value": 2394.476087, ... },
247
+ "units_sold": { "kind": "simple", "label": "Units sold", "value": 734, ... }
248
+ }
249
+ }
250
+ ```
251
+
252
+ Run it again tomorrow, or on another machine, with the same model2data version, and every one
253
+ of those files is the same.
254
+
255
+ ---
256
+
257
+ ## Who it's for
258
+
259
+ Analytics engineers hit the same wall constantly: you need realistic data to build or test a
260
+ pipeline, but production data is off-limits (privacy, access, scale), and hand-rolling mock CSVs
261
+ is tedious and doesn't scale past two tables. model2data closes that gap. Nothing but a schema
262
+ definition goes in; nothing but synthetic data comes out.
263
+
264
+ - **A consultant who needs a client demo before source access.** Write the client's model from a
265
+ kick-off call, generate a year of their data, and show a working dbt project and dashboard in
266
+ the first week, without touching production.
267
+ - **An analytics engineer who wants fixtures in CI.** Commit the model, generate with `--seed`
268
+ and `--as-of`, and every CI run builds against the same bytes. `--days` gives an incremental
269
+ model the next day's batch to process.
270
+ - **A trainer who needs data that fails on purpose.** `--defects training` breaks each standard
271
+ dbt test once and says which, so a class sees `unique`, `not_null`, `relationships` and
272
+ `accepted_values` fail for the right reason.
273
+ - **A team defining metrics once.** Write revenue in one metrics file, check every number the
274
+ semantic layer or dashboard shows against `metric_values.json`, let `dbt build` prove the SQL,
275
+ and hand the definitions on as Apache Ossie.
276
+
277
+ ## How it works
278
+
279
+ ```
280
+ model (.model2data.yml or DBML) + metrics file (optional)
281
+ -> read and validate -> generate -> scaffold the dbt project + compute each metric's known value
282
+ -> seeds, staging models and tests, metric tests, metric_values.json, osi/, profiles.yml
283
+ -> dbt build
284
+ ```
285
+
286
+ 1. **Read.** Reads the model — its tables, columns, keys, references and generation hints — from
287
+ a `.model2data.yml` document, checking it against [the spec](https://github.com/JB-Analytica/model2data/blob/main/model2data/spec/README.md), or
288
+ from DBML, which it converts to the same model first. A metrics file is checked against
289
+ [its spec](https://github.com/JB-Analytica/model2data/blob/main/model2data/spec/metrics/README.md) and against the model.
290
+ 2. **Generate.** Produces synthetic values per column — typed generation for known SQL types
291
+ (int, date, timestamp, ...), then a Faker provider named as the type (`sku ean13`), then
292
+ name-aware inference for everything else (`email`, `phone`, `city`, ...), foreign keys
293
+ resolved against already-generated parent rows. The metrics file is never read here: the data
294
+ is the same with or without it.
295
+ 3. **Scaffold.** Writes a complete dbt project around that data: CSV seeds, staging models that
296
+ `ref()` those seeds, `not_null`/`unique`/`relationships` tests, `accepted_values` tests for
297
+ enum-typed columns, singular SQL tests for composite primary/unique keys, tests from the
298
+ model's hints, table and column `description:` fields from the model, and a profile for
299
+ DuckDB (zero-config, file-based) or Postgres.
300
+ 4. **Compute metrics.** With `--metrics`, computes each metric over the generated data and writes
301
+ its known value, a dbt test that checks it, and the Apache Ossie file.
302
+
303
+ ---
304
+
305
+ ## Installation
306
+
307
+ ```bash
308
+ pip install model2data # DuckDB included
309
+ pip install "model2data[postgres]" # to target Postgres with --adapter postgres
310
+ uvx model2data --help # or run it without installing
311
+ ```
312
+
313
+ Python 3.10 to 3.14. The examples used on this page are in [`examples/`](https://github.com/JB-Analytica/model2data/tree/main/examples/).
314
+
315
+ ---
316
+
317
+ ## dbt-core versions
318
+
319
+ model2data requires **dbt-core >= 1.11**, tracking [dbt's own version support
320
+ policy](https://docs.getdbt.com/docs/dbt-versions): dbt Labs supports each minor release for one
321
+ year, and 1.11 is the oldest that still is. Generated projects build cleanly — no deprecation
322
+ warnings — on every supported dbt-core version, and CI proves it on each push by running a real
323
+ `dbt build` against both the stated floor and the newest release.
324
+
325
+ If you're pinned to an older dbt-core, use model2data 0.5.x, which supported down to 1.8.5.
326
+
327
+ ---
328
+
329
+ ## License
330
+
331
+ MIT License. See [LICENSE](https://github.com/JB-Analytica/model2data/blob/main/LICENSE). Built and maintained by [JB Analytica](https://www.jbanalytica.com).
332
+ Try [model2data studio](https://studio.jbanalytica.com) — model2data in the browser, nothing to install.
333
+
334
+ ---
335
+
336
+ ## Documentation
337
+
338
+ - [The model file](https://github.com/JB-Analytica/model2data/blob/main/docs/model-file.md) — `.model2data.yml`, DBML as input, `validate`, `convert`
339
+ - [Generating a project](https://github.com/JB-Analytica/model2data/blob/main/docs/generating.md) — row counts, `--as-of`, the determinism promise, `--table-seed`, `--locale`
340
+ - [The generated dbt project](https://github.com/JB-Analytica/model2data/blob/main/docs/dbt-project.md) — `dbt build`, Postgres, unit tests, hint tests, structure
341
+ - [Days after the first](https://github.com/JB-Analytica/model2data/blob/main/docs/days.md) and [history tables](https://github.com/JB-Analytica/model2data/blob/main/docs/history.md)
342
+ - [When things happen](https://github.com/JB-Analytica/model2data/blob/main/docs/time-shapes.md) and [how the data is spread](https://github.com/JB-Analytica/model2data/blob/main/docs/distributions.md)
343
+ - [Defects on purpose](https://github.com/JB-Analytica/model2data/blob/main/docs/defects.md)
344
+ - [Metrics with known values](https://github.com/JB-Analytica/model2data/blob/main/docs/metrics.md)
345
+ - [Validate models in CI](https://github.com/JB-Analytica/model2data/blob/main/docs/ci.md)
346
+ - [Agents and LLMs](https://github.com/JB-Analytica/model2data/blob/main/docs/agents.md), and [LLMS.md](https://github.com/JB-Analytica/model2data/blob/main/LLMS.md)
347
+ - The [model spec](https://github.com/JB-Analytica/model2data/blob/main/model2data/spec/README.md) and the [metrics spec](https://github.com/JB-Analytica/model2data/blob/main/model2data/spec/metrics/README.md)
348
+ - [Examples](https://github.com/JB-Analytica/model2data/blob/main/examples/README.md) and the [changelog](https://github.com/JB-Analytica/model2data/blob/main/CHANGELOG.md)