Pure Python ctypes FFI wrapper for the JPL Moshier Ephemeris native library with direct jme_* API access and bundled jme plus calceph runtimes
Project description
JPL Moshier Ephemeris Python
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.
Contract
- Primary public functions:
jme_* - Primary public constants:
JME_* - Current wrapper target: all
204publicjme_*functions tracked by the native API inventory - Current constant target: all
462publicJME_*constants from the native headers - Native runtimes bundled in the wheel:
jmepluscalceph - 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
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.solinux-x64/libcalceph.solinux-arm64/libjme.solinux-arm64/libcalceph.somacos-x64/libjme.dylibmacos-x64/libcalceph.dylibmacos-arm64/libjme.dylibmacos-arm64/libcalceph.dylibwindows-x64/jme.dllwindows-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_PATHJME_CALCEPH_LIBRARY_PATH
Search order:
- explicit environment override
- bundled
src/jpl_moshier_ephemeris/libs/<platform>/ - 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:
204/204configured ctypes function signatures462/462generatedJME_*constants- 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
License
MIT. The Python package and the project-owned JME native library are intended to remain under MIT-compatible distribution.
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 jmeph_ffi-1.0.0.tar.gz.
File metadata
- Download URL: jmeph_ffi-1.0.0.tar.gz
- Upload date:
- Size: 15.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
928228c0d4e6b8fa68b39fe801798796c6793108d03f04f3899ae99dcca40c47
|
|
| MD5 |
d3b4623c90c841ba853a9c3263994dfa
|
|
| BLAKE2b-256 |
adfe6efbf078cfca3b8909c79a345a41e436aab3b9db8883bd71a952254778f2
|
Provenance
The following attestation bundles were made for jmeph_ffi-1.0.0.tar.gz:
Publisher:
publish.yml on jayeshmepani/jpl-moshier-ephemeris-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jmeph_ffi-1.0.0.tar.gz -
Subject digest:
928228c0d4e6b8fa68b39fe801798796c6793108d03f04f3899ae99dcca40c47 - Sigstore transparency entry: 1632117415
- Sigstore integration time:
-
Permalink:
jayeshmepani/jpl-moshier-ephemeris-python@e951cb51c622cc07613965af8509f8e556ab78de -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/jayeshmepani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e951cb51c622cc07613965af8509f8e556ab78de -
Trigger Event:
release
-
Statement type:
File details
Details for the file jmeph_ffi-1.0.0-py3-none-any.whl.
File metadata
- Download URL: jmeph_ffi-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06976115dfc0fc4965a5dc7d4f2af7f351f68b3361d27e823e0aab6d710e72cc
|
|
| MD5 |
d1e8265926a90acfa584ce324f499a92
|
|
| BLAKE2b-256 |
8269278279603aaa8e666ca3840a9b133d0a545f3f654fdde8df08a8dd60eee4
|
Provenance
The following attestation bundles were made for jmeph_ffi-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on jayeshmepani/jpl-moshier-ephemeris-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jmeph_ffi-1.0.0-py3-none-any.whl -
Subject digest:
06976115dfc0fc4965a5dc7d4f2af7f351f68b3361d27e823e0aab6d710e72cc - Sigstore transparency entry: 1632117454
- Sigstore integration time:
-
Permalink:
jayeshmepani/jpl-moshier-ephemeris-python@e951cb51c622cc07613965af8509f8e556ab78de -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/jayeshmepani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e951cb51c622cc07613965af8509f8e556ab78de -
Trigger Event:
release
-
Statement type: