Skip to main content

dial-a-moon-wrapper

Images of the Moon as seen from a given place and time on Earth, built on NASA's Dial-A-Moon renderings.

  • Oriented for the observer: NASA's frames are rotated so the zenith is up (or celestial north).
  • Beyond NASA's years: dates NASA hasn't rendered use the NASA frame with the closest lunar geometry. Each new year's data is picked up automatically once NASA publishes it (usually November).
  • Square output, disk centered: black background at 730 px (JPEG), or transparent at high resolution (PNG), matching NASA's frames.

Install

pip install dial-a-moon-wrapper

Requires Python 3.11+.

Command line

dial-a-moon "Raleigh, NC" --datetime "2026-10-04 21:30"
dial-a-moon --latitude 35.78 --longitude -78.64 --resolution 5760 -o moon.png

Give a place name or --latitude/--longitude; everything else is optional.

Option
--datetime Local time at the observer, YYYY-MM-DD HH:MM or ISO 8601, between 1899-07-29 and 2053-10-07 (the range of JPL's DE421 ephemeris). Default: now.
--elevation Meters (default 0).
--timezone IANA zone; default from the location.
--orientation zenith (default) or north.
--resolution 730 (default, 730 px JPEG), or 1920/3840/5760 (1080/2160/3240 px PNG). Years without the size use the next largest.
-o, --output Image path. Default: <cache>/results/<orientation>/<resolution>/.
--cache-dir Cache location.
--cache-ttl Days before unused cached images are deleted (default 14; 0 keeps them).
--ephemeris-file Existing de421.bsp to use instead of downloading it.
--no-image Geometry only.
--json Print the result as JSON.
--bootstrap Refresh NASA metadata.
-v Verbose.

Library

from dial_a_moon_wrapper import render_moon

result = render_moon("2026-10-04 21:30", place="Raleigh, NC")
result.image     # path to the image
result.status    # "official" (NASA frame for that hour) or "estimated"
result.to_dict() # full details

Keyword arguments match the CLI options.

Notes

  • The first run downloads NASA's metadata (~30 MB) and JPL's DE421 ephemeris (~17 MB). Images are cached as they're used and deleted after 14 days unused.
  • Place names are looked up once via OpenStreetMap and cached.
  • NASA's frames are geocentric and hourly (no minute-by-minute eclipse frames).

Development

pytest                 # offline tests
pytest --run-network   # plus live NASA checks

License and credits

Code: MIT (LICENSE).

  • Imagery and metadata: NASA Scientific Visualization Studio, Moon Phase and Libration (Ernie Wright, Noah Petro, James Tralie).
  • Lunar surface data: NASA/Lunar Reconnaissance Orbiter (LROC WAC mosaic, NASA/GSFC/Arizona State University; LOLA, NASA/GSFC).
  • Ephemeris: JPL DE421, NASA/JPL (Folkner et al. 2009), via Skyfield.
  • Geocoding: © OpenStreetMap contributors (ODbL), via Nominatim.

NASA imagery is generally not subject to U.S. copyright; see NASA's media guidelines.

Metadata

Release files for dial-a-moon-wrapper 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dial-a-moon-wrapper 0.1.0
File Size Uploaded Provenance
dial_a_moon_wrapper-0.1.0.tar.gz 22.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dial-a-moon-wrapper 0.1.0
File Interpreter ABI Platform
dial_a_moon_wrapper-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.6 kB

Release files / dial_a_moon_wrapper-0.1.0.tar.gz

Download URL dial_a_moon_wrapper-0.1.0.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f9ae4cb9f5cff415b7fe2a3175896543c295666827507c8ca3ec2fd309e746e8
BLAKE2b-256 checksum
How to use checksums
3e269003dbe65ff5fb2ea58804e6dcdf53678b0ec365f27478a41a6073483aee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release files / dial_a_moon_wrapper-0.1.0-py3-none-any.whl

Download URL dial_a_moon_wrapper-0.1.0-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffa99500d57948e7b360df0a42c6b277eef8782cdb697e77fb4061ef63e3221c
BLAKE2b-256 checksum
How to use checksums
8398d5fdd5f48d240ace61cb71b00e0726793e224b2f1ed104ae1f9d76a0061e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Security for dial-a-moon-wrapper 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page