SuperAPI AI Directory

white-whale-bazi

White Whale Bazi is an open-source deterministic BaZi and Liuyao charting engine, offering true solar time astronomical calendar calculations, retrieval from the public-domain texts Qiong Tong Bao Jian and Di Tian Sui, Jing Fang Najia Liuyao hexagram casting, and zero-dependency MCP Server and Agent Skill integration. The project aims to replace large language model probabilistic hallucinations with code-level rule chains, supports CLI, MCP, and Python API invocation, and includes an offline demo page.

Open website

About this tool

White Whale Bazi (white-whale-bazi) is an open-source deterministic BaZi and Liuyao charting engine whose core goal is to replace the probabilistic hallucinations and disclaimer boilerplate of large language models in destiny charting with code-level rule chains. The project adopts a "deterministic astronomy and four-lineage rule chain + real-time cross-derivation" architecture, includes a BaZi and decision system calibrated on 823 real questions, and jointly references the four lineages of Di Tian Sui, Qiong Tong Bao Jian, Zi Ping Zhen Quan, and the blind school's work-and-function (gong-zuo) method.

Main capabilities include:

  1. True solar time astronomical calendar: a pure Python standard library hand-written VSOP87D solar geocentric apparent ecliptic longitude solver, with solar term transition accuracy aligned to the Purple Mountain Observatory to the second; built-in offline coordinates for 400 Chinese and foreign cities, automatic handling of the 1986–1991 Chinese historical daylight saving time rollback, and support for equation of time correction and early/late Zi hour switching.
  2. Four Pillars BaZi charting: outputs the four pillars matrix, Ten Gods, hidden stems, gods and spirits, and ten-step major luck cycles, and automatically retrieves clauses from the public-domain Di Tian Sui on the body images of the ten heavenly stems and from Qiong Tong Bao Jian on the ten stems × twelve monthly commands (all 120 combinations).
  3. Liuyao hexagram casting: supports the full Jing Fang Najia chart with three copper coins, returning the original hexagram, nuclear hexagram, changed hexagram, shi/ying lines, six relatives, six spirits, hidden spirits, day branch, xun void, month break, and the public-domain Zhou Yi hexagram and image texts for all 64 hexagrams.
  4. MCP Server and Agent Skill: provides a standard stdio MCP service with zero third-party runtime dependencies, mountable to hosts such as Claude Desktop, Claude Code, and Cursor, exposing two deterministic tools, calculate_true_solar_bazi and cast_liuyao_hexagram; it also provides an Agent Skill specification that forces agents to check the true calendar values before answering.
  5. Offline demo: demo/index.html is a single-file offline verification console that can compare the charting differences between uncalibrated mean solar time and true solar time, and retrieve original ancient text passages.

Usage: after cloning the repository, install via pip or uv, and you can run commands such as ww-bazi chart, ww-bazi liuyao, and ww-bazi compare-solar in the terminal; you can also write the MCP configuration into the host configuration file, or copy SKILL.md to the project's .claude/skills/ or .agents/skills/ directory.

Applicable scenarios: learners and developers of Four Pillars BaZi and Liuyao building a charting foundation or AI plugin, and destiny research scenarios requiring deterministic calendar calculation and ancienttext clause retrieval.

Limitations: the open-source repository only includes calendar charting and public-domain ancient text retrieval, and does not include the online complete system's four-lineage disease-and-remedy conflict adjudication, exceptional-pattern rescue reasoning, asset quantitative models, dual-mode vernacular compilation, and 15-page PDF report typesetting; complete derivation requires visiting baijingce.com. The project uses the MIT license, permitting free commercial use, modification, and redistribution.