exmergo-dex-core 0.1.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 (66) hide show
  1. exmergo_dex_core-0.1.0/.gitignore +118 -0
  2. exmergo_dex_core-0.1.0/LICENSE +201 -0
  3. exmergo_dex_core-0.1.0/PKG-INFO +116 -0
  4. exmergo_dex_core-0.1.0/README.md +72 -0
  5. exmergo_dex_core-0.1.0/pyproject.toml +80 -0
  6. exmergo_dex_core-0.1.0/src/exmergo_dex_core/__init__.py +15 -0
  7. exmergo_dex_core-0.1.0/src/exmergo_dex_core/__main__.py +10 -0
  8. exmergo_dex_core-0.1.0/src/exmergo_dex_core/adapters/__init__.py +22 -0
  9. exmergo_dex_core-0.1.0/src/exmergo_dex_core/adapters/base.py +177 -0
  10. exmergo_dex_core-0.1.0/src/exmergo_dex_core/adapters/bigquery.py +10 -0
  11. exmergo_dex_core-0.1.0/src/exmergo_dex_core/adapters/databricks.py +10 -0
  12. exmergo_dex_core-0.1.0/src/exmergo_dex_core/adapters/duckdb.py +353 -0
  13. exmergo_dex_core-0.1.0/src/exmergo_dex_core/adapters/postgres.py +10 -0
  14. exmergo_dex_core-0.1.0/src/exmergo_dex_core/adapters/project.py +52 -0
  15. exmergo_dex_core-0.1.0/src/exmergo_dex_core/adapters/snowflake.py +10 -0
  16. exmergo_dex_core-0.1.0/src/exmergo_dex_core/cache.py +235 -0
  17. exmergo_dex_core-0.1.0/src/exmergo_dex_core/cli.py +203 -0
  18. exmergo_dex_core-0.1.0/src/exmergo_dex_core/command_args.py +41 -0
  19. exmergo_dex_core-0.1.0/src/exmergo_dex_core/config.py +88 -0
  20. exmergo_dex_core-0.1.0/src/exmergo_dex_core/connect.py +42 -0
  21. exmergo_dex_core-0.1.0/src/exmergo_dex_core/dbt_project.py +356 -0
  22. exmergo_dex_core-0.1.0/src/exmergo_dex_core/diff.py +64 -0
  23. exmergo_dex_core-0.1.0/src/exmergo_dex_core/diffs.py +63 -0
  24. exmergo_dex_core-0.1.0/src/exmergo_dex_core/envelope.py +187 -0
  25. exmergo_dex_core-0.1.0/src/exmergo_dex_core/explore/__init__.py +9 -0
  26. exmergo_dex_core-0.1.0/src/exmergo_dex_core/explore/commands.py +424 -0
  27. exmergo_dex_core-0.1.0/src/exmergo_dex_core/explore/inventory.py +16 -0
  28. exmergo_dex_core-0.1.0/src/exmergo_dex_core/explore/profile.py +309 -0
  29. exmergo_dex_core-0.1.0/src/exmergo_dex_core/explore/rank.py +103 -0
  30. exmergo_dex_core-0.1.0/src/exmergo_dex_core/explore/relationships.py +370 -0
  31. exmergo_dex_core-0.1.0/src/exmergo_dex_core/guards/__init__.py +8 -0
  32. exmergo_dex_core-0.1.0/src/exmergo_dex_core/guards/cost_guard.py +79 -0
  33. exmergo_dex_core-0.1.0/src/exmergo_dex_core/guards/query_firewall.py +396 -0
  34. exmergo_dex_core-0.1.0/src/exmergo_dex_core/guards/sql_guard.py +88 -0
  35. exmergo_dex_core-0.1.0/src/exmergo_dex_core/transform/__init__.py +56 -0
  36. exmergo_dex_core-0.1.0/src/exmergo_dex_core/transform/build.py +452 -0
  37. exmergo_dex_core-0.1.0/src/exmergo_dex_core/transform/commands.py +390 -0
  38. exmergo_dex_core-0.1.0/src/exmergo_dex_core/transform/init.py +200 -0
  39. exmergo_dex_core-0.1.0/src/exmergo_dex_core/transform/plans.py +203 -0
  40. exmergo_dex_core-0.1.0/src/exmergo_dex_core/transform/scaffold.py +164 -0
  41. exmergo_dex_core-0.1.0/src/exmergo_dex_core/transform/semantic.py +316 -0
  42. exmergo_dex_core-0.1.0/src/exmergo_dex_core/transform/validate.py +81 -0
  43. exmergo_dex_core-0.1.0/src/exmergo_dex_core/viz.py +11 -0
  44. exmergo_dex_core-0.1.0/tests/adapters/test_connect_duckdb.py +65 -0
  45. exmergo_dex_core-0.1.0/tests/conftest.py +80 -0
  46. exmergo_dex_core-0.1.0/tests/explore/conftest.py +93 -0
  47. exmergo_dex_core-0.1.0/tests/explore/test_explore.py +327 -0
  48. exmergo_dex_core-0.1.0/tests/explore/test_profile.py +297 -0
  49. exmergo_dex_core-0.1.0/tests/explore/test_query.py +229 -0
  50. exmergo_dex_core-0.1.0/tests/explore/test_relationships.py +307 -0
  51. exmergo_dex_core-0.1.0/tests/guards/test_cost_guard.py +44 -0
  52. exmergo_dex_core-0.1.0/tests/guards/test_query_firewall.py +183 -0
  53. exmergo_dex_core-0.1.0/tests/test_cli_contract.py +93 -0
  54. exmergo_dex_core-0.1.0/tests/test_diffs.py +44 -0
  55. exmergo_dex_core-0.1.0/tests/test_envelope.py +85 -0
  56. exmergo_dex_core-0.1.0/tests/test_safety_spine.py +427 -0
  57. exmergo_dex_core-0.1.0/tests/transform/test_apply.py +214 -0
  58. exmergo_dex_core-0.1.0/tests/transform/test_build.py +300 -0
  59. exmergo_dex_core-0.1.0/tests/transform/test_dbt_project.py +210 -0
  60. exmergo_dex_core-0.1.0/tests/transform/test_deps.py +182 -0
  61. exmergo_dex_core-0.1.0/tests/transform/test_init.py +242 -0
  62. exmergo_dex_core-0.1.0/tests/transform/test_parse.py +255 -0
  63. exmergo_dex_core-0.1.0/tests/transform/test_plan.py +239 -0
  64. exmergo_dex_core-0.1.0/tests/transform/test_scaffold.py +138 -0
  65. exmergo_dex_core-0.1.0/tests/transform/test_semantic.py +577 -0
  66. exmergo_dex_core-0.1.0/uv.lock +2230 -0
