Skip to main content

dimctx

dimctx = dimensional modeling context provider 一个本地 MCP server,让你的 AI 编码助手在写数仓代码时拥有维度建模的判断力。

License: AGPL-3.0-or-later

它解决什么

AI 写 SQL/DDL 时会瞎编建模决策:分不清事实和维度、猜不准粒度、不知道哪些维度该跨表一致。 dimctx 把这些判断交给确定性引擎 + 你自己的方法论语料。

五个工具:

工具 作用
analyze_table 判定表角色(fact/dimension)、粒度键、SCD 建议、总线矩阵格值
search_canon 检索你自备的建模语料(本地 markdown)
bus_matrix 总线矩阵查询(单表格值 / 单维度实现 / 全库概览)
measure_sql 度量下游取数复杂度(CASE WHEN / JOIN 深度 / 子查询 / 聚合嵌套)
check_conformed_facts 一致性事实检查:同名度量在多张事实表出现时,定义/单位/过滤/时间口径必须完全一致;不兼容则按原典须改名

三步接入

# 1) 配置(可选,缺省也能跑:只是语料检索为空)
export DIMCTX_ATLAS=/path/to/atlas.json      # 工程表图谱(可选)
export DIMCTX_CANON_DIR=/path/to/markdown    # 你自备的建模语料(可选)

# 2) 在 IDE 的 MCP 配置里加一条
#    VS Code (mcp.json) / Cursor (.cursor/mcp.json) / Continue (config.yaml)
{"command": "uvx", "args": ["dimctx"]}

# 3) 让 AI 用它
#    「用 dimctx 看看 dt_batch 是什么表、粒度是什么」

数据边界(重要)

  • 纯本地 stdio:无网络出口、无遥测、无云服务、不做托管;
  • 不打包任何第三方内容:语料由你自备(详见 docs/DATA-POLICY.md 与 NOTICE);
  • 未配置语料时 search_canon 返回空并提示配置,不会报错、不会联网索取。

开发

uv run --with pytest --with pydantic python -m pytest tests/ -q   # 19 passed

许可

代码 AGPL-3.0-or-later(见 LICENSE)。本项目与 Kimball Group 无关联、未获其背书; 文档中提及 Kimball 方法论属指名性合理使用(nominative fair use)。

Metadata

Release files for dimctx 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dimctx 0.2.0
File Size Uploaded Provenance Actions
dimctx-0.2.0.tar.gz 35.3 kB Without provenance Details for dimctx-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dimctx 0.2.0
File Interpreter ABI Platform Actions
dimctx-0.2.0-py3-none-any.whl Python 3 none any Details for dimctx-0.2.0-py3-none-any.whl

Total release size: 71.4 kB

Release files / dimctx-0.2.0.tar.gz

Download URL dimctx-0.2.0.tar.gz
Size 35.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b49867881d74935ba1fcf0922dd014423bed5685a568ae70e52d997644acacc3
BLAKE2b-256 checksum
How to use checksums
23a8532e464e9f1d6d0c06140ba63055b42061815bb3b6ad8ac65f660a7c0919
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / dimctx-0.2.0-py3-none-any.whl

Download URL dimctx-0.2.0-py3-none-any.whl
Size 36.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1689fc91eef8a2ad1f9401cd23ae787628c76c2c3f78f511de1a63462bb4447f
BLAKE2b-256 checksum
How to use checksums
16790a5093b5f7125fa3cd2c9c8347107d5ac3960ca7d9e5a86fce7cd4560790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for dimctx 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page