Try Astrologer API

Subscribe to support and grow the project.

v1.0.0 · Stable Release

NASA-precise
Astrological Ephemeris

High-precision planetary positions, house systems, eclipses, and more, computed directly from NASA JPL DE440/DE441 ephemerides. API-compatible with Swiss Ephemeris. Pure Python, type-safe, and thread-safe.

Compatible with the Swiss Ephemeris API

Already using pyswisseph? Change one line, keep everything else.

pyswisseph
import swisseph as swe

swe.set_ephe_path("/usr/share/ephe")
jd = swe.julday(2000, 1, 1, 12.0)
pos, flag = swe.calc_ut(jd, swe.SUN, swe.FLG_SPEED)
cusps, ascmc = swe.houses(jd, 41.9, 12.5, b"P")
libephemeris
import libephemeris as swe

# No ephemeris path needed
jd = swe.julday(2000, 1, 1, 12.0)
pos, flag = swe.calc_ut(jd, swe.SUN, swe.FLG_SPEED)
cusps, ascmc = swe.houses(jd, 41.9, 12.5, b"P")

Why LibEphemeris?

Powered by NASA JPL Data

Every calculation is grounded in the JPL DE440/DE441 planetary ephemerides, the gold standard in positional astronomy, developed by NASA's Jet Propulsion Laboratory for interplanetary navigation. No analytical approximations, no fallback to simplified theories.

Scientific & Astrological Precision

Outer planet positions are automatically corrected from system barycenters to physical planet centers using dedicated JPL SPK kernels. Lunar apsides are derived from actual physical distance extrema in JPL data, not truncated analytical series.

Current IAU Standards

Precession and nutation follow IAU 2006/2000A models via pyerfa. Delta T uses Stephenson, Morrison & Hohenkerk (2016) with optional IERS observed data, the current astronomical standard for historical timescale conversion.

Drop-in Swiss Ephemeris Replacement

Full 1:1 API compatibility with pyswisseph. All `swe_*` functions, `SE_*` constants, and calculation flags work identically. Migrate existing code by changing a single import line. Your calculations gain NASA JPL precision with zero refactoring.

What you can compute

Planetary Positions

Sun, Moon, Mercury through Pluto with geocentric, heliocentric, and topocentric coordinates. Longitude, latitude, distance, and daily velocities.

25 House Systems

Placidus, Koch, Whole Sign, Equal, Regiomontanus, Campanus, Porphyry, Alcabitius, Morinus, and 16 more across 26 character codes. Independently verified against pyswisseph. Includes polar latitude fallback.

Solar & Lunar Eclipses

Global and local search, Besselian elements, contact points, path geometry, central line, magnitude, obscuration, and Saros/Inex series.

100+ Fixed Stars

Hipparcos-based catalog with rigorous space motion propagation. Royal stars, Pleiades, zodiacal constellations, and more.

35+ Minor Bodies

Main-belt asteroids, centaurs (Chiron, Pholus, Nessus), and TNOs (Eris, Sedna, Makemake) via Keplerian model or SPK kernels.

Lunar Nodes & Lilith

Mean and osculating ascending node. Mean and true Black Moon Lilith. Interpolated apogee and perigee calibrated against DE441.

Precision Tiers

From modern horoscopes to archeoastronomy. Choose your range.
Three precision tiers map to different JPL kernels. DE440 and DE441 have identical precision; DE441 is simply the extended-range version.

Tier Kernel Date Range Size Use Case
Base (default) de440s.bsp 1849 – 2150 ~31 MB Lightweight web apps, contemporary calculations
Medium de440.bsp 1550 – 2650 ~128 MB General purpose, historical astrology
Extended de441.bsp 13,200 BC – 17,191 AD ~3.1 GB Archeoastronomy, deep historical research
Thread-Safe Design

Thread-safe when you need it

Keep the familiar Swiss Ephemeris style API for scripts and notebooks. When you're running a web server, workers, or anything concurrent, use EphemerisContext.

  • Isolated configuration per request (topo, flags, precision tier).
  • No shared global state between threads.
from libephemeris import EphemerisContext, SE_SUN

ctx = EphemerisContext()
ctx.set_topo(12.5, 41.9, 0)
pos, _ = ctx.calc_ut(2451545.0, SE_SUN, 0)

Ready to start?

Install in seconds, then pick your coverage. The default base tier keeps downloads small and works for modern dates.

© 2026 Giacomo Battaglia Part of the Kerykeion project