spiceypy
A Python Wrapper for the NAIF CSPICE Toolkit
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 spiceypyuv
uv add spiceypypoetry
poetry add spiceypyInstalling 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
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
jplephemLoads and queries JPL ephemeris files (SPK…
permissive · top 5,000 on PyPI
ephemPyEphem computes high-precision positions of…
permissive · top 5,000 on PyPI
kerykeionKerykeion computes planetary and house…
copyleft · top 15,000 on PyPI
PySpicePySpice provides a Python interface to Ngspice…
copyleft · top 15,000 on PyPI
sunpySunPy provides Python tools for accessing,…
permissive · top 15,000 on PyPI
fprime-fppFPP is a modeling language and compiler for the…
permissive · top 15,000 on PyPI
skyfieldSkyfield computes high-precision positions for…
permissive · top 15,000 on PyPI
rdkit-pypiProvides precompiled wheels for Linux, macOS,…
permissive · top 15,000 on PyPI
mgrsConverts between MGRS (Military Grid Reference…
permissive · top 15,000 on PyPI