jplephem
Use a JPL ephemeris to predict planet positions.
What it is and what it does
jplephem is a low-level library for reading and querying binary Satellite Planet Kernel (SPK) files produced by NASA's Jet Propulsion Laboratory. It loads ephemeris data—precomputed positions and velocities of planets, moons, and other Solar System bodies—and allows you to compute their coordinates at any Julian date within the file's coverage range. The package supports three SPK data types: Chebyshev polynomial representations (Types 2 and 3) and discrete position/velocity pairs with linear interpolation (Type 9).
The library is designed for astronomers and space mission planners who need raw three-dimensional vectors in the Solar System's reference frame. It includes command-line tools to inspect ephemeris file contents, extract date ranges, and filter by target body codes. Most users working in Python astronomy will want to layer this with a higher-level package like Skyfield, which converts the raw vectors into traditional astronomical measurements such as right ascension and declination.
Use it for:
- Compute heliocentric or geocentric positions of planets for mission planning or trajectory analysis.
- Extract a subset of a large ephemeris file covering only a specific date range to reduce download size.
- Inspect the contents and metadata of an SPK file from the command line without writing code.
- Build custom astronomical calculations that require raw Solar System body coordinates in kilometers.
- Fetch ephemeris data on-demand from remote JPL servers, downloading only the blocks needed for your date range.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Loads and queries JPL ephemeris files (SPK format) to compute positions and velocities of planets and Solar System bodies at specified Julian dates.
Yes, if you need raw JPL ephemeris data in Python and are comfortable managing external SPK files. The package is stable, has no known vulnerabilities, and installs with minimal friction. However, most astronomy workflows will benefit from using a higher-level library like Skyfield instead, which wraps jplephem and provides more intuitive coordinate transformations.
Install
jplephem on PyPI
pip
pip install jplephemuv
uv add jplephempoetry
poetry add jplephemInstalling jplephem
Before you install
Low friction: pure Python wheel with only numpy as a runtime dependency. Repository is actively maintained with recent commits; classifiers indicate stable production status, though the package is aging relative to its initial 2012 release.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely in commercial or private projects with minimal restrictions.
Quickstart
from jplephem.spk import SPK
from jplephem.calendar import compute_julian_date
kernel = SPK.open('de421.bsp')
jd = compute_julian_date(2015, 2, 8)
position = kernel[0, 4].compute(jd) # Solar System barycenter to Mars
Requires a JPL SPK ephemeris file (e.g., de421.bsp) downloaded separately from NASA JPL; file format and availability depend on external sources.
Verify before relying
- Whether the package supports Python versions beyond 3.8 despite classifiers listing only up to 3.8.
- Current performance characteristics when working with very large ephemeris files or high-frequency queries.
- Compatibility with modern numpy versions and any breaking changes in recent releases.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | aging — 203 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 819,201/month — #4,977 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jplephem-2.24-py3-none-any.whl
Tags
More Astronomy packages
Albumentations applies image transformations to…
permissive · top 5,000 on PyPI
convertdateConverts dates between the Gregorian calendar…
permissive · top 5,000 on PyPI
jdcalConverts between Julian dates and Gregorian or…
permissive · top 5,000 on PyPI
pyerfaPyERFA wraps the ERFA C library (Essential…
permissive · top 5,000 on PyPI
PyMeeusPyMeeus implements astronomical algorithms from…
copyleft · top 5,000 on PyPI
ephemPyEphem computes high-precision positions of…
permissive · top 5,000 on PyPI
spiceypySpiceyPy wraps the NAIF C SPICE Toolkit to…
permissive · top 15,000 on PyPI
sgp4Computes satellite positions in Earth orbit…
permissive · top 5,000 on PyPI
skyfield-dataProvides pre-packaged astronomical data files…
permissive · top 15,000 on PyPI
skyfieldSkyfield computes high-precision positions for…
permissive · top 15,000 on PyPI
kerykeionKerykeion computes planetary and house…
copyleft · top 15,000 on PyPI
pyorbitalPyorbital computes orbital parameters from TLE…
permissive · top 15,000 on PyPI