pyMoonCal is a small Python script that calculates lunar days (the periods from one moonrise to
the next) for the current lunar month at your location and adds them to Google Calendar as
"Moon Day N" events. It is aimed at people who follow a lunar calendar and want the lunar days in
their regular calendar. Key pieces: PyEphem (moon rise times and new moons), Windows geolocation
(winsdk) and the Google Calendar API with a service account.
Status: unfinished prototype (last change in 2023). The lunar-day calculation is implemented,
but the event-creation step has known bugs and does not create events yet; see AGENTS.md.
- Windows (location is read through the Windows geolocation API).
- Python 3 with
ephem,numpy,google-auth,google-api-python-clientandwinsdk(package names inferred from the imports; there is no requirements file). - A Google Cloud service account key saved as
.keys/client_secret.jsonnext to the scripts. This path is git-ignored; never commit the key.
python pyMoon.pyIntended behaviour: the script prints the start and end of the current lunar month, then checks Google Calendar for each "Moon Day" event and creates the missing ones.
pyMoon.py: main script.cal.py: Google Calendar helpers.loc.py: current coordinates from Windows geolocation.