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
Metadata
Release files for spice-kernel-db 0.20.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spice_kernel_db-0.20.0.tar.gz | 173.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spice_kernel_db-0.20.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 245.0 kB
Release files / spice_kernel_db-0.20.0.tar.gz
| Download URL | spice_kernel_db-0.20.0.tar.gz |
|---|---|
| Size | 173.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5033cfa8fa9664de23e53d2258a7dc367b5dcfe5b7f83eb1300035b9d23f4c2c
|
|
BLAKE2b-256 checksum How to use checksums |
9064b424c851d3c9e8823066dcecd7a4e9cf164b97bdb0fa729a80e841c185bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / spice_kernel_db-0.20.0-py3-none-any.whl
| Download URL | spice_kernel_db-0.20.0-py3-none-any.whl |
|---|---|
| Size | 71.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fbbb01502a523a1fea0cdb7c2a0d9e98f9efa16bd7125964f1f79c5d33128e2d
|
|
BLAKE2b-256 checksum How to use checksums |
8dbcdcde21499809bbdea694e021141a18770ff4f677357e87edbf959650cc09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|