@@ -0,0 +1,118 @@
1
+ # ─── Local Claude Code guidance (kept private) ───────────────────────────────
2
+ # CLAUDE.md is kept local and opinionated for now (a private pointer to
3
+ # AGENTS.md plus the principles), not committed. Revisit when splitting
4
+ # baseline-shareable guidance from the private guidance.
5
+ CLAUDE.md
6
+ CLAUDE.local.md
7
+
8
+ # ─── Private planning docs (maintainer's steering docs; NEVER commit) ─────────
9
+ # The maintainer's private steering docs. They guide the project but are private;
10
+ # committed files must never reference them or their versions.
11
+ unversioned-docs/
12
+
13
+ # ─── Secrets & credentials (NEVER commit — dex connects to prod warehouses) ──
14
+ .env
15
+ .env.*
16
+ !.env.example
17
+ !.env.template
18
+ *.pem
19
+ *.p8 # Snowflake key-pair (RSA) private keys
20
+ *.key
21
+ credentials.json
22
+ service-account*.json
23
+ gcp-*.json
24
+ connections.toml # Snowflake ~/.snowflake/connections.toml if dropped locally
25
+ .databrickscfg
26
+ pg_service.conf
27
+ # dbt profiles carry warehouse secrets; keep them in ~/.dbt, not the repo.
28
+ # (Test fixtures that intentionally ship a profiles.yml can be force-added.)
29
+ profiles.yml
30
+ # Index credentials. Publishing runs through Trusted Publishing (OIDC), so no
31
+ # PyPI or TestPyPI token should ever sit in the tree.
32
+ *token*.txt
33
+ *.token
34
+ .pypirc
35
+
36
+ # ─── dex runtime artifacts ───────────────────────────────────────────────────
37
+ # .dex/ is meant to live in an END-USER's repo. In THIS dev repo a root-level
38
+ # .dex/ is just local-testing residue. Anchored to root so test fixtures that
39
+ # intentionally include a .dex/ deeper in the tree are preserved.
40
+ /.dex/
41
+
42
+ # ─── Python ──────────────────────────────────────────────────────────────────
43
+ __pycache__/
44
+ *.py[cod]
45
+ *$py.class
46
+ *.so
47
+ .Python
48
+ build/
49
+ dist/
50
+ wheels/
51
+ *.egg
52
+ *.egg-info/
53
+ .eggs/
54
+ MANIFEST
55
+ # NOTE: uv.lock is committed on purpose (reproducible builds); do not add it.
56
+
57
+ # ─── Virtual environments ────────────────────────────────────────────────────
58
+ .venv/
59
+ venv/
60
+ env/
61
+ ENV/
62
+
63
+ # ─── Test / coverage / type-check / lint caches ──────────────────────────────
64
+ .pytest_cache/
65
+ .coverage
66
+ .coverage.*
67
+ coverage.xml
68
+ htmlcov/
69
+ .cache/
70
+ .tox/
71
+ .nox/
72
+ .hypothesis/
73
+ .mypy_cache/
74
+ .dmypy.json
75
+ dmypy.json
76
+ .ruff_cache/
77
+ .pytype/
78
+ .pyre/
79
+
80
+ # ─── Jupyter / notebooks ─────────────────────────────────────────────────────
81
+ .ipynb_checkpoints/
82
+
83
+ # ─── dbt build artifacts (generated; compiled manifest, packages, logs) ──────
84
+ target/
85
+ dbt_packages/
86
+ dbt_modules/
87
+ logs/
88
+ .user.yml
89
+
90
+ # ─── Benchmark run outputs (Tier-3 results; runners/config stay committed) ───
91
+ # Adjust to match the harnesses' actual output dirs as they land in Phase 5.
92
+ benchmarks/**/results/
93
+ benchmarks/**/runs/
94
+ benchmarks/**/.out/
95
+
96
+ # ─── Logs & temp ─────────────────────────────────────────────────────────────
97
+ *.log
98
+ tmp/
99
+ *.tmp
100
+
101
+ # ─── OS cruft ────────────────────────────────────────────────────────────────
102
+ .DS_Store
103
+ .AppleDouble
104
+ .LSOverride
105
+ Thumbs.db
106
+ ehthumbs.db
107
+ Desktop.ini
108
+
109
+ # ─── Editors / IDEs ──────────────────────────────────────────────────────────
110
+ # NOTE: .cursor/, .windsurf/, and .github/copilot-instructions.md are committed
111
+ # cross-agent surfaces (Phase 0 deliverables) — intentionally NOT ignored.
112
+ .idea/
113
+ .vscode/
114
+ *.swp
115
+ *.swo
116
+ *~
117
+ .fleet/
118
+ .zed/
@@ -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 Derivative
95
+ 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 Exmergo, Inc.
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,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: exmergo-dex-core
3
+ Version: 0.1.0
4
+ Summary: Analytics engineering for Claude Code and any agent: data warehouse exploration, dbt transformation and semantic modeling, and schema-drift maintenance on dbt.
5
+ Project-URL: Homepage, https://www.exmergo.com/dex
6
+ Project-URL: Repository, https://github.com/exmergo/dex
7
+ Author-email: "Exmergo, Inc." <support@exmergo.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: agent,analytics-engineering,claude-code,data-engineering,dbt,duckdb,semantic-layer,text-to-sql
11
+ Requires-Python: >=3.11
12
+ Requires-Dist: pydantic>=2
13
+ Requires-Dist: pyyaml>=6
14
+ Provides-Extra: all
15
+ Requires-Dist: databricks-sdk>=0.30; extra == 'all'
16
+ Requires-Dist: databricks-sql-connector>=3; extra == 'all'
17
+ Requires-Dist: dbt-duckdb>=1.9; extra == 'all'
18
+ Requires-Dist: duckdb>=1; extra == 'all'
19
+ Requires-Dist: google-cloud-bigquery>=3; extra == 'all'
20
+ Requires-Dist: psycopg[binary]>=3; extra == 'all'
21
+ Requires-Dist: snowflake-connector-python>=3; extra == 'all'
22
+ Requires-Dist: sqlglot>=25; extra == 'all'
23
+ Provides-Extra: bigquery
24
+ Requires-Dist: google-cloud-bigquery>=3; extra == 'bigquery'
25
+ Requires-Dist: sqlglot>=25; extra == 'bigquery'
26
+ Provides-Extra: databricks
27
+ Requires-Dist: databricks-sdk>=0.30; extra == 'databricks'
28
+ Requires-Dist: databricks-sql-connector>=3; extra == 'databricks'
29
+ Requires-Dist: sqlglot>=25; extra == 'databricks'
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=8; extra == 'dev'
32
+ Requires-Dist: ruff==0.15.19; extra == 'dev'
33
+ Provides-Extra: duckdb
34
+ Requires-Dist: dbt-duckdb>=1.9; extra == 'duckdb'
35
+ Requires-Dist: duckdb>=1; extra == 'duckdb'
36
+ Requires-Dist: sqlglot>=25; extra == 'duckdb'
37
+ Provides-Extra: postgres
38
+ Requires-Dist: psycopg[binary]>=3; extra == 'postgres'
39
+ Requires-Dist: sqlglot>=25; extra == 'postgres'
40
+ Provides-Extra: snowflake
41
+ Requires-Dist: snowflake-connector-python>=3; extra == 'snowflake'
42
+ Requires-Dist: sqlglot>=25; extra == 'snowflake'
43
+ Description-Content-Type: text/markdown
44
+
45
+ # exmergo-dex-core
46
+
47
+ The portable, Apache-2.0 analytics-engineering engine behind
48
+ [dex](https://github.com/exmergo/dex). All non-trivial logic lives here; the
49
+ Claude Code skills and the cross-agent `AGENTS.md` are thin wrappers that drive it
50
+ through one stable command contract.
51
+
52
+ dex is the agent-native analytics engineering toolkit: explore an unfamiliar
53
+ warehouse, transform raw data into clean dbt models and a semantic layer on top,
54
+ and maintain all of it as the data underneath changes. Read-only against your data;
55
+ every change is a reviewable diff.
56
+
57
+ ## Install
58
+
59
+ ```
60
+ pip install "exmergo-dex-core[duckdb]"
61
+ ```
62
+
63
+ Connector client libraries live behind extras, so the zero-credential DuckDB
64
+ on-ramp installs only `duckdb` and `sqlglot`:
65
+
66
+ ```
67
+ exmergo-dex-core[duckdb] # the on-ramp and the eval/benchmark engine
68
+ exmergo-dex-core[snowflake]
69
+ exmergo-dex-core[bigquery]
70
+ exmergo-dex-core[databricks]
71
+ exmergo-dex-core[postgres]
72
+ exmergo-dex-core[all] # every connector at once
73
+ ```
74
+
75
+ ## The command contract
76
+
77
+ Every subcommand prints exactly one sanitized JSON envelope to stdout and nothing
78
+ else; nothing reaches agent context except through that envelope. Credentials
79
+ never cross it, and data values cross only from profiled, PII-cleared columns,
80
+ bounded and capped by the query firewall. State persists in `.dex/`, so
81
+ subcommands are stateless and the agent orchestrates multi-step flows.
82
+
83
+ ```
84
+ dex connect test --path data.duckdb
85
+ ```
86
+
87
+ See [`references/command-contract.md`](../../references/command-contract.md) for
88
+ the full surface and the envelope spec.
89
+
90
+ ## Status
91
+
92
+ Early and under active development; expect pre-release versions. Today the engine
93
+ runs Explore and Transform on DuckDB end to end.
94
+
95
+ Explore: ranks what matters in an unfamiliar warehouse, profiles columns
96
+ selectively, flags PII, surfaces grain and data-quality warnings, infers joins
97
+ and verifies them with overlap probes (`--verify`), and executes agent-authored
98
+ ad-hoc SELECTs behind a PII-aware query firewall (`explore query`), all
99
+ read-only.
100
+
101
+ Transform: bootstraps a dbt project where none exists (`transform init`, with an
102
+ explicit connector, never a default), turns agent-authored edits and
103
+ deterministic staging scaffolds into reviewable, conflict-checked diffs
104
+ (`transform plan` / `apply`, with human edits authoritative on conflict), runs
105
+ gated dev-target-only builds with cost surfaced before any spend
106
+ (`transform build`), and authors the semantic layer as MetricFlow-validated dbt
107
+ semantic models (`semantic define|update|plan`, applied with `transform apply`).
108
+
109
+ Maintain (drift detection and reconcile), the cloud connectors (BigQuery,
110
+ Snowflake, Databricks, PostgreSQL), and the Viz preview report `not_implemented`
111
+ until they land. The foundations are in place: the command contract, the
112
+ canonical model and `.dex/` layout, and the eval and safety spine.
113
+
114
+ ## License
115
+
116
+ Apache-2.0.
@@ -0,0 +1,72 @@
1
+ # exmergo-dex-core
2
+
3
+ The portable, Apache-2.0 analytics-engineering engine behind
4
+ [dex](https://github.com/exmergo/dex). All non-trivial logic lives here; the
5
+ Claude Code skills and the cross-agent `AGENTS.md` are thin wrappers that drive it
6
+ through one stable command contract.
7
+
8
+ dex is the agent-native analytics engineering toolkit: explore an unfamiliar
9
+ warehouse, transform raw data into clean dbt models and a semantic layer on top,
10
+ and maintain all of it as the data underneath changes. Read-only against your data;
11
+ every change is a reviewable diff.
12
+
13
+ ## Install
14
+
15
+ ```
16
+ pip install "exmergo-dex-core[duckdb]"
17
+ ```
18
+
19
+ Connector client libraries live behind extras, so the zero-credential DuckDB
20
+ on-ramp installs only `duckdb` and `sqlglot`:
21
+
22
+ ```
23
+ exmergo-dex-core[duckdb] # the on-ramp and the eval/benchmark engine
24
+ exmergo-dex-core[snowflake]
25
+ exmergo-dex-core[bigquery]
26
+ exmergo-dex-core[databricks]
27
+ exmergo-dex-core[postgres]
28
+ exmergo-dex-core[all] # every connector at once
29
+ ```
30
+
31
+ ## The command contract
32
+
33
+ Every subcommand prints exactly one sanitized JSON envelope to stdout and nothing
34
+ else; nothing reaches agent context except through that envelope. Credentials
35
+ never cross it, and data values cross only from profiled, PII-cleared columns,
36
+ bounded and capped by the query firewall. State persists in `.dex/`, so
37
+ subcommands are stateless and the agent orchestrates multi-step flows.
38
+
39
+ ```
40
+ dex connect test --path data.duckdb
41
+ ```
42
+
43
+ See [`references/command-contract.md`](../../references/command-contract.md) for
44
+ the full surface and the envelope spec.
45
+
46
+ ## Status
47
+
48
+ Early and under active development; expect pre-release versions. Today the engine
49
+ runs Explore and Transform on DuckDB end to end.
50
+
51
+ Explore: ranks what matters in an unfamiliar warehouse, profiles columns
52
+ selectively, flags PII, surfaces grain and data-quality warnings, infers joins
53
+ and verifies them with overlap probes (`--verify`), and executes agent-authored
54
+ ad-hoc SELECTs behind a PII-aware query firewall (`explore query`), all
55
+ read-only.
56
+
57
+ Transform: bootstraps a dbt project where none exists (`transform init`, with an
58
+ explicit connector, never a default), turns agent-authored edits and
59
+ deterministic staging scaffolds into reviewable, conflict-checked diffs
60
+ (`transform plan` / `apply`, with human edits authoritative on conflict), runs
61
+ gated dev-target-only builds with cost surfaced before any spend
62
+ (`transform build`), and authors the semantic layer as MetricFlow-validated dbt
63
+ semantic models (`semantic define|update|plan`, applied with `transform apply`).
64
+
65
+ Maintain (drift detection and reconcile), the cloud connectors (BigQuery,
66
+ Snowflake, Databricks, PostgreSQL), and the Viz preview report `not_implemented`
67
+ until they land. The foundations are in place: the command contract, the
68
+ canonical model and `.dex/` layout, and the eval and safety spine.
69
+
70
+ ## License
71
+
72
+ Apache-2.0.
@@ -0,0 +1,80 @@
1
+ [build-system]
2
+ requires = ["hatchling", "hatch-vcs"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "exmergo-dex-core"
7
+ dynamic = ["version"]
8
+ description = "Analytics engineering for Claude Code and any agent: data warehouse exploration, dbt transformation and semantic modeling, and schema-drift maintenance on dbt."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Exmergo, Inc.", email = "support@exmergo.com" }]
14
+ keywords = [
15
+ "analytics-engineering",
16
+ "dbt",
17
+ "claude-code",
18
+ "text-to-sql",
19
+ "semantic-layer",
20
+ "duckdb",
21
+ "data-engineering",
22
+ "agent",
23
+ ]
24
+
25
+ # Base dependencies are connector-agnostic: the canonical model (pydantic) and
26
+ # config parsing (pyyaml). Connector client libraries live behind the extras
27
+ # below, so the zero-credential DuckDB on-ramp never pulls the cloud client stack.
28
+ dependencies = [
29
+ "pydantic>=2",
30
+ "pyyaml>=6",
31
+ ]
32
+
33
+ [project.scripts]
34
+ dex = "exmergo_dex_core.cli:main"
35
+
36
+ [project.optional-dependencies]
37
+ # The DuckDB on-ramp and the full local ETM loop: the duckdb client, the dialect
38
+ # engine, and dbt-duckdb (which pulls dbt-core). All three skills install this one
39
+ # extra, and transform/maintain author and build a dbt project against a DuckDB
40
+ # dev target, so dbt-duckdb belongs here. (This makes the on-ramp heavier than a
41
+ # pure explore-only install would need; a separate lighter explore extra can be
42
+ # split out later if that tradeoff matters.)
43
+ duckdb = ["duckdb>=1", "sqlglot>=25", "dbt-duckdb>=1.9"]
44
+ snowflake = ["snowflake-connector-python>=3", "sqlglot>=25"]
45
+ bigquery = ["google-cloud-bigquery>=3", "sqlglot>=25"]
46
+ databricks = ["databricks-sql-connector>=3", "databricks-sdk>=0.30", "sqlglot>=25"]
47
+ postgres = ["psycopg[binary]>=3", "sqlglot>=25"]
48
+ # One command for users who want every connector at once (e.g. driving multiple
49
+ # warehouses). Self-references the connector extras so their client lists stay
50
+ # defined in exactly one place. Excludes dev, which is contributor tooling, not a
51
+ # connector. The light default and the [duckdb] on-ramp are unchanged.
52
+ all = ["exmergo-dex-core[bigquery,databricks,duckdb,postgres,snowflake]"]
53
+ dev = ["pytest>=8", "ruff==0.15.19"]
54
+
55
+ [project.urls]
56
+ Homepage = "https://www.exmergo.com/dex"
57
+ Repository = "https://github.com/exmergo/dex"
58
+
59
+ [tool.hatch.build.targets.wheel]
60
+ packages = ["src/exmergo_dex_core"]
61
+
62
+ # The version is the git tag (v0.1.0 -> 0.1.0): one source of truth, never a
63
+ # hand-edited literal that can drift from the tag the release pipeline cuts.
64
+ # fallback_version keeps source builds that cannot reach .git (for example a
65
+ # build in an isolated temp dir) from failing; CI guards against an accidental
66
+ # fallback by asserting the built version equals the tag before publishing.
67
+ [tool.hatch.version]
68
+ source = "vcs"
69
+
70
+ [tool.hatch.version.raw-options]
71
+ # This package lives in a subdirectory; the repository .git is two levels up.
72
+ root = "../.."
73
+ fallback_version = "0.0.0"
74
+
75
+ [tool.pytest.ini_options]
76
+ testpaths = ["tests"]
77
+ # importlib mode imports each test file as a unique module without sys.path
78
+ # manipulation, so the package-mirroring test tree can reuse basenames (e.g. a
79
+ # test_commands.py per capability) without import-file-mismatch collisions.
80
+ addopts = "--import-mode=importlib"
@@ -0,0 +1,15 @@
1
+ """exmergo-dex-core: the portable analytics-engineering engine behind dex.
2
+
3
+ All non-trivial logic lives here; every agent surface (SKILL.md, AGENTS.md) is a
4
+ thin wrapper over the command contract in :mod:`exmergo_dex_core.cli`.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from importlib.metadata import PackageNotFoundError, version
10
+
11
+ try:
12
+ __version__ = version("exmergo-dex-core")
13
+ except PackageNotFoundError:
14
+ # Running from a source tree with no installed distribution metadata.
15
+ __version__ = "0.0.0"
@@ -0,0 +1,10 @@
1
+ """Enables ``python -m exmergo_dex_core ...`` as the command entry point."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+
7
+ from .cli import main
8
+
9
+ if __name__ == "__main__":
10
+ sys.exit(main())
@@ -0,0 +1,22 @@
1
+ """Connector adapters. DuckDB is real today; the cloud adapters are stubs.
2
+
3
+ ``get_adapter`` is the single entry point so callers never import a connector
4
+ client directly; the client libraries stay behind their extras and are imported
5
+ only when their adapter is constructed.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from typing import Any
11
+
12
+
13
+ def get_adapter(connector: str, **kwargs: Any):
14
+ """Construct the adapter for ``connector``. Only DuckDB is wired in v0.1."""
15
+
16
+ if connector == "duckdb":
17
+ from .duckdb import DuckDBAdapter
18
+
19
+ return DuckDBAdapter(**kwargs)
20
+ if connector in {"snowflake", "bigquery", "databricks", "postgres"}:
21
+ raise NotImplementedError(f"the '{connector}' adapter is not yet implemented")
22
+ raise ValueError(f"unknown connector '{connector}'")