skillfed

spiceypy

A Python Wrapper for the NAIF CSPICE Toolkit

spiceypy v8.2.0 210.8K downloads/30d#9,488 on PyPI483
Permissive license MIT Active released

What it is and what it does

SpiceyPy is a Python wrapper around the NAIF SPICE Toolkit, a C library developed by NASA's Jet Propulsion Laboratory for computing positions, orientations, and geometric relationships of celestial bodies and spacecraft. It uses ctypes and Cython to expose SPICE functions to Python, allowing scientists and engineers to query ephemeris data, transform between coordinate frames, and compute lighting geometry without writing C code.

The package is production-stable (Development Status 5) and actively maintained. It depends only on numpy and requires Python 3.10 or later. Precompiled wheels cover modern Linux, macOS, and Windows architectures, reducing installation friction. The NAIF now distributes official Python lessons using SpiceyPy, signaling institutional support. Users must obtain and load SPICE kernel files (ephemeris, leap-second, and planetary constants data) separately; the package itself is a compute interface, not a data distribution.

Use it for:

  • Compute spacecraft position and velocity at a given time for mission planning or analysis.
  • Transform coordinates between spacecraft, planetary, and inertial reference frames.
  • Calculate lighting geometry (e.g., solar illumination angles) for instrument planning.
  • Query planetary body positions and orientations for orbital mechanics simulations.
  • Validate or supplement trajectory data in multi-body dynamics software.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

SpiceyPy wraps the NAIF C SPICE Toolkit to compute Solar System geometry, ephemeris, and coordinate transformations for planetary science applications.

Yes. SpiceyPy is production-stable, actively maintained, has no known vulnerabilities, and is the standard Python interface to SPICE in the planetary science community. Install friction is moderate due to compiled dependencies, but precompiled wheels for modern Python versions (3.10–3.13) and common architectures minimize friction. The MIT license is permissive. Install if you need Solar System geometry or ephemeris calculations; skip if you do not work in planetary science or spacecraft operations.

Install

spiceypy on PyPI

pip

pip install spiceypy

uv

uv add spiceypy

poetry

poetry add spiceypy

Installing spiceypy

Before you install

Precompiled wheels available for Python 3.10–3.13 across Linux (x86_64, aarch64), macOS (x86_64, arm64), and Windows; medium install friction reflects the compiled C dependency. Actively maintained with a release 21 days old and recent commits.

License in practice

MIT license permits commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install spiceypy
import spiceypy as sp
sp.furnsh('path/to/kernel.bsp')
position, _ = sp.spkgeo(target_id, et, frame, observer_id)

SPICE kernel files (.bsp, .tls, .pck) must be obtained separately from NAIF and furnished before most computations.

Verify before relying

  • Whether kernel data files are included or must be downloaded separately from NAIF.
  • Performance characteristics for large-scale ephemeris queries or real-time applications.
  • Compatibility with concurrent or async workflows.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 21 days since the last release
Last repo commit
First released
Downloads 210,766/month — #9,488 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: spiceypy-8.2.0-cp310-cp310-macosx_10_9_x86_64.whl; spiceypy-8.2.0-cp310-cp310-macosx_11_0_arm64.whl; spiceypy-8.2.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; spiceypy-8.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; spiceypy-8.2.0-cp310-cp310-win_amd64.whl; spiceypy-8.2.0-cp311-cp311-macosx_10_9_x86_64.whl; spiceypy-8.2.0-cp311-cp311-macosx_11_0_arm64.whl; spiceypy-8.2.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; spiceypy-8.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; spiceypy-8.2.0-cp311-cp311-win_amd64.whl; spiceypy-8.2.0-cp312-cp312-macosx_10_13_x86_64.whl; spiceypy-8.2.0-cp312-cp312-macosx_11_0_arm64.whl; spiceypy-8.2.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; spiceypy-8.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; spiceypy-8.2.0-cp312-cp312-win_amd64.whl; spiceypy-8.2.0-cp313-cp313-macosx_10_13_x86_64.whl; spiceypy-8.2.0-cp313-cp313-macosx_11_0_arm64.whl; spiceypy-8.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; spiceypy-8.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; spiceypy-8.2.0-cp313-cp313-win_amd64.whl

Keywords: spiceypy, spice, cspice, naif, jpl, space, geometry, ephemeris

Development Status :: 5 - Production/StableNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: BSD :: FreeBSDOperating System :: POSIX :: LinuxProgramming Language :: CythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Astronomy

Tags

solar system geometry calculationsephemeris and trajectory dataspacecraft position and orientationcoordinate frame transformationsplanetary science toolkitspice toolkit python wrappernaif cspice interface
space-mission-planningephemeris-toolkitcoordinate-transforms

More Scientific/Engineering packages