Renhuai123/ziwei-doushu

紫微斗数开源排盘引擎 — 基于倪海厦《天纪》体系,含完整排盘算法、四化系统、格局知识库、古籍原文数据

Open original source ↗

From the publisher

README & documentation

Source preview

Read the project’s overview, installation instructions and usage examples. The original README is the source of truth.

[](https://github.com/Renhuai123/ziwei-doushu/actions/workflows/ci.yml) [](./LICENSE) [](./DATASET-LICENSE) 中文 · English 一、项目理念:紫微斗数是中国传统命理学的瑰宝,倪海厦老师在《天纪》中系统梳理了正宗的紫微斗数体系。我们希望通过技术手段让更多人接触和学习这门学问。 开源排盘算法和知识库,是因为我们相信:算法是公开的传统智慧,不应该被锁在围墙里。真正的价值在于解读的深度、用户体验的打磨、以及持续运营的积累。 二、项目信息:基于倪海厦《天纪》教学体系的紫微斗数排盘系统,包含完整排盘算法、四化系统、格局知识库、古籍原文数据,以及一套完整开源的紫微斗数解读数据:v4.0 解读数据集——67.5 万张命盘 × 13 维 = 877 万段解读,正文约 204 亿字,解压后 56.6 GB(2026-10-15 发布)。 v3.0 每张盘解读字数按 2,160 张盘抽样估算,其余数字为全量统计;两版每张盘都是 13 维。 在线体验:metisziwei.com,排盘、AI 解读、命盘历史全部开放。 本轮跟随网站 2026-10-15 发版(网站内容版本 ca268829f7a9): 1. 发布 13 维解读数据集 v4.0 —— 674,976 张命盘(公历 1950–2026 年每一个真实日期 × 12 时辰 × 男女)× 13 维 = 8,774,688 段解读,正文约 204 亿字。解压后 56.6 GB(v3.0 为 33.1 GB,增加 71%),压缩后只有 161 MB,按年份分 77 个文件,可以只下需要的年份,也可以一次下全年份总包。下载见 Release v4.0-13d,规格和字段见第二·新章。发布前 77 个文件逐个解压,与原始数据逐字节比对一致。 2. 13 维断语按倪师原话与《全书》原文逐句校正(断语库仍不开源,校正结果体现在 v4.0 数据集里): 3. 排盘引擎同步(PR #39)—— dst-cn.ts 新增 chinaDSTSpan(year),查某年中国夏令时起止;cities.ts 补全省直辖县级单位与新疆兵团各市的经度(神农架、海南各市县、阿拉尔等),出生地选这些城市时真太阳时校正可用。 4. 许可 —— DATASET-LICENSE 适用范围加上 v4.0;写明解读里引用的倪师原话不在数据授权范围内,与第五章倪师原话的 CC BY-NC-SA 4.0 一致。v3.0 样本数据集及其条款不变。 时隔三个月,本仓库完成一次完整更新(PR #28,26 个文件、+2736 / −108 行): 1. 排盘引擎同步到线上口径 —— algorithm.ts 从 181 行到 641 行,另更新 sihua / types / constants / patterns / cities / famous;新增 8 个模块(1367 行): 2. 补上回归测试与 CI —— 此前本仓库没有任何测试。现在 5 条排盘回归,npm test 一条命令跑完,每次 push 与 PR 在 GitHub Actions 上自动跑。 3. 修掉样本时辰注释错位(#26)—— famous.ts 里 11 条名人样本有 7 条的时辰注释与 hour 索引不符(hour 一直是时辰地支索引 0–11,不是…

Renhuai123/ziwei-doushu on GitHub A short preview, not the full document.

Read the full README ↗ · Preview checked 2026-10-28T18:35:03.860Z

Inside the original README — Document outline
  1. 紫微斗数 · 开源排盘引擎
  2. 算法是公开的传统智慧,不应该被锁在围墙里
  3. 目录
  4. 一、本轮更新(2026-10-15)
  5. 上一轮更新(2026-09-21)
  6. 二·新、13 维解读数据集 v4.0(2026-10-15)
  7. 规格
  8. 下载与解压
  9. 引文说明
  10. 许可
  11. 二、51.8 万命盘样本数据集
  12. 2.1 数据规格

Headings are captured from the source. Links open the publisher’s document, not a locally hosted copy.

Links from the README

References supplied by the publisher, not independently verified endorsements. Check the destination before downloading files or entering credentials.

Documentation belongs to its respective authors. Reported project/model license: MIT. A listing is not a grant of reuse or training rights. Confirm the document’s own terms at the source.

What this repository does

紫微斗数开源排盘引擎 — 基于倪海厦《天纪》体系,含完整排盘算法、四化系统、格局知识库、古籍原文数据

Repository facts

Owner
Renhuai123
Primary language
TypeScript
Stars
11,857
Forks
2,332
Open issues + pull requests
6
License
MIT
Archived
No
Default branch
main
Created
2026-05-01T05:09:59.000Z
Last push
2026-10-20T08:20:05.000Z

Topics and intended use

Owner-supplied topics: bazi, chinese-astrology, divination, fortune-telling, nextjs, open-source, purple-star-astrology, typescript, zi-wei-dou-shu, ziwei-doushu

Review the README for scope, installation, examples and limitations. We do not run repository code or certify it.

Evaluate before installing

Review licensing and dependencies, inspect recent commits and unresolved issues, and test in an isolated environment before production use. Stars and forks alone cannot answer these questions.

README and project files

Issues and maintenance discussion

Releases and changelog

Source and freshness

Source: GitHub. Metadata observed 2026-10-31T12:14:20.184Z. Daily imports are snapshots, not real-time monitoring.

Popularity and source listings do not establish security, suitability, licensing rights or benchmark performance.

Open original source

Related repositories

freeCodeCamp/freeCodeCamp

morluto/rea

openclaw/openclaw

nilbuild/developer-roadmap

deepseek-ai/deepseek-harness

anomalyco/opencode