PyMeeus

0.5.12 · active · verified Thu Apr 09

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.

Warnings

Install

Imports

Quickstart

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.

from pymeeus.Epoch import Epoch
from pymeeus.Sun import Sun

# Create an Epoch object for a specific date and time
my_epoch = Epoch(1992, 10, 13, 0, 0, 0)

# Get the Julian Ephemeris Day (JDE)
jde = my_epoch.get_jde()
print(f"Julian Ephemeris Day for 1992-10-13: {jde}")

# Calculate the Sun's geocentric apparent longitude for this epoch
sun = Sun(my_epoch)
longitude = sun.geocentric_apparent_longitude().degrees
print(f"Sun's Geocentric Apparent Longitude: {longitude:.4f} degrees")

view raw JSON →