moon


Namemoon JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://github.com/spacerest/moon
SummaryGets moon visualizations courtesy of SVS, NASA, Ernie Wright
upload_time2025-02-07 19:34:39
maintainerNone
docs_urlNone
authorSadie Parker
requires_pythonNone
licenseMIT
keywords moon art nasa dialamoon
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ```
        _..._           _..._            _..._            _..._            _..._
      .:::::::.       .::::. `.        .::::  `.        .::'   `.        .'     `.
     :::::::::::     :::::::.  :      ::::::    :      :::       :      :         :  
     :::::::::::     ::::::::  :      ::::::    :      :::       :      :         :
     `:::::::::'     `::::::' .'      `:::::   .'      `::.     .'      `.       .'
       `':::''         `'::'-'         `'::.-'           `':..-'          `-...-'

        _..._           _..._           _..._            _..._            _..._
      .'     `.       .'   `::.       .'  ::::.        .' .::::.        .:::::::.
     :         :     :       :::     :    ::::::      :  ::::::::      ::::::::::: 
     :         :     :       :::     :    ::::::      :  ::::::::      :::::::::::
     `.       .'     `.     .::'     `.   :::::'      `. '::::::'      `:::::::::'
       `-...-'         `-..:''         `-.::''          `-.::''          `':::''
```
       


# moon 

This is a Python package that gets an image of a given date's moon phase. It uses Ernie Wright's moon visualizations from the Dial-a-Moon project at Nasa's Scientific Visualization Studio.

At time of last release, this package can access any of the moon visualizations from 2011 onward.

# Installation 

To install this package, just run 

```pip install moon```

# Usage

Currently, this package can get a NumPy.ndarray representing the lunar phase, as well as some json of the lunar stats from the Dial-a-Moon Nasa site. This array is usable as an image using openCV, or can be saved to disk as a .jpg file.

To just use it in a project, you can use it like this:

```
from moon.dialamoon import Moon

moon = Moon()
moon.set_moon_phase()

```
and access the image array itself with

```
moon.image
```

You can save the current image to disk with the method `moon.save_to_disk('filename')` or `ui.save_to_disk('filename')`, which would save a `filename.jpg` in your current directory.


You can alternately test it out using Jupyter notebooks:

```
from moon.jupyter_ui import JupyterUi

ui = JupyterUi()
ui.set_moon_phase() #defaults to today's date
print(ui.moon_datetime_info)
ui.show()

```

By default, the returned image will be unlabeled and 730x730 pixels. To resize this, use the `size` keyword argument when initializing:

```
moon = Moon(size=(100,100))
```

You can access [other information and links to other images relating to the moon on your requested date](https://svs.gsfc.nasa.gov/help/#apis-dialamoon) via `Moon.info`. 

# Updates

Please feel free to post bugs, suggestions and feature requests on this repo. 

## 2.0.0 2024-02-01
- use the new API to determine moon image urls, so yearly IDs don't need to be added anymore
- deprecate image viewing via terminal
## 1.1.5 2021-12-30
- put constants in a `.json` file instead of a `.py` file
- add SVS ID for 2022
- if a SVS ID for a year isn't available, check whether it's available on in `res/constants.json` on the GitHub repo and then remind the user to update the package for next time
## 1.1.3 2021-05-01
- update numpy and opencv-python versions
- fix lru_cache decorator to fix issue #4
## 1.1.2 2021-01-24
- can include `hour` parameter in `Moon.set_moon_phase()`


# Resources:
- [nasa moon visualization studio](https://svs.gsfc.nasa.gov/4442)
- [how to publish a python package on pypi](https://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56)


moon ascii art courtesy of [jsg](http://www.ascii-art.de/ascii/mno/moon.txt)
```
        _..._           _..._            _..._            _..._            _..._
      .:::::::.       .::::. `.        .::::  `.        .::'   `.        .'     `.
     :::::::::::     :::::::.  :      ::::::    :      :::       :      :         :  
     :::::::::::     ::::::::  :      ::::::    :      :::       :      :         :
     `:::::::::'     `::::::' .'      `:::::   .'      `::.     .'      `.       .'
       `':::''         `'::'-'         `'::.-'           `':..-'          `-...-'

        _..._           _..._           _..._            _..._            _..._
      .'     `.       .'   `::.       .'  ::::.        .' .::::.        .:::::::.
     :         :     :       :::     :    ::::::      :  ::::::::      ::::::::::: 
     :         :     :       :::     :    ::::::      :  ::::::::      :::::::::::
     `.       .'     `.     .::'     `.   :::::'      `. '::::::'      `:::::::::'
       `-...-'         `-..:''         `-.::''          `-.::''          `':::''
