Astro Transits
Full astrological transit calculator for AI agents. Calculates planetary positions, aspects to any natal chart, Moon phases, void-of-course periods, stations, and ingresses. Uses Swiss Ephemeris (pyswisseph) with Moshier fallback — no API key needed.
Setup
Install the dependency:
CODEBLOCK0
Generate a natal chart (one-time setup per user):
CODEBLOCK1
Parameters:
- -
--date — Birth date (YYYY-MM-DD) - INLINECODE1 — Birth time in 24h format (HH:MM)
- INLINECODE2 — Timezone name (e.g.
America/New_York, Europe/London, Australia/Brisbane) - INLINECODE6 /
--lon — Birth location coordinates - INLINECODE8 — Save chart to JSON file for reuse
Daily Transits
CODEBLOCK2
Returns: current planetary positions, active aspects to natal chart (ranked by significance), Moon sign/phase, stations, and ingresses. Top 8 aspects shown with orb, house placement, and interpretive meaning.
Weekly Forecast
CODEBLOCK3
Returns: top 3 most significant transits for the coming week with peak dates and themes.
Void-of-Course Moon
CODEBLOCK4
Returns JSON: {"voc": true/false} with end time, duration, and next Moon sign if currently void-of-course. No natal chart needed — this is a universal calculation.
What It Covers
- - Planets: Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, True Node
- Aspects: Conjunction, sextile, square, trine, opposition (with variable orbs for personal vs outer planets)
- Houses: Placidus house system
- Events: Planetary stations (retrograde/direct), sign ingresses
- Moon: Phase, sign, void-of-course detection
- Interpretations: Built-in aspect meanings for all planet-aspect combinations
Notes
- - No API key or external service required — all calculations run locally
- Swiss Ephemeris provides sub-arcsecond accuracy
- Falls back to Moshier ephemeris if Swiss Eph data files are absent
- Natal chart JSON can be generated once and reused indefinitely
- Timezone handling uses Python's
zoneinfo (Python 3.9+)
星体行运
面向AI智能体的完整占星行运计算器。计算行星位置、与本命盘的所有相位、月相、月亮空亡期、行星停滞期及入宫。使用瑞士星历(pyswisseph)并备选Moshier星历——无需API密钥。
环境配置
安装依赖项:
bash
pip install pyswisseph
生成本命盘(每位用户一次性设置):
bash
python3 {baseDir}/scripts/natal_chart.py \
--date 1993-05-13 \
--time 01:20 \
--tz Australia/Brisbane \
--lat -27.2308 --lon 153.0972 \
--save natal.json
参数说明:
- - --date — 出生日期(YYYY-MM-DD格式)
- --time — 出生时间(24小时制HH:MM格式)
- --tz — 时区名称(例如America/New_York、Europe/London、Australia/Brisbane)
- --lat / --lon — 出生地经纬度坐标
- --save — 将星盘保存为JSON文件以便重复使用
每日行运
bash
python3 {baseDir}/scripts/transits.py --chart natal.json
python3 {baseDir}/scripts/transits.py --chart natal.json --date 2026-03-15
返回内容:当前行星位置、与本命盘形成的活跃相位(按重要性排序)、月亮星座/月相、行星停滞期及入宫。显示前8个相位,包含容许度、宫位及解读含义。
周度预测
bash
python3 {baseDir}/scripts/transits.py --chart natal.json --week
返回内容:未来一周最重要的3个行运事件,附带峰值日期和主题。
月亮空亡期
bash
python3 {baseDir}/scripts/voc_check.py
返回JSON格式:{voc: true/false},若当前处于月亮空亡期则附带结束时间、持续时长及下一个月亮星座。无需本命盘——此为通用计算。
涵盖内容
- - 行星: 太阳、月亮、水星、金星、火星、木星、土星、天王星、海王星、冥王星、真交点
- 相位: 合相、六分相、四分相、三分相、对分相(个人行星与外行星采用可变容许度)
- 宫位: 普拉西度宫位制
- 事件: 行星停滞期(逆行/顺行)、星座入宫
- 月亮: 月相、星座、空亡期检测
- 解读: 内置所有行星-相位组合的含义
注意事项
- - 无需API密钥或外部服务——所有计算均在本地运行
- 瑞士星历提供亚角秒级精度
- 若缺少瑞士星历数据文件,则自动切换至Moshier星历
- 本命盘JSON文件可一次性生成并无限次重复使用
- 时区处理使用Python的zoneinfo模块(Python 3.9+版本)