A Python Wrapper for NASA's Mars Rover Photos API
Project description
Marstuff
API Wrapper for NASA's Mars Rover Photos API
📝 Description
This is a Work-In-Progress Python API Wrapper for NASA's Mars Rover Photos API which provides both Synchronous and Asynchronous support.
🔥 Getting Started
-
⬇️ Installation
- Via pip
pip install marstuff
- Via pip
-
✨ Getting a NASA Developer Key
- Goto https://api.nasa.gov/
- Navigate to
Generate API Keyat the top navbar. - Fill in your details, and tap
Signup - Copy Your API Key
-
⚡ Quickstart
- Synchronously getting, Viewing and Saving the
Latest Photoof NASA'sCuriosityRoverfrom marstuff import Client # Import the Client class client = Client("Your API Token") # Make a new Client # Get the latest Photo photo = client.get_latest_photo(client.curiosity) # OR photo = client.curiosity.get_latest_photo() # Display the Photo photo.show() # Save the Photo photo.save("Latest photo of Curiosity.png")
- Asynchronously getting all the photos taken by the
Rear Hazard Avoidance Cameraof NASA'sCuriosityRover on sol3259from marstuff import AsyncClient # Import the AsyncClient class from marstuff.objects.camera import CAMERAS # Import the list of all CAMERAS import asyncio # Import asyncio client = AsyncClient("Your API Token") # Make a new Client # Make a function for running asyncio async def get_photos(): # Get the photo by Curiosity on sol 3259 with the RHAZ camera photos = await client.curiosity.get_all_photos_by_sol(3259, CAMERAS.RHAZ) # OR photos = await client.curiosity.rhaz.get_all_photos_by_sol(3259) print(photos) asyncio.run(get_photos())
- Synchronously getting, Viewing and Saving the
-
🧠 General Need-to-Know Stuff!!
This API currently provides access to 4 NASA Rovers (
Perseverance,Curiosity,Opportunity, andSpirit) Each rover, takes photos of the surface of mars via different cameras-
The cameras of the
PerseveranceRover areAbbreviation Camera EDL_RUCAM Rover Up-Look Camera EDL_RDCAM Rover Down-Look Camera EDL_DDCAM Descent Stage Down-Look Camera EDL_PUCAM1 Parachute Up-Look Camera A EDL_PUCAM2 Parachute Up-Look Camera B NAVCAM_LEFT Navigation Camera - Left NAVCAM_RIGHT Navigation Camera - Right MCZ_RIGHT Mast Camera Zoom - Right MCZ_LEFT Mast Camera Zoom - Left FRONT_HAZCAM_LEFT_A Front Hazard Avoidance Camera - Left FRONT_HAZCAM_RIGHT_A Front Hazard Avoidance Camera - Right REAR_HAZCAM_LEFT Rear Hazard Avoidance Camera - Left REAR_HAZCAM_RIGHT Rear Hazard Avoidance Camera - Right SKYCAM MEDA Skycam SHERLOC_WATSON SHERLOC WATSON Camera -
Cameras of other Rovers are
Abbreviation Camera Curiosity Opportunity Spirit FHAZ Front Hazard Avoidance Camera ✔ ✔ ✔ RHAZ Rear Hazard Avoidance Camera ✔ ✔ ✔ MAST Mast Camera ✔ CHEMCAM Chemistry and Camera Complex ✔ MAHLI Mars Hand Lens Imager ✔ MARDI Mars Descent Imager ✔ NAVCAM Navigation Camera ✔ ✔ ✔ PANCAM Panoramic Camera ✔ ✔ MINITES Miniature Thermal Emission Spectrometer (Mini-TES) ✔ ✔
You can query via
solorearth_datesolmeansMartian rotation or daywhich can be (0 toCurrent Sol of Rover)earth_dateis in the format ofYYYY-MM-DD
-
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file marstuff-0.2.0.tar.gz.
File metadata
- Download URL: marstuff-0.2.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6723a8a948dbb4b348ee2999dc3eb4dd0e8cd8747eced9817ddd13911a97ed7c
|
|
| MD5 |
dd2bbea4ae696baaa9b1e81f55443dab
|
|
| BLAKE2b-256 |
884f68b363a6dc0b4728734fb0a1344cdd372bd01586af078360d78ece5ff0ae
|
File details
Details for the file marstuff-0.2.0-py3-none-any.whl.
File metadata
- Download URL: marstuff-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9be3edc3278e8fcca26dd362cf19954a693162bf0a6ecdf0ea158eb83a3db93
|
|
| MD5 |
7bb873fbae0918179a559aa489d9a439
|
|
| BLAKE2b-256 |
88554994f80680f68d7fd1289bb07a1f34053178baf4cb19e21309b1ec531668
|