PHPackages                             jayeshmepani/jpl-moshier-ephemeris-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jayeshmepani/jpl-moshier-ephemeris-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jayeshmepani/jpl-moshier-ephemeris-php
======================================

PHP FFI wrapper for the JME native ephemeris library with direct jme\_\* API access and bundled runtime library support

1.0.1(2mo ago)0131MITPHPPHP ^8.3CI passing

Since May 24Pushed 1mo agoCompare

[ Source](https://github.com/jayeshmepani/jpl-moshier-ephemeris-php)[ Packagist](https://packagist.org/packages/jayeshmepani/jpl-moshier-ephemeris-php)[ Docs](https://github.com/jayeshmepani/jpl-moshier-ephemeris-php)[ GitHub Sponsors](https://github.com/sponsors/jayeshmepani)[ RSS](/packages/jayeshmepani-jpl-moshier-ephemeris-php/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (8)Versions (3)Used By (1)

JPL Moshier Ephemeris PHP FFI
=============================

[](#jpl-moshier-ephemeris-php-ffi)

[![Latest Version on Packagist](https://camo.githubusercontent.com/38cb193b282b22447e421b4901bc59b5c1abd10f72c62ea031a7b5c558d6a179/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a61796573686d6570616e692f6a706c2d6d6f73686965722d657068656d657269732d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jayeshmepani/jpl-moshier-ephemeris-php)[![Total Downloads](https://camo.githubusercontent.com/480adb3dcc246c991b1516e47d151da3c43592b80b0350b32a1941d03736218c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a61796573686d6570616e692f6a706c2d6d6f73686965722d657068656d657269732d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jayeshmepani/jpl-moshier-ephemeris-php)[![PHP Version Require](https://camo.githubusercontent.com/4a45b4ee01f5132045e2a745536a710ce60a8c2879cbc2051c59381fe77173bd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a61796573686d6570616e692f6a706c2d6d6f73686965722d657068656d657269732d7068703f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jayeshmepani/jpl-moshier-ephemeris-php)[![License: MIT](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

PHP 8.3+ FFI wrapper for the independent JPL Moshier Ephemeris C library.

This package wraps the project-owned `jme_*` C API from the JPL Moshier Ephemeris native library.

Contract
--------

[](#contract)

- Primary public functions: `jme_*`
- Primary public constants: `JME_*`
- Current wrapper target: all 204 public `jme_*` functions tracked by the native API inventory
- Native headers contain 462 `JME_*` tokens including two header guards; the PHP wrapper exposes the semantic native constants and preserves existing compatibility aliases where present
- Native backend: `libjme.so`, `libjme.dylib`, or `jme.dll`
- No hidden rounding, output reshaping, or dropped status/error buffers
- Incomplete native behavior should return `JME_ERR` from the C library rather than pretending to provide production ephemeris output

Engine Selection
----------------

[](#engine-selection)

The low-level `JmeEphFFI` class exposes every native function directly. The optional Laravel-style `JmeService::calc()` convenience method sets `ENGINE=...` through `jme_set_astro_models()` and then calls `jme_calc()`:

- `AUTO`: let the native C core choose its standard JPL/fallback policy
- `JPL`: require JPL kernel-backed behavior
- `MOSHIER`: force Moshier analytical behavior
- `VSOP_ELP_MEEUS`: force VSOP87/ELP2000/Meeus analytical behavior

Use direct `jme_jpl_*` calls for raw JPL/CALCEPH kernel access. The PHP layer does not normalize or reinterpret native outputs.

Requirements
------------

[](#requirements)

- PHP `^8.3`
- PHP FFI extension (`ext-ffi`)
- A compiled JME shared library
- The matching CALCEPH runtime library when using the JPL/CALCEPH backend

By default, the wrapper loads the bundled platform library from this package, for example:

```
vendor/jayeshmepani/jpl-moshier-ephemeris-php/libs/linux-x64/libjme.so

```

Override it with:

```
export JME_LIBRARY_PATH=/path/to/libjme.so
```

Runtime Libraries and Kernels
-----------------------------

[](#runtime-libraries-and-kernels)

Composer installs prebuilt runtime archives from this repository's GitHub releases when a local library is not already present. Each runtime archive contains:

- JME: `jme.dll`, `libjme.so`, or `libjme.dylib`
- CALCEPH: the platform runtime library required by JPL kernel mode

JPL `.bsp` kernels are not shipped in this package. Download them separately from the native JME kernel release:

```
https://github.com/jayeshmepani/jpl-ephemeris/releases/tag/jpl-kernels

```

Supported kernel choices:

- `de440s.bsp` - small
- `de440.bsp` - medium
- `de441.bsp` - large, published as split release parts because the full file exceeds GitHub's single asset size limit

Quick Start
-----------

[](#quick-start)

```
use FFI;
use JmeEph\FFI\JmeEphFFI;

$jme = new JmeEphFFI();

$jd = $jme->jme_julian_day(
    2000,
    1,
    1,
    12.0,
    JmeEphFFI::JME_CALENDAR_GREGORIAN
);

$xx = $jme->getFFI()->new('double[6]');
$error = $jme->getFFI()->new('char[256]');

$result = $jme->jme_calc_ut(
    $jd,
    JmeEphFFI::JME_BODY_SUN,
    JmeEphFFI::JME_CALC_NONE,
    $xx,
    $error
);

if ($result === JmeEphFFI::JME_OK) {
    echo "Sun longitude: {$xx[0]}\n";
} else {
    echo 'JME error: ' . FFI::string($error) . "\n";
}
```

Test
----

[](#test)

```
composer install
composer verify:surface
composer test
```

The test suite verifies the PHP wrapper against the JME-native contract, including function inventory coverage, constant inventory coverage, key `JME_*` values, and convenience calculation paths. Set `JME_SOURCE_PATH` if the native source tree is not at the default local path.

`composer verify:surface` performs an exact low-level surface audit of the generated wrapper:

- `204` tracked `jme_*` declarations compared against the native header prototypes
- `462` `JME_*` constants compared against native header values
- numeric constants cross-checked through a compiled C probe instead of trusting PHP generation alone

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance88

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/32cb5a476cac8bc43ffdf0769601a7425bc7ada6ec2291ee47c87441469035f0?d=identicon)[jayeshmepani](/maintainers/jayeshmepani)

---

Top Contributors

[![jayeshmepani](https://avatars.githubusercontent.com/u/112438589?v=4)](https://github.com/jayeshmepani "jayeshmepani (31 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (9 commits)")

---

Tags

astrologyastronomybspcalcepheclipseelp2000ephemerisffijpljpl-kernelsjyotishlaravelmeeusmoshierpanchangphpphp-ffiplanetary-positionsvedic-astrologyvsop87laravel-packagePHP LibraryEclipseffihoroscopeastrologyastronomyephemerisjyotishvedic astrologyphp-ffihouseskundliastrology-apibirth-chartplanetary-positionsayanamsasiderealtropical

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jayeshmepani-jpl-moshier-ephemeris-php/health.svg)

```
[![Health](https://phpackages.com/badges/jayeshmepani-jpl-moshier-ephemeris-php/health.svg)](https://phpackages.com/packages/jayeshmepani-jpl-moshier-ephemeris-php)
```

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k2.3M5](/packages/ashallendesign-short-url)[realrashid/sweet-alert

Laravel Sweet Alert Is A Package For Laravel Provides An Easy Way To Display Alert Messages Using The SweetAlert2 Library.

1.2k3.1M22](/packages/realrashid-sweet-alert)[lodash-php/lodash-php

A port of Lodash to PHP

525760.1k5](/packages/lodash-php-lodash-php)[phalcon/ide-stubs

The most complete Phalcon Framework IDE stubs library which enables autocompletion in modern IDEs.

1703.3M136](/packages/phalcon-ide-stubs)[intervention/zodiac

Zodiac Sign Calculator

59201.7k](/packages/intervention-zodiac)[imanghafoori/laravel-nullable

A package to help you write expressive defensive code in a functional manner

151483.3k6](/packages/imanghafoori-laravel-nullable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
