# ascii-moon-phase-python
Prints the current moon phase as ASCII art. Install with `pip install ascii-moon-phase` and run with `python3 -m ascii_moon_phase`.
usage: ascii-moon [-h] [--size SIZE] [--hemisphere {north,south}] [--date DATE] [--phase PHASE] [--light-char CHAR]
[--dark-char CHAR] [--empty-char CHAR] [--show-phase]
Render the lunar phase as filled ASCII art.
options:
-h, --help show this help message and exit
--size SIZE Height in rows (width is 2*size). Default: 24
--hemisphere {north,south}
Orientation: 'north' shows waxing on the right (default).
--date DATE Calendar date YYYY-MM-DD (default: today).
--phase PHASE Phase fraction in [0.0, 1.0]; 0.0=new, 0.5=full, 1.0=new. Overrides --date.
--light-char CHAR Character for illuminated area (default: '@').
--dark-char CHAR Character for dark area (default: '.').
--empty-char CHAR Character outside the disc (default: space).
--show-phase Print the numeric phase after the art.
You can also call these functions from Python:
>>> import ascii_moon_phase as amp
>>> print(amp.render_moon())
...@@@@@@@@@@@
.....@@@@@@@@@@@@@@@@@@@
.......@@@@@@@@@@@@@@@@@@@@@@@
.......@@@@@@@@@@@@@@@@@@@@@@@@@@@
........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.......@@@@@@@@@@@@@@@@@@@@@@@@@@@
.......@@@@@@@@@@@@@@@@@@@@@@@
.....@@@@@@@@@@@@@@@@@@@
...@@@@@@@@@@@
The parameters of `render_moon()` are:
def render_moon(
size: int = 24,
northern_hemisphere: bool = True,
phase_date: date | None = None,
light_char: str = "@",
dark_char: str = ".",
empty_char: str = " ",
phase: float | None = None,
) -> str:
You can also call `animate_phases()` to play a smooth animation of the moon, or call `animate_future()` to show the phase of each day progressing into the future.
The Rust version is at [https://github.com/asweigart/ascii-moon-phase-rust](https://github.com/asweigart/ascii-moon-phase-rust)
Raw data
{
"_id": null,
"home_page": null,
"name": "ascii-moon-phase",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "art, ascii, lunar, moon, phase, terminal",
"author": null,
"author_email": "Al Sweigart <al@inventwithpython.com>",
"download_url": "https://files.pythonhosted.org/packages/56/cd/f59975754195d71f5ceacd584c6c328f6452a873bb028f12a7095bb03d65/ascii_moon_phase-0.3.0.tar.gz",
"platform": null,
"description": "# ascii-moon-phase-python\n\nPrints the current moon phase as ASCII art. Install with `pip install ascii-moon-phase` and run with `python3 -m ascii_moon_phase`.\n\n usage: ascii-moon [-h] [--size SIZE] [--hemisphere {north,south}] [--date DATE] [--phase PHASE] [--light-char CHAR]\n [--dark-char CHAR] [--empty-char CHAR] [--show-phase]\n\n Render the lunar phase as filled ASCII art.\n\n options:\n -h, --help show this help message and exit\n --size SIZE Height in rows (width is 2*size). Default: 24\n --hemisphere {north,south}\n Orientation: 'north' shows waxing on the right (default).\n --date DATE Calendar date YYYY-MM-DD (default: today).\n --phase PHASE Phase fraction in [0.0, 1.0]; 0.0=new, 0.5=full, 1.0=new. Overrides --date.\n --light-char CHAR Character for illuminated area (default: '@').\n --dark-char CHAR Character for dark area (default: '.').\n --empty-char CHAR Character outside the disc (default: space).\n --show-phase Print the numeric phase after the art.\n\nYou can also call these functions from Python:\n\n >>> import ascii_moon_phase as amp\n >>> print(amp.render_moon())\n ...@@@@@@@@@@@\n .....@@@@@@@@@@@@@@@@@@@\n .......@@@@@@@@@@@@@@@@@@@@@@@\n .......@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n .........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n .........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ..........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n .........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n .........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n ........@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n .......@@@@@@@@@@@@@@@@@@@@@@@@@@@\n .......@@@@@@@@@@@@@@@@@@@@@@@\n .....@@@@@@@@@@@@@@@@@@@\n ...@@@@@@@@@@@\n\nThe parameters of `render_moon()` are:\n\n def render_moon(\n size: int = 24,\n northern_hemisphere: bool = True,\n phase_date: date | None = None,\n light_char: str = \"@\",\n dark_char: str = \".\",\n empty_char: str = \" \",\n phase: float | None = None,\n\n ) -> str:\n\n\nYou can also call `animate_phases()` to play a smooth animation of the moon, or call `animate_future()` to show the phase of each day progressing into the future.\n\n\nThe Rust version is at [https://github.com/asweigart/ascii-moon-phase-rust](https://github.com/asweigart/ascii-moon-phase-rust)\n",
"bugtrack_url": null,
"license": "Copyright 2025 Al Sweigart",
"summary": "Display the current lunar phase as ASCII art.",
"version": "0.3.0",
"project_urls": {
"Homepage": "https://github.com/asweigart/ascii-moon-phase-python",
"Issues": "https://github.com/asweigart/ascii-moon-phase-python/issues"
},
"split_keywords": [
"art",
" ascii",
" lunar",
" moon",
" phase",
" terminal"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "91b08115c371916f974f6916cd4b26493708aa4b04a8d88a86ad978f3d4ae96a",
"md5": "5494cd9f1124415c650c7b915bc37980",
"sha256": "fde5a1240805fbe5c29023401c0d9d5be2380ae825b8ac6c4a3f317f040198dd"
},
"downloads": -1,
"filename": "ascii_moon_phase-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5494cd9f1124415c650c7b915bc37980",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 5516,
"upload_time": "2025-08-20T18:32:07",
"upload_time_iso_8601": "2025-08-20T18:32:07.152166Z",
"url": "https://files.pythonhosted.org/packages/91/b0/8115c371916f974f6916cd4b26493708aa4b04a8d88a86ad978f3d4ae96a/ascii_moon_phase-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "56cdf59975754195d71f5ceacd584c6c328f6452a873bb028f12a7095bb03d65",
"md5": "a4b17330aab653a49d6d7913c818749b",
"sha256": "63dcd9e88b21f46d05fb20ccf27b7529b42c6854d3c1fae172a27a6c6a41da52"
},
"downloads": -1,
"filename": "ascii_moon_phase-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "a4b17330aab653a49d6d7913c818749b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 5910,
"upload_time": "2025-08-20T18:32:08",
"upload_time_iso_8601": "2025-08-20T18:32:08.009604Z",
"url": "https://files.pythonhosted.org/packages/56/cd/f59975754195d71f5ceacd584c6c328f6452a873bb028f12a7095bb03d65/ascii_moon_phase-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-20 18:32:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "asweigart",
"github_project": "ascii-moon-phase-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ascii-moon-phase"
}