Planetary zodiac position calculator supporting tropical, sidereal, and astronomical (IAU) coordinate systems.
- Sign lookup: Get which zodiac sign or constellation a planet occupies on any date
- Date range search: Find all periods when a planet was in a specific sign
- Three zodiac systems:
- Tropical (Western astrology, anchored to vernal equinox)
- Sidereal (Vedic astrology, with configurable ayanamsa)
- Astronomical (IAU constellation boundaries, includes Ophiuchus)
- Multiple output formats: Table, JSON, CSV
- Configurable precision: Day-level or minute-level accuracy
git clone <repository-url>
cd planetas
pip install -e .Planetas uses the Swiss Ephemeris for planetary calculations. Without external data files, it uses the built-in Moshier ephemeris as a fallback.
| Moshier (built-in) | JPL files (.se1) | |
|---|---|---|
| Accuracy | ~1 arc-second (Moon), few arc-seconds (planets) | Sub-arc-second |
| Date range | Any date | Depends on files installed |
| Setup | None required | Download files |
For most purposes, Moshier is sufficient. Install the JPL files if you need higher precision.
Option A: Download all files (recommended)
mkdir -p $HOME/.swisseph/ephe && cd $HOME/.swisseph/ephe
git clone --depth 1 --filter=blob:none --sparse https://github.com/aloistr/swisseph.git temp
cd temp && git sparse-checkout set ephe && mv ephe/* .. && cd .. && rm -rf tempOption B: Download specific files only
mkdir -p $HOME/.swisseph/ephe && cd $HOME/.swisseph/ephe
# Main planetary ephemeris (1800 CE - 2400 CE)
curl -O https://raw.githubusercontent.com/aloistr/swisseph/master/ephe/sepl_18.se1
curl -O https://raw.githubusercontent.com/aloistr/swisseph/master/ephe/semo_18.se1| File pattern | Coverage |
|---|---|
sepl_18.se1, semo_18.se1 |
1800 CE - 2400 CE |
sepl_06.se1, semo_06.se1 |
600 CE - 1200 CE |
sepl_-06.se1, semo_-06.se1 |
600 BCE - 1 BCE |
sepl_m54.se1, semo_m54.se1 |
5400 BCE - 4800 BCE |
Files are named by the starting century. Download the files covering your date range of interest.
Option 1: Environment variable (recommended)
export SWISSEPH_PATH=$HOME/.swisseph/epheAdd this to your shell configuration file to make it permanent:
# For bash
echo 'export SWISSEPH_PATH=$HOME/.swisseph/ephe' >> ~/.bashrc
# For zsh
echo 'export SWISSEPH_PATH=$HOME/.swisseph/ephe' >> ~/.zshrcThen reload your shell or run source ~/.bashrc (or ~/.zshrc).
Option 2: CLI flag
planetas --ephe-path /path/to/ephe sign -p jupiter -d 2025-06-15Option 3: Automatic detection
Planetas searches these locations in order:
SWISSEPH_PATHenvironment variable$HOME/.swisseph/ephe/usr/share/swisseph/ephe/usr/local/share/swisseph/ephe./ephe(current directory)
# All three systems (default)
planetas sign -p jupiter -d 2025-06-15
# Specific system
planetas sign -p mars -d "2025-01-01 12:00" -s sidereal
# With custom ayanamsa
planetas sign -p moon -d today -s sidereal -a fagan_bradleyExample output:
Jupiter position:
Date: 2025-06-15 00:00:00 UTC
Tropical: Cancer (0°42' in sign, 90°42'18.52" absolute)
Sidereal: Gemini (6°54' in sign, 66°54'22.31" absolute)
Astronomical: Gemini (90°42'18.52")
Find all periods when a planet occupied a specific sign:
# Table output (default)
planetas ranges -p jupiter -g aquarius -s 2000-01-01 -e 2030-12-31
# JSON output
planetas ranges -p saturn -g capricorn -s 2000-01-01 -e 2030-12-31 -f json
# CSV output to file
planetas ranges -p mars -g aries -s 2020-01-01 -e 2025-12-31 -f csv -o results.csv
# Specific system only
planetas ranges -p moon -g cancer -s 2025-01-01 -e 2025-12-31 --system tropicalTo show only dates (without times):
planetas --precision day ranges -p venus -g taurus -s 2025-01-01 -e 2025-12-31planetas list-planets # Show supported celestial bodies
planetas list-signs # Show zodiac signs and constellations
planetas list-ayanamsas # Show available ayanamsa systemsplanetas --help
planetas sign --help
planetas ranges --help| Variable | Description |
|---|---|
SWISSEPH_PATH |
Path to Swiss Ephemeris data files |
| Option | Description |
|---|---|
--precision minute |
Minute-level precision (default) |
--precision day |
Day-level precision (hides times in output) |
For sidereal calculations, the following ayanamsa systems are supported:
| Name | Description |
|---|---|
lahiri |
Lahiri (Indian Standard) - default |
fagan_bradley |
Fagan-Bradley (Western Sidereal) |
raman |
Raman |
krishnamurti |
Krishnamurti (KP) |
yukteshwar |
Yukteshwar |
jn_bhasin |
JN Bhasin |
deluce |
De Luce |
sassanian |
Sassanian |
galactic_center_0sag |
Galactic Center 0° Sagittarius |
true_citra |
True Chitra |
true_revati |
True Revati |
true_pushya |
True Pushya |
Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto
Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius, Capricorn, Aquarius, Pisces
Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpius, Ophiuchus, Sagittarius, Capricornus, Aquarius, Pisces
- All dates are interpreted as UTC
- Tropical zodiac is anchored to the vernal equinox (0° Aries = March equinox)
- Sidereal zodiac applies ayanamsa offset from tropical positions
- Astronomical positions use IAU constellation boundaries via Skyfield
- Planetary positions are geocentric (Earth-centered)
- BCE dates not supported: Negative years (e.g.,
-500) are interpreted as positive years (500 CE)
GPL-3.0 - See LICENSE for details.