← 返回
数据分析

BaZi Chart Calculator (八字排盘)

Professional BaZi (八字) chart calculator and analysis tool. Calculate Four Pillars of Destiny from birth date, time, and location. Features precise solar term...
Professional BaZi (八字) chart calculator and analysis tool. Calculate Four Pillars of Destiny from birth date, time, and location. Features precise solar term...
reed1898
数据分析 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 585
下载
💾 43
安装
1
版本
#latest

概述

八字排盘 (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

FeatureDescription
----------------------
Four PillarsYear, Month, Day, Hour stems and branches
Solar TermsPrecise astronomical calculation for month pillar boundaries
True Solar TimeLongitude + equation of time correction (critical for western China)
Hidden Stems本气/中气/余气 for each branch
Ten GodsAll stem relationships relative to Day Master
Five ElementsWeighted distribution (hidden stems: 60%/30%/10%) + Day Master strength
Major LuckForward/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.

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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 22:17 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 65,156
productivity

Reminder

reed1898
捕获自然语言事件,保存至工作区,安排 Telegram 提醒,自动 cron 通知并查询即将到来的事件。
★ 9 📥 10,373
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,565