```
       






            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/spacerest/moon",
    "name": "moon",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "MOON, ART, NASA, DIALAMOON",
    "author": "Sadie Parker",
    "author_email": "sadiemparker@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/30/07/de4307630d2e6772252900039d0bda661297817d9857346295664929c9db/moon-2.0.0.tar.gz",
    "platform": null,
    "description": "```\n        _..._           _..._            _..._            _..._            _..._\n      .:::::::.       .::::. `.        .::::  `.        .::'   `.        .'     `.\n     :::::::::::     :::::::.  :      ::::::    :      :::       :      :         :  \n     :::::::::::     ::::::::  :      ::::::    :      :::       :      :         :\n     `:::::::::'     `::::::' .'      `:::::   .'      `::.     .'      `.       .'\n       `':::''         `'::'-'         `'::.-'           `':..-'          `-...-'\n\n        _..._           _..._           _..._            _..._            _..._\n      .'     `.       .'   `::.       .'  ::::.        .' .::::.        .:::::::.\n     :         :     :       :::     :    ::::::      :  ::::::::      ::::::::::: \n     :         :     :       :::     :    ::::::      :  ::::::::      :::::::::::\n     `.       .'     `.     .::'     `.   :::::'      `. '::::::'      `:::::::::'\n       `-...-'         `-..:''         `-.::''          `-.::''          `':::''\n```\n       \n\n\n# moon \n\nThis is a Python package that gets an image of a given date's moon phase. It uses Ernie Wright's moon visualizations from the Dial-a-Moon project at Nasa's Scientific Visualization Studio.\n\nAt time of last release, this package can access any of the moon visualizations from 2011 onward.\n\n# Installation \n\nTo install this package, just run \n\n```pip install moon```\n\n# Usage\n\nCurrently, this package can get a NumPy.ndarray representing the lunar phase, as well as some json of the lunar stats from the Dial-a-Moon Nasa site. This array is usable as an image using openCV, or can be saved to disk as a .jpg file.\n\nTo just use it in a project, you can use it like this:\n\n```\nfrom moon.dialamoon import Moon\n\nmoon = Moon()\nmoon.set_moon_phase()\n\n```\nand access the image array itself with\n\n```\nmoon.image\n```\n\nYou can save the current image to disk with the method `moon.save_to_disk('filename')` or `ui.save_to_disk('filename')`, which would save a `filename.jpg` in your current directory.\n\n\nYou can alternately test it out using Jupyter notebooks:\n\n```\nfrom moon.jupyter_ui import JupyterUi\n\nui = JupyterUi()\nui.set_moon_phase() #defaults to today's date\nprint(ui.moon_datetime_info)\nui.show()\n\n```\n\nBy default, the returned image will be unlabeled and 730x730 pixels. To resize this, use the `size` keyword argument when initializing:\n\n```\nmoon = Moon(size=(100,100))\n```\n\nYou can access [other information and links to other images relating to the moon on your requested date](https://svs.gsfc.nasa.gov/help/#apis-dialamoon) via `Moon.info`. \n\n# Updates\n\nPlease feel free to post bugs, suggestions and feature requests on this repo. \n\n## 2.0.0 2024-02-01\n- use the new API to determine moon image urls, so yearly IDs don't need to be added anymore\n- deprecate image viewing via terminal\n## 1.1.5 2021-12-30\n- put constants in a `.json` file instead of a `.py` file\n- add SVS ID for 2022\n- if a SVS ID for a year isn't available, check whether it's available on in `res/constants.json` on the GitHub repo and then remind the user to update the package for next time\n## 1.1.3 2021-05-01\n- update numpy and opencv-python versions\n- fix lru_cache decorator to fix issue #4\n## 1.1.2 2021-01-24\n- can include `hour` parameter in `Moon.set_moon_phase()`\n\n\n# Resources:\n- [nasa moon visualization studio](https://svs.gsfc.nasa.gov/4442)\n- [how to publish a python package on pypi](https://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56)\n\n\nmoon ascii art courtesy of [jsg](http://www.ascii-art.de/ascii/mno/moon.txt)\n```\n        _..._           _..._            _..._            _..._            _..._\n      .:::::::.       .::::. `.        .::::  `.        .::'   `.        .'     `.\n     :::::::::::     :::::::.  :      ::::::    :      :::       :      :         :  \n     :::::::::::     ::::::::  :      ::::::    :      :::       :      :         :\n     `:::::::::'     `::::::' .'      `:::::   .'      `::.     .'      `.       .'\n       `':::''         `'::'-'         `'::.-'           `':..-'          `-...-'\n\n        _..._           _..._           _..._            _..._            _..._\n      .'     `.       .'   `::.       .'  ::::.        .' .::::.        .:::::::.\n     :         :     :       :::     :    ::::::      :  ::::::::      ::::::::::: \n     :         :     :       :::     :    ::::::      :  ::::::::      :::::::::::\n     `.       .'     `.     .::'     `.   :::::'      `. '::::::'      `:::::::::'\n       `-...-'         `-..:''         `-.::''          `-.::''          `':::''\n```\n       \n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Gets moon visualizations courtesy of SVS, NASA, Ernie Wright",
    "version": "2.0.0",
    "project_urls": {
        "Download": "https://github.com/spacerest/moon/archive/v_2_0_0.tar.gz",
        "Homepage": "https://github.com/spacerest/moon"
    },
    "split_keywords": [
        "moon",
        " art",
        " nasa",
        " dialamoon"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3007de4307630d2e6772252900039d0bda661297817d9857346295664929c9db",
                "md5": "155b2c43fb3a2005b8ff0ab72d510da4",
                "sha256": "1812b1fefcea98fbb3aab4fe8c20131e1a034ffb1c611a3c6719b83453babb51"
            },
            "downloads": -1,
            "filename": "moon-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "155b2c43fb3a2005b8ff0ab72d510da4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3340803,
            "upload_time": "2025-02-07T19:34:39",
            "upload_time_iso_8601": "2025-02-07T19:34:39.390096Z",
            "url": "https://files.pythonhosted.org/packages/30/07/de4307630d2e6772252900039d0bda661297817d9857346295664929c9db/moon-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-07 19:34:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "spacerest",
    "github_project": "moon",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "moon"
}
        
Elapsed time: 0.43726s