modelable 1.0.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 (218) hide show
  1. modelable-1.0.0/.gitignore +22 -0
  2. modelable-1.0.0/.python-version +1 -0
  3. modelable-1.0.0/LICENSE +201 -0
  4. modelable-1.0.0/PKG-INFO +61 -0
  5. modelable-1.0.0/README.md +18 -0
  6. modelable-1.0.0/pyproject.toml +140 -0
  7. modelable-1.0.0/src/modelable/__init__.py +1 -0
  8. modelable-1.0.0/src/modelable/__main__.py +3 -0
  9. modelable-1.0.0/src/modelable/_pydantic_py314_compat.py +31 -0
  10. modelable-1.0.0/src/modelable/cli.py +41 -0
  11. modelable-1.0.0/src/modelable/commands/__init__.py +1 -0
  12. modelable-1.0.0/src/modelable/commands/apicurio.py +84 -0
  13. modelable-1.0.0/src/modelable/commands/codegen.py +241 -0
  14. modelable-1.0.0/src/modelable/commands/common.py +43 -0
  15. modelable-1.0.0/src/modelable/commands/compile.py +237 -0
  16. modelable-1.0.0/src/modelable/commands/create.py +164 -0
  17. modelable-1.0.0/src/modelable/commands/diff.py +82 -0
  18. modelable-1.0.0/src/modelable/commands/graph.py +53 -0
  19. modelable-1.0.0/src/modelable/commands/llm.py +564 -0
  20. modelable-1.0.0/src/modelable/commands/lsp.py +15 -0
  21. modelable-1.0.0/src/modelable/commands/runtime.py +37 -0
  22. modelable-1.0.0/src/modelable/commands/scenario.py +104 -0
  23. modelable-1.0.0/src/modelable/commands/spec.py +197 -0
  24. modelable-1.0.0/src/modelable/commands/workspace.py +240 -0
  25. modelable-1.0.0/src/modelable/compat/__init__.py +11 -0
  26. modelable-1.0.0/src/modelable/compat/checker.py +179 -0
  27. modelable-1.0.0/src/modelable/compat/diff.py +169 -0
  28. modelable-1.0.0/src/modelable/compiler/__init__.py +3 -0
  29. modelable-1.0.0/src/modelable/compiler/compiler.py +19 -0
  30. modelable-1.0.0/src/modelable/compiler/workspace.py +346 -0
  31. modelable-1.0.0/src/modelable/diagnostics/__init__.py +3 -0
  32. modelable-1.0.0/src/modelable/diagnostics/model.py +27 -0
  33. modelable-1.0.0/src/modelable/emitters/__init__.py +0 -0
  34. modelable-1.0.0/src/modelable/emitters/base.py +22 -0
  35. modelable-1.0.0/src/modelable/emitters/csharp.py +245 -0
  36. modelable-1.0.0/src/modelable/emitters/dbt_yaml.py +290 -0
  37. modelable-1.0.0/src/modelable/emitters/diagnostics.py +25 -0
  38. modelable-1.0.0/src/modelable/emitters/fhir.py +694 -0
  39. modelable-1.0.0/src/modelable/emitters/fhir_validator.py +36 -0
  40. modelable-1.0.0/src/modelable/emitters/go.py +334 -0
  41. modelable-1.0.0/src/modelable/emitters/java.py +264 -0
  42. modelable-1.0.0/src/modelable/emitters/json_schema.py +458 -0
  43. modelable-1.0.0/src/modelable/emitters/markdown.py +252 -0
  44. modelable-1.0.0/src/modelable/emitters/odcs.py +355 -0
  45. modelable-1.0.0/src/modelable/emitters/openlineage.py +315 -0
  46. modelable-1.0.0/src/modelable/emitters/openmetadata.py +258 -0
  47. modelable-1.0.0/src/modelable/emitters/python.py +282 -0
  48. modelable-1.0.0/src/modelable/emitters/rust.py +643 -0
  49. modelable-1.0.0/src/modelable/emitters/shapes.py +261 -0
  50. modelable-1.0.0/src/modelable/emitters/sql.py +266 -0
  51. modelable-1.0.0/src/modelable/emitters/targets.py +141 -0
  52. modelable-1.0.0/src/modelable/emitters/typescript.py +352 -0
  53. modelable-1.0.0/src/modelable/expressions/__init__.py +0 -0
  54. modelable-1.0.0/src/modelable/expressions/cel.py +547 -0
  55. modelable-1.0.0/src/modelable/governance/__init__.py +3 -0
  56. modelable-1.0.0/src/modelable/governance/checker.py +271 -0
  57. modelable-1.0.0/src/modelable/governance/por.py +46 -0
  58. modelable-1.0.0/src/modelable/grammar/__init__.py +1 -0
  59. modelable-1.0.0/src/modelable/grammar/modelable.lark +257 -0
  60. modelable-1.0.0/src/modelable/graph/__init__.py +5 -0
  61. modelable-1.0.0/src/modelable/graph/export.py +442 -0
  62. modelable-1.0.0/src/modelable/llm/__init__.py +43 -0
  63. modelable-1.0.0/src/modelable/llm/chat.py +255 -0
  64. modelable-1.0.0/src/modelable/llm/config.py +87 -0
  65. modelable-1.0.0/src/modelable/llm/context.py +194 -0
  66. modelable-1.0.0/src/modelable/llm/engine.py +976 -0
  67. modelable-1.0.0/src/modelable/llm/importers.py +1077 -0
  68. modelable-1.0.0/src/modelable/llm/provenance.py +84 -0
  69. modelable-1.0.0/src/modelable/llm/providers.py +182 -0
  70. modelable-1.0.0/src/modelable/llm/qa.py +126 -0
  71. modelable-1.0.0/src/modelable/llm/recommendations.py +33 -0
  72. modelable-1.0.0/src/modelable/llm/redaction.py +19 -0
  73. modelable-1.0.0/src/modelable/llm/render.py +279 -0
  74. modelable-1.0.0/src/modelable/llm/update_plan.py +101 -0
  75. modelable-1.0.0/src/modelable/llm/validation_help.py +10 -0
  76. modelable-1.0.0/src/modelable/lsp/__init__.py +3 -0
  77. modelable-1.0.0/src/modelable/lsp/__main__.py +4 -0
  78. modelable-1.0.0/src/modelable/lsp/code_actions.py +210 -0
  79. modelable-1.0.0/src/modelable/lsp/completion.py +480 -0
  80. modelable-1.0.0/src/modelable/lsp/definition.py +343 -0
  81. modelable-1.0.0/src/modelable/lsp/diagnostics.py +31 -0
  82. modelable-1.0.0/src/modelable/lsp/document_symbols.py +197 -0
  83. modelable-1.0.0/src/modelable/lsp/federation.py +261 -0
  84. modelable-1.0.0/src/modelable/lsp/folding.py +33 -0
  85. modelable-1.0.0/src/modelable/lsp/formatting.py +64 -0
  86. modelable-1.0.0/src/modelable/lsp/highlight.py +30 -0
  87. modelable-1.0.0/src/modelable/lsp/hover.py +370 -0
  88. modelable-1.0.0/src/modelable/lsp/inlay_hints.py +158 -0
  89. modelable-1.0.0/src/modelable/lsp/references.py +511 -0
  90. modelable-1.0.0/src/modelable/lsp/rename.py +564 -0
  91. modelable-1.0.0/src/modelable/lsp/semantic_tokens.py +412 -0
  92. modelable-1.0.0/src/modelable/lsp/server.py +370 -0
  93. modelable-1.0.0/src/modelable/lsp/workspace.py +83 -0
  94. modelable-1.0.0/src/modelable/lsp/workspace_symbols.py +104 -0
  95. modelable-1.0.0/src/modelable/parser/__init__.py +94 -0
  96. modelable-1.0.0/src/modelable/parser/ir.py +451 -0
  97. modelable-1.0.0/src/modelable/parser/parse.py +47 -0
  98. modelable-1.0.0/src/modelable/parser/transformer.py +798 -0
  99. modelable-1.0.0/src/modelable/parser/wire.py +68 -0
  100. modelable-1.0.0/src/modelable/planner/__init__.py +0 -0
  101. modelable-1.0.0/src/modelable/planner/lineage.py +91 -0
  102. modelable-1.0.0/src/modelable/planner/planner.py +134 -0
  103. modelable-1.0.0/src/modelable/planner/plans.py +122 -0
  104. modelable-1.0.0/src/modelable/py.typed +0 -0
  105. modelable-1.0.0/src/modelable/registry/__init__.py +9 -0
  106. modelable-1.0.0/src/modelable/registry/apicurio.py +166 -0
  107. modelable-1.0.0/src/modelable/registry/base.py +18 -0
  108. modelable-1.0.0/src/modelable/registry/factory.py +18 -0
  109. modelable-1.0.0/src/modelable/registry/index.py +419 -0
  110. modelable-1.0.0/src/modelable/registry/local.py +26 -0
  111. modelable-1.0.0/src/modelable/registry/oci.py +22 -0
  112. modelable-1.0.0/src/modelable/registry/resolver.py +213 -0
  113. modelable-1.0.0/src/modelable/registry/schema.sql +119 -0
  114. modelable-1.0.0/src/modelable/registry/signature.py +26 -0
  115. modelable-1.0.0/src/modelable/release.py +125 -0
  116. modelable-1.0.0/src/modelable/runtime/__init__.py +5 -0
  117. modelable-1.0.0/src/modelable/runtime/adapter/__init__.py +17 -0
  118. modelable-1.0.0/src/modelable/runtime/adapter/base.py +18 -0
  119. modelable-1.0.0/src/modelable/runtime/adapter/postgres.py +82 -0
  120. modelable-1.0.0/src/modelable/specs/__init__.py +23 -0
  121. modelable-1.0.0/src/modelable/specs/tracking.py +220 -0
  122. modelable-1.0.0/src/modelable/validation/__init__.py +3 -0
  123. modelable-1.0.0/src/modelable/validation/semantic.py +659 -0
  124. modelable-1.0.0/tests/conftest.py +37 -0
  125. modelable-1.0.0/tests/fixtures/auto_projection_complex.mdl +36 -0
  126. modelable-1.0.0/tests/fixtures/billing_projection.mdl +29 -0
  127. modelable-1.0.0/tests/fixtures/breaking_changes.mdl +28 -0
  128. modelable-1.0.0/tests/fixtures/cel_error_cases.mdl +53 -0
  129. modelable-1.0.0/tests/fixtures/customer.mdl +21 -0
  130. modelable-1.0.0/tests/fixtures/federation_multi_registry/consumer.mdl +12 -0
  131. modelable-1.0.0/tests/fixtures/federation_multi_registry/provider.mdl +13 -0
  132. modelable-1.0.0/tests/fixtures/federation_multi_registry/workspace.mdl +18 -0
  133. modelable-1.0.0/tests/fixtures/fhir_patient_profile.mdl +33 -0
  134. modelable-1.0.0/tests/fixtures/governance_export_model.mdl +45 -0
  135. modelable-1.0.0/tests/fixtures/materialized_projection_chain.mdl +44 -0
  136. modelable-1.0.0/tests/fixtures/missing_header.mdl +6 -0
  137. modelable-1.0.0/tests/fixtures/multi_domain_joins.mdl +55 -0
  138. modelable-1.0.0/tests/fixtures/multi_language_target.mdl +30 -0
  139. modelable-1.0.0/tests/fixtures/no_owner.mdl +5 -0
  140. modelable-1.0.0/tests/fixtures/pii_governance.mdl +42 -0
  141. modelable-1.0.0/tests/fixtures/projection_of_projection.mdl +35 -0
  142. modelable-1.0.0/tests/fixtures/sql_and_dbt_targets.mdl +41 -0
  143. modelable-1.0.0/tests/helpers.py +7 -0
  144. modelable-1.0.0/tests/test_apicurio_registry.py +94 -0
  145. modelable-1.0.0/tests/test_apicurio_testcontainers.py +61 -0
  146. modelable-1.0.0/tests/test_auto_projection.py +134 -0
  147. modelable-1.0.0/tests/test_cel_validation.py +355 -0
  148. modelable-1.0.0/tests/test_cli.py +911 -0
  149. modelable-1.0.0/tests/test_cli_create.py +106 -0
  150. modelable-1.0.0/tests/test_cli_inspect.py +149 -0
  151. modelable-1.0.0/tests/test_codegen_docker_smoke.py +521 -0
  152. modelable-1.0.0/tests/test_codegen_targets.py +111 -0
  153. modelable-1.0.0/tests/test_compatibility.py +243 -0
  154. modelable-1.0.0/tests/test_compiler.py +52 -0
  155. modelable-1.0.0/tests/test_diagnostics.py +67 -0
  156. modelable-1.0.0/tests/test_emit_csharp.py +170 -0
  157. modelable-1.0.0/tests/test_emit_dbt_yaml.py +122 -0
  158. modelable-1.0.0/tests/test_emit_fhir.py +412 -0
  159. modelable-1.0.0/tests/test_emit_go.py +226 -0
  160. modelable-1.0.0/tests/test_emit_java.py +225 -0
  161. modelable-1.0.0/tests/test_emit_json_schema.py +379 -0
  162. modelable-1.0.0/tests/test_emit_markdown.py +345 -0
  163. modelable-1.0.0/tests/test_emit_odcs.py +208 -0
  164. modelable-1.0.0/tests/test_emit_openlineage.py +129 -0
  165. modelable-1.0.0/tests/test_emit_openmetadata.py +141 -0
  166. modelable-1.0.0/tests/test_emit_python.py +228 -0
  167. modelable-1.0.0/tests/test_emit_rust.py +1005 -0
  168. modelable-1.0.0/tests/test_emit_sql.py +322 -0
  169. modelable-1.0.0/tests/test_emit_typescript.py +655 -0
  170. modelable-1.0.0/tests/test_fhir_validator.py +76 -0
  171. modelable-1.0.0/tests/test_fixtures_regression.py +258 -0
  172. modelable-1.0.0/tests/test_governance.py +165 -0
  173. modelable-1.0.0/tests/test_grammar.py +285 -0
  174. modelable-1.0.0/tests/test_graph_export.py +118 -0
  175. modelable-1.0.0/tests/test_impact_analysis.py +103 -0
  176. modelable-1.0.0/tests/test_lineage.py +194 -0
  177. modelable-1.0.0/tests/test_llm_features.py +1797 -0
  178. modelable-1.0.0/tests/test_llm_provider_integration.py +701 -0
  179. modelable-1.0.0/tests/test_lsp_code_actions.py +262 -0
  180. modelable-1.0.0/tests/test_lsp_completion.py +137 -0
  181. modelable-1.0.0/tests/test_lsp_completion_mirrors.py +287 -0
  182. modelable-1.0.0/tests/test_lsp_definition.py +272 -0
  183. modelable-1.0.0/tests/test_lsp_diagnostics.py +24 -0
  184. modelable-1.0.0/tests/test_lsp_document_symbols.py +53 -0
  185. modelable-1.0.0/tests/test_lsp_features.py +303 -0
  186. modelable-1.0.0/tests/test_lsp_federation_diagnostics.py +198 -0
  187. modelable-1.0.0/tests/test_lsp_folding.py +60 -0
  188. modelable-1.0.0/tests/test_lsp_formatting.py +68 -0
  189. modelable-1.0.0/tests/test_lsp_highlight.py +75 -0
  190. modelable-1.0.0/tests/test_lsp_hover.py +266 -0
  191. modelable-1.0.0/tests/test_lsp_inlay_hints.py +166 -0
  192. modelable-1.0.0/tests/test_lsp_integration.py +157 -0
  193. modelable-1.0.0/tests/test_lsp_references.py +123 -0
  194. modelable-1.0.0/tests/test_lsp_rename.py +163 -0
  195. modelable-1.0.0/tests/test_lsp_semantic_tokens.py +134 -0
  196. modelable-1.0.0/tests/test_lsp_server.py +258 -0
  197. modelable-1.0.0/tests/test_lsp_workspace.py +58 -0
  198. modelable-1.0.0/tests/test_lsp_workspace_symbols.py +50 -0
  199. modelable-1.0.0/tests/test_openmetadata_testcontainers.py +190 -0
  200. modelable-1.0.0/tests/test_planner.py +143 -0
  201. modelable-1.0.0/tests/test_por.py +59 -0
  202. modelable-1.0.0/tests/test_postgres_adapter.py +50 -0
  203. modelable-1.0.0/tests/test_py314_compat.py +61 -0
  204. modelable-1.0.0/tests/test_registry.py +40 -0
  205. modelable-1.0.0/tests/test_registry_index.py +308 -0
  206. modelable-1.0.0/tests/test_release_metadata.py +99 -0
  207. modelable-1.0.0/tests/test_release_workflow.py +111 -0
  208. modelable-1.0.0/tests/test_repository_release.py +111 -0
  209. modelable-1.0.0/tests/test_resolver.py +110 -0
  210. modelable-1.0.0/tests/test_samples.py +249 -0
  211. modelable-1.0.0/tests/test_semantic.py +475 -0
  212. modelable-1.0.0/tests/test_serialization_hints.py +197 -0
  213. modelable-1.0.0/tests/test_spec_tracking.py +457 -0
  214. modelable-1.0.0/tests/test_transformer.py +291 -0
  215. modelable-1.0.0/tests/test_validate_surface_detection.py +85 -0
  216. modelable-1.0.0/tests/test_version_range_resolution.py +119 -0
  217. modelable-1.0.0/tests/test_workspace.py +198 -0
  218. modelable-1.0.0/uv.lock +942 -0
