A python API wrapper for the NASA API
Project description
nasa.py
Work in progressto run the docs use
sphinx-autobuild -a docs/source docs/_build/html --watch nasa --open-browser
Demo
APOD
EPIC
Installation
Currently the package is not available on pypi, this means that you can't install it using just pip
.
To install Nasa.py
you need to install git
and to run this command
.. code-block:: text
pip install git+https://github.com/Snipy7374/nasa.py
Requirements
.. code-block:: text
aiohttp
aiofiles
requests
Basic usage
Create a client object
.. code-block:: python3
import typing as t
from nasa import NasaSyncClient
if t.TYPE_CHECKING:
from nasa import AstronomyPicture
client = NasaSyncClient(token="TOKEN_HERE")
get the todays astronomy picture
.. code-block:: python3
astronomy_picture: AstronomyPicture = client.get_astronomy_picture()
save an image
.. code-block:: python3
astronomy_picture.image.save("image.png")
This library also supports Async requests
.. code-block:: python3
import typing as t
from nasa import NasaAsyncClient
if t.TYPE_CHECKING:
from nasa import AstronomyPicture
client = NasaAsyncClient(token="TOKEN_HERE")
async def main():
async with client:
astronomy_picture: AstronomyPicture = await client.get_astronomy_picture()
await astronomy_picture.image.save("image.png")
Currently supported NASA API endpoints
- APOD (Astronomy picture of the day) -
/planetary/apod
- (all query parameters) - EPIC (Earth Polychromatic Imaging Camera) -
/EPIC/api
- (all)
TODO
Addis_video
property on AstronomyPicture (based onmedia_type
)Add support for thecount
query parameter on/planetary/apod
endpoint to get multiple random imageSolve typing issues withtyping.overload
s onclient.py
- Support other endpoints
- Mars rover photos
- NASA image and video library
Add async client & methodsAdd loggingAdd docs :)- Add developing tools
- nox
- pyright
- black
- flake8
- pre-commit
- Add workflows on github
- typing check
- flake8
- black
- Create the first release
- Add package configuration to publish on pypi (pyproject.toml)
- Upload the project on PyPi
- Customize the docs
- add custom colors
- Add examples
- upload on github
- docs: improve the structure of payloads and add Dev docs
- docs: add contributing section
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nasasync-0.0.1a0.tar.gz
(3.4 MB
view hashes)
Built Distribution
nasasync-0.0.1a0-py3-none-any.whl
(17.4 kB
view hashes)
Close
Hashes for nasasync-0.0.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95439ad0a4fa6dfa45ab8e0e579eec0024b12da9297cc5e1691bc1a194a0195b |
|
MD5 | ea6f5d6126ab4117f8660e020a77a15c |
|
BLAKE2b-256 | 07010947775d122dadc46ec89b98a9eb79e4b66fc038661f5e23edc40da7ed3e |