PyMeeus is a Python library that implements astronomical algorithms described in the classical book 'Astronomical Algorithms, 2nd Edition' by Jean Meeus. It provides routines for celestial mechanics, ephemerides, and time conversions. The library is known for its simplicity, ease of use, minimal dependencies, and abundant documentation. The current version is 0.5.12, with an irregular release cadence focused on bug fixes and new functionality.
pip install pymeeusVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to correctly import classes like `Epoch` and `Sun` and use them to calculate fundamental astronomical values such as the Julian Ephemeris Day (JDE) and the Sun's geocentric apparent longitude for a given date.
Always use explicit imports like `from pymeeus.ModuleName import ClassName` or `import pymeeus.ModuleName`.
Regularly update the `pymeeus` package to get the latest leap seconds table. For critical applications, consider providing the `leap_seconds` argument manually to the `Epoch` constructor or `set` method if an updated package is not available.
Evaluate if a 10-millisecond resolution meets your application's precision requirements. For higher precision, consider libraries designed for such demands, possibly involving arbitrary-precision arithmetic, though PyMeeus focuses on simplicity.
Review `pyplanets` (available on PyPI) to see if its design aligns better with new project requirements. Existing `pymeeus` projects are not directly affected.
Import the specific module containing the desired class, then access the class through that module, for example: `from pymeeus.Epoch import Epoch` then `mydate = Epoch(1992, 10, 13.0)`. Alternatively, `import pymeeus.Epoch` then `mydate = pymeeus.Epoch.Epoch(1992, 10, 13.0)`.
Install the library using pip: `pip install pymeeus`. If using Python 3 specifically, `pip3 install pymeeus`.
Access the class using its full path: `import pymeeus.Epoch` then `mydate = pymeeus.Epoch.Epoch(1992, 10, 13.0)`. A cleaner approach is to use `from pymeeus.Epoch import Epoch` and then `mydate = Epoch(1992, 10, 13.0)`.
No dependency data recorded yet.