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.
| 2026-12-14, 9 PM local | NASA frame (north up) | As seen by the observer |
|---|---|---|
| Raleigh, NC | ||
| Sydney, Australia |
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dial_a_moon_wrapper-0.1.1.tar.gz | 22.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dial_a_moon_wrapper-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.9 kB
Release files / dial_a_moon_wrapper-0.1.1.tar.gz
| Download URL | dial_a_moon_wrapper-0.1.1.tar.gz |
|---|---|
| Size | 22.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cc738b2e8085c85bfc07ad7f584f69da99de0367c438b3f407bfaa9a230a971
|
|
BLAKE2b-256 checksum How to use checksums |
8f5b5c2a03b2f5df4a165dc3845d021f925b6457b755467b4374bf9b530d450f
|
| 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.1-py3-none-any.whl
| Download URL | dial_a_moon_wrapper-0.1.1-py3-none-any.whl |
|---|---|
| Size | 28.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec4878926375155734d46e64ca6efecf20e763ee3aac5c1449ed70a25ef60c40
|
|
BLAKE2b-256 checksum How to use checksums |
47a2f1df6afcf958a001991e4342d6c9d1cae66dc7831459c2ce3a396a621154
|
| 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.1
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.