Skip to main content

JPL Moshier Ephemeris Python

PyPI version Downloads Python Versions License: MIT AND CeCILL-B Wheel Status

Pure Python ctypes runtime FFI binding for the project-owned JPL Moshier Ephemeris C library.

This package wraps the native jme_* API directly. It is intended to be a true raw I/O surface: no recalculation, no normalization, no rounding, no reshaping, no dropped buffers, and no hidden status conversion.

Python setup and the shared function list are in the native library's single reference: https://jayeshmepani.github.io/jpl-ephemeris/#lang-py.

Contract

  • Primary public functions: jme_*
  • Primary public constants: JME_*
  • Current wrapper target: all 225 public jme_* functions tracked by the native API inventory
  • Current constant target: 478 public JME_* constants, plus the two header include guards JME_JME_H and JME_EXTENDED_H
  • Native runtimes bundled in the wheel: jme plus calceph
  • No CPython extension module; pure Python loader plus bundled native libraries
  • Argument order, pointer ownership, output buffers, and return values are kept as-is from the native C API

JME 2.0.0 upgrade note

Extended-body identifiers now use JME's negative identifier range, separate from the core body identifiers. Applications that stored the old numeric values must migrate to the corresponding JME_BODY_* constants. Function signatures are unchanged.

Installation

pip install jmeph-ffi

End users do not need to download native binaries manually. The package ships its bundled jme and calceph runtimes inbuilt inside the wheel.

Native Libraries

The package bundles the same prebuilt runtimes as the PHP wrapper:

  • linux-x64/libjme.so
  • linux-x64/libcalceph.so
  • linux-arm64/libjme.so
  • linux-arm64/libcalceph.so
  • macos-x64/libjme.dylib
  • macos-x64/libcalceph.dylib
  • macos-arm64/libjme.dylib
  • macos-arm64/libcalceph.dylib
  • windows-x64/jme.dll
  • windows-x64/calceph.dll

The local/PHP release source below is for maintainers and package build refresh only, not for normal users.

Local source for those prebuilt runtimes during development:

Copy from a local checkout of jpl-moshier-ephemeris-php/libs

Published runtime source:

https://github.com/jayeshmepani/jpl-moshier-ephemeris-php/releases/tag/prebuilt-libs

You can override discovery with:

  • JME_LIBRARY_PATH
  • JME_CALCEPH_LIBRARY_PATH

Search order:

  1. explicit environment override
  2. bundled src/jpl_moshier_ephemeris/libs/<platform>/
  3. common system library paths

Quick Start

from jpl_moshier_ephemeris import (
    JME_BODY_SUN,
    JME_CALC_SPEED,
    JME_CALENDAR_GREGORIAN,
    JmeEph,
    c_double,
    create_string_buffer,
)

jme = JmeEph()

jd = jme.jme_julian_day(2000, 1, 1, 12.0, JME_CALENDAR_GREGORIAN)
xx = (c_double * 6)()
err = create_string_buffer(256)

rc = jme.jme_calc_ut(jd, JME_BODY_SUN, JME_CALC_SPEED, xx, err)
print(rc, list(xx), err.value.decode())

Development

python -m pip install -e ".[dev]"
python scripts/fetch_prebuilt.py
python -m ruff check .
python -m ruff format . --check
python -m pyright
python -m pytest
python -m build
python -m twine check dist/*

The test suite verifies:

  • 225/225 configured ctypes function signatures
  • 478 public JME_* constants plus the two header include guards, generated from the native headers
  • import and runtime loading
  • basic native contract calls such as version, Julian day conversion, calculation, houses, ayanamsa, Delta-T, split-degree, body naming, and refraction
  • optional source-surface audit against the local native jpl-ephemeris- tree

Credits

This package is a binding for JPL Moshier Ephemeris (JME) by Jayesh Mepani (Jayesh Patel). JME builds on:

  • JPL DE440 / DE441 ephemerides (NASA/JPL; Park et al. 2021). Kernels are downloaded separately and are redistributed unmodified per the NAIF rules.
  • CALCEPH 5.0.1 (Copyright CNRS, Observatoire de Paris, Observatoire de la Côte d'Azur), used under the CeCILL-B license. Prebuilt CALCEPH runtime libraries are bundled unmodified; license text in LICENSES/CeCILL-B.txt; provided without warranty (CeCILL-B Articles 8 and 9); source code at https://calceph.imcce.fr/.
  • Stephen L. Moshier: plan404 and Astronomical Almanac 5.6 analytical theories (Moshier engine). MIT License by permission of the author (12 October 2026; record). Portions derived from the work of Stephen L. Moshier, incorporated herein by permission of the author.
  • ELP 2000-82B by M. Chapront-Touzé and J. Chapront (CDS VI/79), evaluated by JME's own code generated from the unmodified CDS files.
  • VSOP87 by P. Bretagnon and G. Francou (CDS VI/81); C code from Greg A. Miller's VSOP87-Multilang (public domain dedication).
  • Jean Meeus, Astronomical Algorithms (formulas cited); F. Espenak and J. Meeus (NASA) ΔT polynomials; ERFA (BSD 3-Clause, NumFOCUS Foundation) IAU 2000B nutation; Yale Bright Star Catalogue (Hoffleit and Warren).

Full credits, terms, and required notice texts: THIRD_PARTY_NOTICES.md.

License

Package license: MIT AND CeCILL-B.

  • The original code in this repository (the Python ctypes binding, tests and scripts) is licensed under the MIT License, Copyright (c) 2026 Jayesh Mepani (Jayesh Patel). The LICENSE file contains only the MIT text for that code.
  • The bundled prebuilt CALCEPH 5.0.1 runtime libraries are licensed under CeCILL-B; the full text is in LICENSES/CeCILL-B.txt.
  • The bundled JME runtime libraries contain the Moshier material (plan404, AA 5.6), which is distributed under the MIT License by permission of Stephen L. Moshier, 12 October 2026 (permission record). Portions derived from the work of Stephen L. Moshier, incorporated herein by permission of the author.

Third-party components keep their own terms; see THIRD_PARTY_NOTICES.md.

Metadata

Release files for jmeph-ffi 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jmeph-ffi 2.0.0
File Size Uploaded
jmeph_ffi-2.0.0.tar.gz 20.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for jmeph-ffi 2.0.0
File Interpreter ABI Platform
jmeph_ffi-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.8 MB

Release files / jmeph_ffi-2.0.0.tar.gz

Download URL jmeph_ffi-2.0.0.tar.gz
Size 20.8 MB
Tags Source
SHA-256 checksum
How to use checksums
8e2d9eeed78bcb879e7c594a82e9e7d76143644670c2b096d336a26864ee3059
BLAKE2b-256 checksum
How to use checksums
0d0f1c310eabbaa75151a194aebd3d1f4afd096ca4de0316583ee6cb90fcec70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / jmeph_ffi-2.0.0-py3-none-any.whl

Download URL jmeph_ffi-2.0.0-py3-none-any.whl
Size 21.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0b116dd8b7622e7e2a33598642205ab9fd6504a12027cf1964b4f7e6bdcf5a94
BLAKE2b-256 checksum
How to use checksums
a5c45202ffebdb50d030bf110b2683cceb4dec04944f92e992bb9a45c95f1b13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page