@@ -0,0 +1,22 @@
1
+ apps/frontend/test-results/*
2
+ .worktrees/
3
+ .env.local
4
+ target/
5
+ node_modules/
6
+ dist/
7
+ .modelable/
8
+
9
+ # Helm fetched chart dependencies — regenerated by `helm dependency update`
10
+ charts/*/charts/
11
+ scripts/__pycache__/
12
+ **/__pycache__/
13
+ *.pyc
14
+ *.pyo
15
+ .pytest_cache/
16
+ .pytest_tmp/
17
+ .venv/
18
+
19
+ # VS Code test harness — downloaded VS Code binary for extension smoke tests
20
+ vscode/.vscode-test/
21
+ vscode/out/
22
+ vscode/*.vsix
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Modelable contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,61 @@
1
+ Metadata-Version: 2.4
2
+ Name: modelable
3
+ Version: 1.0.0
4
+ Summary: Compiler and language server for versioned, domain-owned data models
5
+ Project-URL: Homepage, https://github.com/ktjn/modelable
6
+ Project-URL: Documentation, https://github.com/ktjn/modelable/tree/main/docs
7
+ Project-URL: Repository, https://github.com/ktjn/modelable
8
+ Project-URL: Issues, https://github.com/ktjn/modelable/issues
9
+ Project-URL: Changelog, https://github.com/ktjn/modelable/blob/main/CHANGELOG.md
10
+ Author: Modelable contributors
11
+ Maintainer: ktjn
12
+ License-Expression: Apache-2.0
13
+ License-File: LICENSE
14
+ Keywords: code-generation,data-contracts,data-modeling,language-server,lineage,schema
15
+ Classifier: Development Status :: 5 - Production/Stable
16
+ Classifier: Environment :: Console
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Topic :: Software Development :: Code Generators
22
+ Classifier: Topic :: Software Development :: Compilers
23
+ Requires-Python: >=3.14
24
+ Requires-Dist: click>=8.1
25
+ Requires-Dist: jsonschema>=4.23
26
+ Requires-Dist: lark>=1.1
27
+ Requires-Dist: psycopg[binary]>=3.2
28
+ Requires-Dist: pydantic==2.13.4
29
+ Requires-Dist: pygls<3,>=2.1.1
30
+ Requires-Dist: pyyaml>=6.0.3
31
+ Requires-Dist: referencing>=0.35
32
+ Requires-Dist: rich>=13.0
33
+ Provides-Extra: dev
34
+ Requires-Dist: build>=1.2; extra == 'dev'
35
+ Requires-Dist: mypy>=2.1.0; extra == 'dev'
36
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
37
+ Requires-Dist: pytest-lsp>=1.0.1; extra == 'dev'
38
+ Requires-Dist: pytest-xdist>=3.0; extra == 'dev'
39
+ Requires-Dist: pytest>=9.1.1; extra == 'dev'
40
+ Requires-Dist: ruff>=0.15.18; extra == 'dev'
41
+ Requires-Dist: testcontainers==4.14.2; extra == 'dev'
42
+ Description-Content-Type: text/markdown
43
+
44
+ # Modelable
45
+
46
+ Modelable is a compiler and language server for versioned, domain-owned data
47
+ models. It validates `.mdl` contracts, resolves projections, reports
48
+ compatibility and governance findings, traces field-level lineage, and emits
49
+ JSON Schema, documentation, and typed-language artifacts.
50
+
51
+ Modelable is currently a public alpha and requires Python 3.14.
52
+
53
+ ```bash
54
+ uv tool install modelable
55
+ modelable --version
56
+ modelable validate models --strict
57
+ modelable compile models --target json-schema --out generated/schema
58
+ ```
59
+
60
+ Documentation, examples, release notes, and contribution guidance are
61
+ available at <https://github.com/ktjn/modelable>.
@@ -0,0 +1,18 @@
1
+ # Modelable
2
+
3
+ Modelable is a compiler and language server for versioned, domain-owned data
4
+ models. It validates `.mdl` contracts, resolves projections, reports
5
+ compatibility and governance findings, traces field-level lineage, and emits
6
+ JSON Schema, documentation, and typed-language artifacts.
7
+
8
+ Modelable is currently a public alpha and requires Python 3.14.
9
+
10
+ ```bash
11
+ uv tool install modelable
12
+ modelable --version
13
+ modelable validate models --strict
14
+ modelable compile models --target json-schema --out generated/schema
15
+ ```
16
+
17
+ Documentation, examples, release notes, and contribution guidance are
18
+ available at <https://github.com/ktjn/modelable>.
@@ -0,0 +1,140 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "modelable"
7
+ version = "1.0.0"
8
+ description = "Compiler and language server for versioned, domain-owned data models"
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ license-files = ["LICENSE"]
12
+ authors = [
13
+ { name = "Modelable contributors" },
14
+ ]
15
+ maintainers = [
16
+ { name = "ktjn" },
17
+ ]
18
+ requires-python = ">=3.14"
19
+ keywords = [
20
+ "data-contracts",
21
+ "data-modeling",
22
+ "lineage",
23
+ "schema",
24
+ "code-generation",
25
+ "language-server",
26
+ ]
27
+ classifiers = [
28
+ "Development Status :: 5 - Production/Stable",
29
+ "Environment :: Console",
30
+ "Intended Audience :: Developers",
31
+ "Operating System :: OS Independent",
32
+ "Programming Language :: Python :: 3",
33
+ "Programming Language :: Python :: 3.14",
34
+ "Topic :: Software Development :: Code Generators",
35
+ "Topic :: Software Development :: Compilers",
36
+ ]
37
+ dependencies = [
38
+ "click>=8.1",
39
+ "lark>=1.1",
40
+ "pydantic==2.13.4",
41
+ "rich>=13.0",
42
+ "jsonschema>=4.23",
43
+ "referencing>=0.35",
44
+ "pygls>=2.1.1,<3",
45
+ "psycopg[binary]>=3.2",
46
+ "pyyaml>=6.0.3",
47
+ ]
48
+
49
+ [project.urls]
50
+ Homepage = "https://github.com/ktjn/modelable"
51
+ Documentation = "https://github.com/ktjn/modelable/tree/main/docs"
52
+ Repository = "https://github.com/ktjn/modelable"
53
+ Issues = "https://github.com/ktjn/modelable/issues"
54
+ Changelog = "https://github.com/ktjn/modelable/blob/main/CHANGELOG.md"
55
+
56
+ [project.optional-dependencies]
57
+ dev = [
58
+ "pytest>=9.1.1",
59
+ "pytest-cov>=4.0",
60
+ "pytest-lsp>=1.0.1",
61
+ "pytest-xdist>=3.0",
62
+ "ruff>=0.15.18",
63
+ "mypy>=2.1.0",
64
+ "build>=1.2",
65
+ "testcontainers==4.14.2",
66
+ ]
67
+
68
+ [project.scripts]
69
+ modelable = "modelable.cli:cli"
70
+
71
+ [tool.hatch.build.targets.wheel]
72
+ packages = ["src/modelable"]
73
+
74
+ [tool.pytest.ini_options]
75
+ testpaths = ["tests"]
76
+ asyncio_mode = "auto"
77
+ asyncio_default_fixture_loop_scope = "module"
78
+ asyncio_default_test_loop_scope = "module"
79
+ addopts = "-n auto"
80
+ markers = [
81
+ "docker: requires Docker daemon and internet access (opt-in via MODELABLE_DOCKER_TESTS=1)",
82
+ ]
83
+
84
+ [tool.coverage.run]
85
+ source = ["src/modelable"]
86
+
87
+ [tool.ruff]
88
+ line-length = 120
89
+ target-version = "py314"
90
+
91
+ [tool.ruff.lint]
92
+ select = ["E", "F", "I", "N", "UP", "B", "C4", "SIM", "RUF"]
93
+ ignore = [
94
+ "E501", # Line too long (handled by formatter)
95
+ ]
96
+
97
+ [tool.mypy]
98
+ python_version = "3.14"
99
+ mypy_path = "src"
100
+ strict = true
101
+ check_untyped_defs = true
102
+ explicit_package_bases = true
103
+ warn_unused_ignores = true
104
+ warn_redundant_casts = true
105
+ warn_unused_configs = true
106
+ plugins = ["pydantic.mypy"]
107
+
108
+ [[tool.mypy.overrides]]
109
+ module = "tests.*"
110
+ check_untyped_defs = true
111
+ disallow_untyped_defs = false
112
+ disallow_incomplete_defs = false
113
+ ignore_errors = false
114
+
115
+ [[tool.mypy.overrides]]
116
+ module = [
117
+ "lark.*",
118
+ "jsonschema.*",
119
+ "referencing.*",
120
+ "pygls.*",
121
+ "lsprotocol.*",
122
+ "psycopg.*",
123
+ "yaml.*",
124
+ ]
125
+ ignore_missing_imports = true
126
+
127
+ [tool.pydantic-mypy]
128
+ init_forbid_extra = true
129
+ init_typed = true
130
+ warn_required_dynamic_aliases = true
131
+
132
+ [dependency-groups]
133
+ dev = [
134
+ "mypy>=2.1.0",
135
+ "pytest>=9.1.1",
136
+ "pytest-lsp>=1.0.1",
137
+ "pytest-xdist>=3.0",
138
+ "ruff>=0.15.18",
139
+ "testcontainers==4.14.2",
140
+ ]
@@ -0,0 +1 @@
1
+ from modelable import _pydantic_py314_compat as _ # noqa: F401
@@ -0,0 +1,3 @@
1
+ from modelable.cli import cli
2
+
3
+ cli()
@@ -0,0 +1,31 @@
1
+ """
2
+ Compatibility shim for pydantic 2.x on Python 3.14.
3
+
4
+ pydantic 2.x calls typing._eval_type(..., prefer_fwd_module=True) when it
5
+ detects Python 3.14, but Python 3.14 RC2 renamed that parameter to
6
+ parent_fwdref. This shim patches typing._eval_type to accept both names so
7
+ pydantic model definitions succeed without modification.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import typing
13
+
14
+ _real_eval_type = typing._eval_type # type: ignore[attr-defined]
15
+
16
+
17
+ def _compat_eval_type(
18
+ t: object,
19
+ globalns: object = None,
20
+ localns: object = None,
21
+ type_params: object = None,
22
+ *,
23
+ prefer_fwd_module: object = None,
24
+ **kwargs: object,
25
+ ) -> object:
26
+ if prefer_fwd_module is not None:
27
+ kwargs.setdefault("parent_fwdref", prefer_fwd_module)
28
+ return _real_eval_type(t, globalns, localns, type_params=type_params, **kwargs)
29
+
30
+
31
+ typing._eval_type = _compat_eval_type # type: ignore[attr-defined]
@@ -0,0 +1,41 @@
1
+ from __future__ import annotations
2
+
3
+ import click
4
+
5
+ from modelable.commands.apicurio import register_apicurio_commands
6
+ from modelable.commands.codegen import register_codegen_commands
7
+ from modelable.commands.compile import register_compile_commands
8
+ from modelable.commands.create import register_create_commands
9
+ from modelable.commands.diff import register_diff_commands
10
+ from modelable.commands.graph import register_graph_commands
11
+ from modelable.commands.llm import register_llm_commands
12
+ from modelable.commands.lsp import register_lsp_commands
13
+ from modelable.commands.runtime import register_runtime_commands
14
+ from modelable.commands.scenario import register_scenario_commands
15
+ from modelable.commands.spec import register_spec_commands
16
+ from modelable.commands.workspace import register_workspace_commands
17
+
18
+
19
+ @click.group()
20
+ @click.version_option(package_name="modelable", prog_name="modelable")
21
+ def cli() -> None:
22
+ """Modelable domain-owned data model compiler.
23
+
24
+ MVP workflows cover validate, resolve, lineage, diff, compile, docs,
25
+ inspect, codegen, lsp, scenario, create helpers, and Apicurio JSON Schema
26
+ artifact publish/pull.
27
+ """
28
+
29
+
30
+ register_workspace_commands(cli)
31
+ register_compile_commands(cli)
32
+ register_create_commands(cli)
33
+ register_diff_commands(cli)
34
+ register_graph_commands(cli)
35
+ register_lsp_commands(cli)
36
+ register_llm_commands(cli)
37
+ register_codegen_commands(cli)
38
+ register_scenario_commands(cli)
39
+ register_runtime_commands(cli)
40
+ register_apicurio_commands(cli)
41
+ register_spec_commands(cli)
@@ -0,0 +1 @@
1
+ from __future__ import annotations
@@ -0,0 +1,84 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import sys
5
+ from pathlib import Path
6
+
7
+ import click
8
+
9
+ from modelable.commands.common import console, load_workspace_or_exit
10
+ from modelable.emitters.json_schema import emit_json_schema
11
+ from modelable.registry.apicurio import ApicurioArtifact, ApicurioRegistryClient, ApicurioRegistryError
12
+
13
+
14
+ def register_apicurio_commands(cli_group: click.Group) -> None:
15
+ cli_group.add_command(publish)
16
+ cli_group.add_command(pull)
17
+
18
+
19
+ @click.group()
20
+ def publish() -> None:
21
+ """Publish generated artifacts to external registries."""
22
+
23
+
24
+ @publish.command(name="apicurio")
25
+ @click.argument("source", type=click.Path(exists=True, path_type=Path))
26
+ @click.option("--url", required=True, help="Apicurio Registry base URL or /apis/registry/v3 URL.")
27
+ @click.option("--group", default="default", show_default=True, help="Apicurio artifact group.")
28
+ @click.option("--token", default=None, help="Bearer token. Defaults to MODELABLE_APICURIO_TOKEN.")
29
+ @click.option("--dry-run", is_flag=True, help="List artifacts without publishing.")
30
+ def publish_apicurio(source: Path, url: str, group: str, token: str | None, dry_run: bool) -> None:
31
+ """Publish JSON Schema artifacts generated from SOURCE to Apicurio Registry."""
32
+ workspace = load_workspace_or_exit(source)
33
+ emitted = emit_json_schema(workspace, Path(".modelable/apicurio"))
34
+ artifacts = [
35
+ ApicurioArtifact(
36
+ artifact_id=artifact.artifact_id,
37
+ version=artifact.artifact_id.rsplit(".v", 1)[1],
38
+ content=artifact.content,
39
+ )
40
+ for artifact in emitted
41
+ if isinstance(artifact.content, dict)
42
+ ]
43
+
44
+ if dry_run:
45
+ console.print(f"[yellow]DRY RUN[/yellow] would publish {len(artifacts)} JSON Schema artifact(s) to {url}")
46
+ for artifact in artifacts:
47
+ console.print(f"- {artifact.artifact_id} (group={group}, version={artifact.version})")
48
+ sys.exit(0)
49
+
50
+ client = ApicurioRegistryClient(url, token=token or os.getenv("MODELABLE_APICURIO_TOKEN"))
51
+ try:
52
+ for artifact in artifacts:
53
+ client.publish_json_schema(artifact, group=group)
54
+ console.print(f"[green]OK[/green] published {group}/{artifact.artifact_id}@{artifact.version}")
55
+ except ApicurioRegistryError as exc:
56
+ console.print(f"[red]ERROR[/red] {exc}")
57
+ sys.exit(1)
58
+
59
+ if not artifacts:
60
+ console.print("[yellow]No JSON Schema artifacts generated.[/yellow]")
61
+ sys.exit(0)
62
+
63
+
64
+ @click.group()
65
+ def pull() -> None:
66
+ """Pull generated artifacts from external registries."""
67
+
68
+
69
+ @pull.command(name="apicurio")
70
+ @click.argument("ref")
71
+ @click.option("--url", required=True, help="Apicurio Registry base URL or /apis/registry/v3 URL.")
72
+ @click.option("--group", default="default", show_default=True, help="Apicurio artifact group.")
73
+ @click.option("--out", "out_dir", type=click.Path(path_type=Path), default=Path("./dist/jsonschema"))
74
+ @click.option("--token", default=None, help="Bearer token. Defaults to MODELABLE_APICURIO_TOKEN.")
75
+ def pull_apicurio(ref: str, url: str, group: str, out_dir: Path, token: str | None) -> None:
76
+ """Pull a JSON Schema artifact by Modelable REF from Apicurio Registry."""
77
+ client = ApicurioRegistryClient(url, token=token or os.getenv("MODELABLE_APICURIO_TOKEN"))
78
+ try:
79
+ path = client.pull_json_schema(ref, group=group, out_dir=out_dir)
80
+ except ApicurioRegistryError as exc:
81
+ console.print(f"[red]ERROR[/red] {exc}")
82
+ sys.exit(1)
83
+ console.print(f"[green]OK[/green] wrote {path}")
84
+ sys.exit(0)