BaZi Chart Calculator (八字排盤)

👤 reed1898 📦 v1.0.0 ⭐ 4.2 ⬇️ 966 下載
📚 知識管理 免費

📖 技能介紹

八字排盤 (BaZi Chart Calculator)

Professional Four Pillars of Destiny calculator with astronomical precision.

Setup

cd <skill_dir>
python3 -m venv venv && source venv/bin/activate
pip install -r scripts/requirements.txt

Only dependency: ephem (astronomy library for solar term calculation).

Usage

# Text output (default)
python scripts/bazi.py --date 1990-08-18 --time 06:00 --city 上海 --gender male

# JSON output
python scripts/bazi.py --date 1990-08-18 --time 06:00 --city 上海 --gender male --format json

# With coordinates instead of city
python scripts/bazi.py --date 1990-08-18 --time 06:00 --lat 31.23 --lon 121.47 --gender male

# Disable true solar time correction
python scripts/bazi.py --date 1990-08-18 --time 06:00 --city 上海 --gender male --no-solar-correction

# Include annual luck (流年) for specific year
python scripts/bazi.py --date 1990-08-18 --time 06:00 --city 上海 --gender male --year 2026

What It Calculates

Feature Description
Four Pillars Year, Month, Day, Hour stems and branches
Solar Terms Precise astronomical calculation for month pillar boundaries
True Solar Time Longitude + equation of time correction (critical for western China)
Hidden Stems 本氣/中氣/餘氣 for each branch
Ten Gods All stem relationships relative to Day Master
Five Elements Weighted distribution (hidden stems: 60%/30%/10%) + Day Master strength
Major Luck Forward/reverse periods based on gender + year stem polarity
Relationships 六合, 三合, 六沖, 三刑, 六害, 天干五合, 天干衝

Built-in Cities

50+ Chinese cities with latitude/longitude. Pass --city 城市名 directly.

Agent Integration

When a user provides birth info in conversation, extract date/time/city/gender and run the CLI. Format the text output as a message. For deeper analysis questions, use JSON output and interpret the data.

本技能來自小蔥技能站7w4.net。

Module Structure

bazi/
├── scripts/bazi.py          # CLI entry point
├── lib/
│   ├── pillars.py           # Four pillar calculation
│   ├── solar_terms.py       # Solar term astronomy (ephem)
│   ├── true_solar_time.py   # True solar time correction
│   ├── hidden_stems.py      # Hidden stems table
│   ├── ten_gods.py          # Ten gods derivation
│   ├── five_elements.py     # Five elements analysis
│   ├── major_luck.py        # Major luck periods
│   ├── relationships.py     # Clash/combine/harm
│   ├── cities.py            # City coordinate lookup
│   └── constants.py         # Stems, branches, mappings
└── data/cities.json         # City database

🤖 AI 評測

整體質量良好,是一個功能全面的八字排盤工具。該 Skill 在節氣和時間修正上做得比較專業,能輸出四柱、十神、五行分佈、大運流年等豐富資訊,文本和JSON兩種輸出格式也很實用。不過目前更像一個"排盤計算器",對八字的分析解讀能力有限,缺少自動化的命盤分析結論。對於想深入瞭解八字的使用者來說,可能還需要結合其他工具使用。

📊 多維度評分

適應性4.2
規範性4
有效性4.3
可靠性4.1
可信度4.8

📁 包含檔案 (16 個)

📄 SKILL.md 3.2 KB
📄 _meta.json 129 B
📄 data/cities.json 2.7 KB
📄 lib/__init__.py 21 B
📄 lib/cities.py 1.2 KB
📄 lib/constants.py 3.2 KB
📄 lib/five_elements.py 3 KB
📄 lib/hidden_stems.py 863 B
📄 lib/major_luck.py 2.7 KB
📄 lib/pillars.py 5.8 KB
📄 lib/relationships.py 8 KB
📄 lib/solar_terms.py 6.5 KB
📄 lib/ten_gods.py 2.2 KB
📄 lib/true_solar_time.py 2.2 KB
📄 scripts/bazi.py 8.5 KB
📄 scripts/requirements.txt 13 B