skillfed

jplephem

Use a JPL ephemeris to predict planet positions.

jplephem v2.24 819.2K downloads/30d#4,977 on PyPI126
Permissive license MIT AGING released

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 jplephem

uv

uv add jplephem

poetry

poetry add jplephem

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Scientific/Engineering :: Astronomy

Tags

JPL ephemeris readerplanet position predictionSPK file parsersolar system body coordinatesephemeris computationcelestial mechanics dataorbital position calculator
astronomyephemerisorbital-mechanics

More Astronomy packages