Browse, get, and manage SPICE kernels and metakernels across NASA and ESA mission archives
Project description
spice-kernel-db
Browse, get, and manage SPICE kernels and metakernels across NASA and ESA mission archives.
⚠️ CRITICAL: Update to v0.10.0 or later. Versions before 0.10.0 contained a fuzzy filename matching bug that could silently create symlinks between completely different SPICE kernel files, causing silent scientific data corruption — SPICE loads valid but wrong data with no errors. All users who used
spice-kernel-db getorspice-kernel-db updateare affected, regardless of the dedup setting — the symlink creation code did not honor the per-mission dedup flag (also fixed in 0.10.0). Users who only usedscanandresolveare not affected. After updating, remove all symlinks in your kernel directories and re-runspice-kernel-db update. See CHANGELOG.md for recovery steps.
What this tool does
-
Mission setup: Configure missions from NASA NAIF or ESA SPICE servers with an interactive dialog.
-
Browse & get: Browse available metakernels for a mission, then get one — the tool downloads all missing kernels automatically and makes the metakernel ready to use locally.
-
Metakernel rewriting: Rewrites
.tmfiles for local use with minimal edits — onlyPATH_VALUESis changed, everything else stays identical to the original. A symlink tree bridges the gap between where the metakernel expects files and where they actually live on disk. -
Deduplication (optional): Identifies identical kernel files across missions using SHA-256 hashing and replaces duplicates with symlinks. Per-mission opt-in — you can deduplicate some missions while keeping others untouched.
Documentation
Full documentation is at michaelaye.github.io/spice-kernel-db and built with Quarto.
Installation
pip install spice-kernel-db
Or with conda:
conda install -c michaelaye spice-kernel-db
Or from source:
git clone https://github.com/michaelaye/spice-kernel-db
cd spice-kernel-db
pip install -e ".[dev]"
Quick start
Set up a mission
spice-kernel-db mission add
Interactive dialog: choose a server (NASA NAIF / ESA SPICE) → pick a mission from the list → configure deduplication preference.
Browse available metakernels
spice-kernel-db browse JUICE
Shows all .tm files in the mission's remote mk/ directory, grouped by base name with version counts.
Get a metakernel
spice-kernel-db get juice_ops.tm
Downloads the metakernel, checks which kernels you already have, downloads the missing ones in parallel, and creates symlinks so the .tm file works immediately.
Use with spiceypy
import spiceypy as spice
from spice_kernel_db import KernelDB
db = KernelDB()
mks = db.list_metakernels(mission="JUICE")
spice.furnsh(mks[0]["mk_path"])
Python API
from spice_kernel_db import KernelDB
db = KernelDB()
# Browse remote metakernels
db.browse_remote_metakernels(
"https://naif.jpl.nasa.gov/pub/naif/JUICE/kernels/mk/",
mission="JUICE",
)
# Get a metakernel (downloads missing kernels automatically)
db.get_metakernel(
"https://naif.jpl.nasa.gov/pub/naif/JUICE/kernels/mk/juice_ops.tm",
mission="JUICE",
)
# Optionally deduplicate across missions
db.deduplicate_with_symlinks(dry_run=True) # preview
db.deduplicate_with_symlinks(dry_run=False) # execute
Supported servers
| Server | URL |
|---|---|
| NASA NAIF | https://naif.jpl.nasa.gov/pub/naif/ |
| ESA SPICE | https://spiftp.esac.esa.int/data/SPICE/ |
Both use the same <server>/<MISSION>/kernels/mk/ directory structure.
Dependencies
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spice_kernel_db-0.10.1.tar.gz.
File metadata
- Download URL: spice_kernel_db-0.10.1.tar.gz
- Upload date:
- Size: 90.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
788ec28d6da0ff6cf3c74557ab1fd9e0189ffbefb3257627291c77f7eb6b9a0a
|
|
| MD5 |
396db69a4985202de4749bfdb98181fc
|
|
| BLAKE2b-256 |
925daa89cedaed10fec4509a4288ada462a3df5732ea40f0d059fb23ce74eedd
|
File details
Details for the file spice_kernel_db-0.10.1-py3-none-any.whl.
File metadata
- Download URL: spice_kernel_db-0.10.1-py3-none-any.whl
- Upload date:
- Size: 42.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7fb9acb69d7a06a6adc2056e6778d4b7578f1c23a1ba196c7a82b2579383d59
|
|
| MD5 |
a5aa13ee09d73d21079cebc69599c168
|
|
| BLAKE2b-256 |
4f620fab8269bbbadfcfd652a454548b61b1fdee76b6a84e0d8d8d14b0e91948
|