jmeph-ffi 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jmeph_ffi-1.0.0/.gitignore +19 -0
- jmeph_ffi-1.0.0/CONTRIBUTING.md +93 -0
- jmeph_ffi-1.0.0/LICENSE +21 -0
- jmeph_ffi-1.0.0/PKG-INFO +150 -0
- jmeph_ffi-1.0.0/README.md +117 -0
- jmeph_ffi-1.0.0/UPSTREAM_SYNC.md +44 -0
- jmeph_ffi-1.0.0/VERSION.md +48 -0
- jmeph_ffi-1.0.0/pyproject.toml +132 -0
- jmeph_ffi-1.0.0/scripts/fetch_prebuilt.py +106 -0
- jmeph_ffi-1.0.0/scripts/generate_bindings.php +295 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/__init__.py +41 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/_loader.py +116 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/bindings.py +641 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/constants.py +464 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/linux-arm64/libcalceph.so +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/linux-arm64/libcalceph.so.2 +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/linux-arm64/libcalceph.so.2.0.5 +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/linux-arm64/libjme.so +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/linux-x64/libcalceph.so +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/linux-x64/libcalceph.so.2 +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/linux-x64/libcalceph.so.2.0.5 +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/linux-x64/libjme.so +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/macos-arm64/libcalceph.dylib +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/macos-arm64/libjme.dylib +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/macos-x64/libcalceph.dylib +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/macos-x64/libjme.dylib +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/windows-x64/calceph.dll +0 -0
- jmeph_ffi-1.0.0/src/jpl_moshier_ephemeris/libs/windows-x64/jme.dll +0 -0
- jmeph_ffi-1.0.0/tests/conftest.py +10 -0
- jmeph_ffi-1.0.0/tests/test_function_coverage.py +18 -0
- jmeph_ffi-1.0.0/tests/test_jpl_moshier_ephemeris.py +123 -0
- jmeph_ffi-1.0.0/tests/test_verification.py +54 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Contributing to JPL Moshier Ephemeris Python
|
|
2
|
+
|
|
3
|
+
This package is a raw `ctypes` wrapper over the native JME C API. Contributions should preserve that low-level, lossless contract.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Python 3.10 or newer
|
|
8
|
+
- Git
|
|
9
|
+
- Bundled JME/CALCEPH runtimes, or explicit `JME_LIBRARY_PATH` and `JME_CALCEPH_LIBRARY_PATH`
|
|
10
|
+
- Optional local native source tree for surface-audit tests via `JME_SOURCE_PATH`
|
|
11
|
+
|
|
12
|
+
## Development Setup
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
git clone https://github.com/YOUR_USERNAME/jpl-moshier-ephemeris-python.git
|
|
16
|
+
cd jpl-moshier-ephemeris-python
|
|
17
|
+
python -m pip install -e ".[dev]"
|
|
18
|
+
python scripts/fetch_prebuilt.py
|
|
19
|
+
python -m pytest
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quality Checks
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
python -m ruff check .
|
|
26
|
+
python -m ruff format . --check
|
|
27
|
+
python -m pyright
|
|
28
|
+
python -m pytest
|
|
29
|
+
python -m build
|
|
30
|
+
python -m twine check dist/*
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Raw API Rules
|
|
34
|
+
|
|
35
|
+
Do not:
|
|
36
|
+
|
|
37
|
+
- rename `jme_*` functions;
|
|
38
|
+
- rename or alter `JME_*` constant values;
|
|
39
|
+
- reorder arguments;
|
|
40
|
+
- reshape output buffers in the raw layer;
|
|
41
|
+
- hide return codes;
|
|
42
|
+
- drop error buffer arguments;
|
|
43
|
+
- reimplement astronomy inside Python;
|
|
44
|
+
- silently normalize or round outputs.
|
|
45
|
+
|
|
46
|
+
Do:
|
|
47
|
+
|
|
48
|
+
- keep the wrapper aligned with `include/jme/jme.h` and `include/jme/jme_extended.h`;
|
|
49
|
+
- keep the generated surface at `204` functions and `462` constants unless the native API changes;
|
|
50
|
+
- add or update tests when bindings or loader behavior change;
|
|
51
|
+
- use the PHP wrapper as the prebuilt runtime source of truth.
|
|
52
|
+
|
|
53
|
+
## Prebuilt Runtimes
|
|
54
|
+
|
|
55
|
+
Development can source runtimes from:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
Copy from a local checkout of jpl-moshier-ephemeris-php/libs
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Published runtime source:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
https://github.com/jayeshmepani/jpl-moshier-ephemeris-php/releases/tag/prebuilt-libs
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Refresh bundled runtimes with:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
python scripts/fetch_prebuilt.py
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Useful environment overrides:
|
|
74
|
+
|
|
75
|
+
- `JME_PHP_LIBS_PATH`
|
|
76
|
+
- `JME_PHP_REPO`
|
|
77
|
+
- `JME_PHP_TAG`
|
|
78
|
+
- `JME_PHP_ARCHIVE_URL`
|
|
79
|
+
|
|
80
|
+
## Reporting Bugs
|
|
81
|
+
|
|
82
|
+
Include:
|
|
83
|
+
|
|
84
|
+
- Python version
|
|
85
|
+
- OS and CPU architecture
|
|
86
|
+
- package version
|
|
87
|
+
- whether you used bundled libraries or env overrides
|
|
88
|
+
- exact traceback or native error text
|
|
89
|
+
- minimal reproduction
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT.
|
jmeph_ffi-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jayesh Mepani
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
jmeph_ffi-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jmeph-ffi
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Pure Python ctypes FFI wrapper for the JPL Moshier Ephemeris native library with direct jme_* API access and bundled jme plus calceph runtimes
|
|
5
|
+
Project-URL: Homepage, https://github.com/jayeshmepani/jpl-moshier-ephemeris-python
|
|
6
|
+
Project-URL: Source, https://github.com/jayeshmepani/jpl-moshier-ephemeris-python
|
|
7
|
+
Project-URL: Issues, https://github.com/jayeshmepani/jpl-moshier-ephemeris-python/issues
|
|
8
|
+
Author-email: Jayesh Mepani <jayeshmepani777@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: astrology,astronomy,ayanamsa,birth-chart,calceph,cross-platform,ctypes,eclipse,ephemeris,ffi,horoscope,houses,jpl,jyotish,kundli,moshier,planetary-positions,python-ffi,sidereal,tropical,vedic-astrology,zero-abstraction,zero-setup
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: build>=1.0.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: pre-commit>=4.0.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pyright>=1.1.390; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest>=8.3.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.9.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: twine>=4.0.0; extra == 'dev'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# JPL Moshier Ephemeris Python
|
|
35
|
+
|
|
36
|
+
[](https://pypi.org/project/jmeph-ffi/)
|
|
37
|
+
[](https://pepy.tech/projects/jmeph-ffi)
|
|
38
|
+
[](https://pypi.org/project/jmeph-ffi/)
|
|
39
|
+
[](https://opensource.org/licenses/MIT)
|
|
40
|
+
[](https://pypi.org/project/jmeph-ffi/)
|
|
41
|
+
[](https://pypi.org/project/jmeph-ffi/)
|
|
42
|
+
|
|
43
|
+
Pure Python `ctypes` runtime FFI binding for the project-owned JPL Moshier Ephemeris C library.
|
|
44
|
+
|
|
45
|
+
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.
|
|
46
|
+
|
|
47
|
+
## Contract
|
|
48
|
+
|
|
49
|
+
- Primary public functions: `jme_*`
|
|
50
|
+
- Primary public constants: `JME_*`
|
|
51
|
+
- Current wrapper target: all `204` public `jme_*` functions tracked by the native API inventory
|
|
52
|
+
- Current constant target: all `462` public `JME_*` constants from the native headers
|
|
53
|
+
- Native runtimes bundled in the wheel: `jme` plus `calceph`
|
|
54
|
+
- No CPython extension module; pure Python loader plus bundled native libraries
|
|
55
|
+
- Argument order, pointer ownership, output buffers, and return values are kept as-is from the native C API
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install jmeph-ffi
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
End users do not need to download native binaries manually. The package ships its bundled `jme` and `calceph` runtimes inbuilt inside the wheel.
|
|
64
|
+
|
|
65
|
+
## Native Libraries
|
|
66
|
+
|
|
67
|
+
The package bundles the same prebuilt runtimes as the PHP wrapper:
|
|
68
|
+
|
|
69
|
+
- `linux-x64/libjme.so`
|
|
70
|
+
- `linux-x64/libcalceph.so`
|
|
71
|
+
- `linux-arm64/libjme.so`
|
|
72
|
+
- `linux-arm64/libcalceph.so`
|
|
73
|
+
- `macos-x64/libjme.dylib`
|
|
74
|
+
- `macos-x64/libcalceph.dylib`
|
|
75
|
+
- `macos-arm64/libjme.dylib`
|
|
76
|
+
- `macos-arm64/libcalceph.dylib`
|
|
77
|
+
- `windows-x64/jme.dll`
|
|
78
|
+
- `windows-x64/calceph.dll`
|
|
79
|
+
|
|
80
|
+
The local/PHP release source below is for maintainers and package build refresh only, not for normal users.
|
|
81
|
+
|
|
82
|
+
Local source for those prebuilt runtimes during development:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
Copy from a local checkout of jpl-moshier-ephemeris-php/libs
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Published runtime source:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
https://github.com/jayeshmepani/jpl-moshier-ephemeris-php/releases/tag/prebuilt-libs
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
You can override discovery with:
|
|
95
|
+
|
|
96
|
+
- `JME_LIBRARY_PATH`
|
|
97
|
+
- `JME_CALCEPH_LIBRARY_PATH`
|
|
98
|
+
|
|
99
|
+
Search order:
|
|
100
|
+
|
|
101
|
+
1. explicit environment override
|
|
102
|
+
2. bundled `src/jpl_moshier_ephemeris/libs/<platform>/`
|
|
103
|
+
3. common system library paths
|
|
104
|
+
|
|
105
|
+
## Quick Start
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from jpl_moshier_ephemeris import (
|
|
109
|
+
JME_BODY_SUN,
|
|
110
|
+
JME_CALC_SPEED,
|
|
111
|
+
JME_CALENDAR_GREGORIAN,
|
|
112
|
+
JmeEph,
|
|
113
|
+
c_double,
|
|
114
|
+
create_string_buffer,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
jme = JmeEph()
|
|
118
|
+
|
|
119
|
+
jd = jme.jme_julian_day(2000, 1, 1, 12.0, JME_CALENDAR_GREGORIAN)
|
|
120
|
+
xx = (c_double * 6)()
|
|
121
|
+
err = create_string_buffer(256)
|
|
122
|
+
|
|
123
|
+
rc = jme.jme_calc_ut(jd, JME_BODY_SUN, JME_CALC_SPEED, xx, err)
|
|
124
|
+
print(rc, list(xx), err.value.decode())
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Development
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
python -m pip install -e ".[dev]"
|
|
131
|
+
python scripts/fetch_prebuilt.py
|
|
132
|
+
python -m ruff check .
|
|
133
|
+
python -m ruff format . --check
|
|
134
|
+
python -m pyright
|
|
135
|
+
python -m pytest
|
|
136
|
+
python -m build
|
|
137
|
+
python -m twine check dist/*
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The test suite verifies:
|
|
141
|
+
|
|
142
|
+
- `204/204` configured ctypes function signatures
|
|
143
|
+
- `462/462` generated `JME_*` constants
|
|
144
|
+
- import and runtime loading
|
|
145
|
+
- basic native contract calls such as version, Julian day conversion, calculation, houses, ayanamsa, Delta-T, split-degree, body naming, and refraction
|
|
146
|
+
- optional source-surface audit against the local native `jpl-ephemeris-` tree
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
MIT. The Python package and the project-owned JME native library are intended to remain under MIT-compatible distribution.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# JPL Moshier Ephemeris Python
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/jmeph-ffi/)
|
|
4
|
+
[](https://pepy.tech/projects/jmeph-ffi)
|
|
5
|
+
[](https://pypi.org/project/jmeph-ffi/)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://pypi.org/project/jmeph-ffi/)
|
|
8
|
+
[](https://pypi.org/project/jmeph-ffi/)
|
|
9
|
+
|
|
10
|
+
Pure Python `ctypes` runtime FFI binding for the project-owned JPL Moshier Ephemeris C library.
|
|
11
|
+
|
|
12
|
+
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.
|
|
13
|
+
|
|
14
|
+
## Contract
|
|
15
|
+
|
|
16
|
+
- Primary public functions: `jme_*`
|
|
17
|
+
- Primary public constants: `JME_*`
|
|
18
|
+
- Current wrapper target: all `204` public `jme_*` functions tracked by the native API inventory
|
|
19
|
+
- Current constant target: all `462` public `JME_*` constants from the native headers
|
|
20
|
+
- Native runtimes bundled in the wheel: `jme` plus `calceph`
|
|
21
|
+
- No CPython extension module; pure Python loader plus bundled native libraries
|
|
22
|
+
- Argument order, pointer ownership, output buffers, and return values are kept as-is from the native C API
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install jmeph-ffi
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
End users do not need to download native binaries manually. The package ships its bundled `jme` and `calceph` runtimes inbuilt inside the wheel.
|
|
31
|
+
|
|
32
|
+
## Native Libraries
|
|
33
|
+
|
|
34
|
+
The package bundles the same prebuilt runtimes as the PHP wrapper:
|
|
35
|
+
|
|
36
|
+
- `linux-x64/libjme.so`
|
|
37
|
+
- `linux-x64/libcalceph.so`
|
|
38
|
+
- `linux-arm64/libjme.so`
|
|
39
|
+
- `linux-arm64/libcalceph.so`
|
|
40
|
+
- `macos-x64/libjme.dylib`
|
|
41
|
+
- `macos-x64/libcalceph.dylib`
|
|
42
|
+
- `macos-arm64/libjme.dylib`
|
|
43
|
+
- `macos-arm64/libcalceph.dylib`
|
|
44
|
+
- `windows-x64/jme.dll`
|
|
45
|
+
- `windows-x64/calceph.dll`
|
|
46
|
+
|
|
47
|
+
The local/PHP release source below is for maintainers and package build refresh only, not for normal users.
|
|
48
|
+
|
|
49
|
+
Local source for those prebuilt runtimes during development:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
Copy from a local checkout of jpl-moshier-ephemeris-php/libs
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Published runtime source:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
https://github.com/jayeshmepani/jpl-moshier-ephemeris-php/releases/tag/prebuilt-libs
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
You can override discovery with:
|
|
62
|
+
|
|
63
|
+
- `JME_LIBRARY_PATH`
|
|
64
|
+
- `JME_CALCEPH_LIBRARY_PATH`
|
|
65
|
+
|
|
66
|
+
Search order:
|
|
67
|
+
|
|
68
|
+
1. explicit environment override
|
|
69
|
+
2. bundled `src/jpl_moshier_ephemeris/libs/<platform>/`
|
|
70
|
+
3. common system library paths
|
|
71
|
+
|
|
72
|
+
## Quick Start
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from jpl_moshier_ephemeris import (
|
|
76
|
+
JME_BODY_SUN,
|
|
77
|
+
JME_CALC_SPEED,
|
|
78
|
+
JME_CALENDAR_GREGORIAN,
|
|
79
|
+
JmeEph,
|
|
80
|
+
c_double,
|
|
81
|
+
create_string_buffer,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
jme = JmeEph()
|
|
85
|
+
|
|
86
|
+
jd = jme.jme_julian_day(2000, 1, 1, 12.0, JME_CALENDAR_GREGORIAN)
|
|
87
|
+
xx = (c_double * 6)()
|
|
88
|
+
err = create_string_buffer(256)
|
|
89
|
+
|
|
90
|
+
rc = jme.jme_calc_ut(jd, JME_BODY_SUN, JME_CALC_SPEED, xx, err)
|
|
91
|
+
print(rc, list(xx), err.value.decode())
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Development
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
python -m pip install -e ".[dev]"
|
|
98
|
+
python scripts/fetch_prebuilt.py
|
|
99
|
+
python -m ruff check .
|
|
100
|
+
python -m ruff format . --check
|
|
101
|
+
python -m pyright
|
|
102
|
+
python -m pytest
|
|
103
|
+
python -m build
|
|
104
|
+
python -m twine check dist/*
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The test suite verifies:
|
|
108
|
+
|
|
109
|
+
- `204/204` configured ctypes function signatures
|
|
110
|
+
- `462/462` generated `JME_*` constants
|
|
111
|
+
- import and runtime loading
|
|
112
|
+
- basic native contract calls such as version, Julian day conversion, calculation, houses, ayanamsa, Delta-T, split-degree, body naming, and refraction
|
|
113
|
+
- optional source-surface audit against the local native `jpl-ephemeris-` tree
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
MIT. The Python package and the project-owned JME native library are intended to remain under MIT-compatible distribution.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# JPL Moshier Ephemeris Python Sync Notes
|
|
2
|
+
|
|
3
|
+
**Generated**: May 25, 2026
|
|
4
|
+
|
|
5
|
+
## Source of Truth
|
|
6
|
+
|
|
7
|
+
This Python package is synchronized against two local/project sources:
|
|
8
|
+
|
|
9
|
+
1. Native C library source:
|
|
10
|
+
`jpl-ephemeris-`
|
|
11
|
+
2. PHP wrapper prebuilt runtime source:
|
|
12
|
+
`jpl-moshier-ephemeris-php`
|
|
13
|
+
|
|
14
|
+
## Current Sync Targets
|
|
15
|
+
|
|
16
|
+
| Area | Target |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| Public functions | `204` `jme_*` entries from `docs/API_REFERENCE.md` |
|
|
19
|
+
| Public constants | `462` `JME_*` constants from `include/jme/jme.h` and `include/jme/jme_extended.h` |
|
|
20
|
+
| Bundled runtimes | same platform runtime set as the PHP wrapper |
|
|
21
|
+
| JME runtime names | `libjme.so`, `libjme.dylib`, `jme.dll` |
|
|
22
|
+
| CALCEPH runtime names | `libcalceph.so`, `libcalceph.dylib`, `calceph.dll` |
|
|
23
|
+
| Python wrapper rule | lossless raw I/O only; no Python-side normalization, rounding, or reshaping |
|
|
24
|
+
|
|
25
|
+
## Runtime Source
|
|
26
|
+
|
|
27
|
+
Local development source:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
Copy from a local checkout of jpl-moshier-ephemeris-php/libs
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Published runtime source:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
https://github.com/jayeshmepani/jpl-moshier-ephemeris-php/releases/tag/prebuilt-libs
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Required Checks
|
|
40
|
+
|
|
41
|
+
- regenerate `bindings.py` and `constants.py` from the native headers when the C API changes
|
|
42
|
+
- keep the Python export surface aligned with the generated files
|
|
43
|
+
- keep runtime packaging aligned with the PHP wrapper release assets or repo archive tag
|
|
44
|
+
- verify tests still pass on Linux, macOS, and Windows
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# JPL Moshier Ephemeris Python Version Tracking
|
|
2
|
+
|
|
3
|
+
**Last verified**: May 25, 2026
|
|
4
|
+
|
|
5
|
+
## Current Package State
|
|
6
|
+
|
|
7
|
+
| Attribute | Value |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Python package | `jmeph-ffi` |
|
|
10
|
+
| Package version | `1.0.0` |
|
|
11
|
+
| Python requirement | `>=3.10` |
|
|
12
|
+
| Binding model | Pure Python `ctypes` runtime FFI |
|
|
13
|
+
| Native API target | `204` public `jme_*` functions |
|
|
14
|
+
| Native constant target | `462` public `JME_*` constants |
|
|
15
|
+
| Native source tree | `jpl-ephemeris-` |
|
|
16
|
+
| Runtime binary source | `jpl-moshier-ephemeris-php` prebuilt libs |
|
|
17
|
+
| License | MIT |
|
|
18
|
+
| Binding contract | Lossless raw I/O; native argument order, types, buffers, and return values preserved |
|
|
19
|
+
|
|
20
|
+
## Bundled Runtime Files
|
|
21
|
+
|
|
22
|
+
| Platform | JME | CALCEPH |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| Linux x64 | `libjme.so` | `libcalceph.so` |
|
|
25
|
+
| Linux ARM64 | `libjme.so` | `libcalceph.so` |
|
|
26
|
+
| macOS x64 | `libjme.dylib` | `libcalceph.dylib` |
|
|
27
|
+
| macOS ARM64 | `libjme.dylib` | `libcalceph.dylib` |
|
|
28
|
+
| Windows x64 | `jme.dll` | `calceph.dll` |
|
|
29
|
+
|
|
30
|
+
## Verification Targets
|
|
31
|
+
|
|
32
|
+
- `204/204` ctypes signatures generated from native headers and API inventory
|
|
33
|
+
- `462/462` `JME_*` constants generated from native headers
|
|
34
|
+
- runtime loader covers both JME and CALCEPH
|
|
35
|
+
- wheel/source package includes bundled runtime directories
|
|
36
|
+
|
|
37
|
+
## Update Workflow
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
python scripts/fetch_prebuilt.py
|
|
41
|
+
JME_SOURCE_PATH=/path/to/jpl-ephemeris- php scripts/generate_bindings.php
|
|
42
|
+
python -m ruff check .
|
|
43
|
+
python -m ruff format . --check
|
|
44
|
+
python -m pyright
|
|
45
|
+
python -m pytest
|
|
46
|
+
python -m build
|
|
47
|
+
python -m twine check dist/*
|
|
48
|
+
```
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.24"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "jmeph-ffi"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Pure Python ctypes FFI wrapper for the JPL Moshier Ephemeris native library with direct jme_* API access and bundled jme plus calceph runtimes"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Jayesh Mepani", email = "jayeshmepani777@gmail.com" }
|
|
14
|
+
]
|
|
15
|
+
keywords = [
|
|
16
|
+
"astrology",
|
|
17
|
+
"astronomy",
|
|
18
|
+
"ephemeris",
|
|
19
|
+
"ffi",
|
|
20
|
+
"ctypes",
|
|
21
|
+
"python-ffi",
|
|
22
|
+
"jpl",
|
|
23
|
+
"moshier",
|
|
24
|
+
"calceph",
|
|
25
|
+
"vedic-astrology",
|
|
26
|
+
"jyotish",
|
|
27
|
+
"horoscope",
|
|
28
|
+
"kundli",
|
|
29
|
+
"birth-chart",
|
|
30
|
+
"planetary-positions",
|
|
31
|
+
"ayanamsa",
|
|
32
|
+
"sidereal",
|
|
33
|
+
"tropical",
|
|
34
|
+
"houses",
|
|
35
|
+
"eclipse",
|
|
36
|
+
"zero-abstraction",
|
|
37
|
+
"zero-setup",
|
|
38
|
+
"cross-platform",
|
|
39
|
+
]
|
|
40
|
+
classifiers = [
|
|
41
|
+
"Development Status :: 5 - Production/Stable",
|
|
42
|
+
"Intended Audience :: Developers",
|
|
43
|
+
"Intended Audience :: Science/Research",
|
|
44
|
+
"Programming Language :: Python :: 3",
|
|
45
|
+
"Programming Language :: Python :: 3.10",
|
|
46
|
+
"Programming Language :: Python :: 3.11",
|
|
47
|
+
"Programming Language :: Python :: 3.12",
|
|
48
|
+
"Programming Language :: Python :: 3.13",
|
|
49
|
+
"Programming Language :: Python :: 3.14",
|
|
50
|
+
"License :: OSI Approved :: MIT License",
|
|
51
|
+
"Topic :: Scientific/Engineering :: Astronomy",
|
|
52
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
53
|
+
]
|
|
54
|
+
dependencies = []
|
|
55
|
+
|
|
56
|
+
[project.optional-dependencies]
|
|
57
|
+
dev = [
|
|
58
|
+
"pytest>=8.3.0",
|
|
59
|
+
"ruff>=0.9.0",
|
|
60
|
+
"pyright>=1.1.390",
|
|
61
|
+
"pre-commit>=4.0.0",
|
|
62
|
+
"build>=1.0.0",
|
|
63
|
+
"twine>=4.0.0",
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
[project.urls]
|
|
67
|
+
Homepage = "https://github.com/jayeshmepani/jpl-moshier-ephemeris-python"
|
|
68
|
+
Source = "https://github.com/jayeshmepani/jpl-moshier-ephemeris-python"
|
|
69
|
+
Issues = "https://github.com/jayeshmepani/jpl-moshier-ephemeris-python/issues"
|
|
70
|
+
|
|
71
|
+
[tool.hatch.build.targets.wheel]
|
|
72
|
+
packages = ["src/jpl_moshier_ephemeris"]
|
|
73
|
+
|
|
74
|
+
[tool.hatch.build.targets.sdist]
|
|
75
|
+
include = [
|
|
76
|
+
"src/jpl_moshier_ephemeris",
|
|
77
|
+
"tests",
|
|
78
|
+
"scripts",
|
|
79
|
+
"README.md",
|
|
80
|
+
"VERSION.md",
|
|
81
|
+
"UPSTREAM_SYNC.md",
|
|
82
|
+
"CONTRIBUTING.md",
|
|
83
|
+
"LICENSE",
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
[tool.ruff]
|
|
87
|
+
line-length = 100
|
|
88
|
+
target-version = "py310"
|
|
89
|
+
src = ["src/jpl_moshier_ephemeris", "tests", "scripts"]
|
|
90
|
+
|
|
91
|
+
[tool.ruff.lint]
|
|
92
|
+
select = [
|
|
93
|
+
"E", "W",
|
|
94
|
+
"F",
|
|
95
|
+
"I",
|
|
96
|
+
"N",
|
|
97
|
+
"UP",
|
|
98
|
+
"B",
|
|
99
|
+
"C4",
|
|
100
|
+
"SIM",
|
|
101
|
+
"RET",
|
|
102
|
+
"RUF",
|
|
103
|
+
]
|
|
104
|
+
fixable = ["ALL"]
|
|
105
|
+
|
|
106
|
+
[tool.ruff.format]
|
|
107
|
+
quote-style = "double"
|
|
108
|
+
indent-style = "space"
|
|
109
|
+
line-ending = "auto"
|
|
110
|
+
|
|
111
|
+
[tool.ruff.lint.per-file-ignores]
|
|
112
|
+
"src/jpl_moshier_ephemeris/__init__.py" = ["F401", "F403"]
|
|
113
|
+
"src/jpl_moshier_ephemeris/bindings.py" = ["E501", "RUF022"]
|
|
114
|
+
"src/jpl_moshier_ephemeris/constants.py" = ["E501", "N816"]
|
|
115
|
+
"tests/*" = ["S101"]
|
|
116
|
+
|
|
117
|
+
[tool.pyright]
|
|
118
|
+
pythonVersion = "3.10"
|
|
119
|
+
typeCheckingMode = "standard"
|
|
120
|
+
reportMissingImports = true
|
|
121
|
+
reportMissingTypeStubs = false
|
|
122
|
+
reportUnknownMemberType = false
|
|
123
|
+
reportUnknownVariableType = false
|
|
124
|
+
reportUnknownArgumentType = false
|
|
125
|
+
include = ["src/jpl_moshier_ephemeris", "tests", "scripts"]
|
|
126
|
+
exclude = ["**/__pycache__", ".venv", "build", "dist"]
|
|
127
|
+
|
|
128
|
+
[tool.pytest.ini_options]
|
|
129
|
+
testpaths = ["tests"]
|
|
130
|
+
python_files = ["test_*.py", "*_test.py"]
|
|
131
|
+
python_functions = ["test_*"]
|
|
132
|
+
addopts = "-v --tb=short"
|