🦀 ClawHub
BaZi Calculator
by @wingchiu
Calculate a person’s Four Pillars (BaZi / Eight Characters) from birth date and time using sexagenary-cycle offsets from one trusted reference datetime that...
TERMINAL
clawhub install bazi-calculator📖 About This Skill
name: bazi-calculator description: Calculate a person’s Four Pillars (BaZi / Eight Characters) from birth date and time using sexagenary-cycle offsets from one trusted reference datetime that already has known year/month/day/hour pillars. Also calculate DaYun (10-year luck cycles) when gender is provided, and include the current LiuNian (流年) Ganzhi. Use when user asks for BaZi pillars, eight characters, stem-branch pillar calculation, DaYun, or current LiuNian.
BaZi Calculator
Calculate Year/Month/Day/Hour pillars with a single reference point.
Quick Start
1. Use references/reference-verified.json (or your own verified reference JSON) with one trusted reference datetime and its four pillars.
2. Run:
python3 scripts/calc_bazi.py \
--birth "1992-08-14 21:35" \
--tz "Asia/Shanghai" \
--reference references/reference-verified.json \
--gender male
3. Return results left-to-right as:
Workflow
1) Validate inputs
YYYY-MM-DD HH:MM).Asia/Shanghai if omitted).reference_datetime
- reference_pillars.year/month/day/hour2) Compute offsets from reference
3) Shift each base pillar in 60-cycle
target_pillar = shift(reference_pillar, offset mod 60) for year/month/day/hour separately.4) Present output
Birth (local): 1992-08-14 21:35 (Asia/Shanghai)
Hour Pillar: 丙戌
Day Pillar: 癸亥
Month Pillar: 丙申
Year Pillar: 壬申
Eight Characters (L→R Hour/Day/Month/Year): 丙戌 癸亥 丙申 壬申
Notes
💡 Examples
1. Use references/reference-verified.json (or your own verified reference JSON) with one trusted reference datetime and its four pillars.
2. Run:
python3 scripts/calc_bazi.py \
--birth "1992-08-14 21:35" \
--tz "Asia/Shanghai" \
--reference references/reference-verified.json \
--gender male
3. Return results left-to-right as: