{"skill":{"slug":"bazi-calculator","displayName":"BaZi Calculator","summary":"Calculate a person’s Four Pillars (BaZi / Eight Characters) from birth date and time using sexagenary-cycle offsets from one trusted reference datetime that...","description":"---\nname: bazi-calculator\ndescription: 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.\n---\n\n# BaZi Calculator\n\nCalculate Year/Month/Day/Hour pillars with a **single reference point**.\n\n## Quick Start\n\n1. Use `references/reference-verified.json` (or your own verified reference JSON) with one trusted reference datetime and its four pillars.\n2. Run:\n\n```bash\npython3 scripts/calc_bazi.py \\\n  --birth \"1992-08-14 21:35\" \\\n  --tz \"Asia/Shanghai\" \\\n  --reference references/reference-verified.json \\\n  --gender male\n```\n\n3. Return results left-to-right as:\n- Hour pillar\n- Day pillar\n- Month pillar\n- Year pillar\n- Eight characters (Hour Day Month Year)\n\n## Workflow\n\n### 1) Validate inputs\n- Require birth datetime (`YYYY-MM-DD HH:MM`).\n- Require timezone (default `Asia/Shanghai` if omitted).\n- Require one reference JSON with:\n  - `reference_datetime`\n  - `reference_pillars.year/month/day/hour`\n\n### 2) Compute offsets from reference\n- Year offset: LiChun-adjusted year difference (approximation: Feb-04 00:00 local).\n- Month offset: calendar month difference.\n- Day offset: calendar day difference.\n- Hour offset: 2-hour bin difference (Zi starts at 23:00).\n\n### 3) Shift each base pillar in 60-cycle\n- `target_pillar = shift(reference_pillar, offset mod 60)` for year/month/day/hour separately.\n\n### 4) Present output\n\n```text\nBirth (local): 1992-08-14 21:35 (Asia/Shanghai)\nHour Pillar: 丙戌\nDay Pillar: 癸亥\nMonth Pillar: 丙申\nYear Pillar: 壬申\nEight Characters (L→R Hour/Day/Month/Year): 丙戌 癸亥 丙申 壬申\n```\n\n## Notes\n- This is a deterministic reference-based method.\n- Accuracy depends on correctness of the chosen reference and boundary rules.\n- For professional-grade astrology, validate solar-term boundaries and true solar time adjustments.\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":617,"installsAllTime":23,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1773246148899,"updatedAt":1778491832663},"latestVersion":{"version":"1.0.0","createdAt":1773246148899,"changelog":"Initial release with Four Pillars, DaYun, and LiuNian support","license":"MIT-0"},"metadata":null,"owner":{"handle":"wingchiu","userId":"s176egwp1q3t1bzz4ycgwvx8h983tx3t","displayName":"wingchiu","image":"https://avatars.githubusercontent.com/u/2759231?v=4"},"moderation":null}