Welcome!
Hi! Welcome to my repository Marsworks! (Name inspired from fate franchise ofc ;) ).
So, Marsworks is a fast and lightweight API wrapper around Mars Rover Photos API written in Python.
Let's see why you should or shouldn't use this wrapper in next sections.
Advantages
|
Disadvantages
|
Currently this project is under development and possibilities of breaking changes in near future is huge until 1.x release.
Getting Started
Installation
or
|
Usage
Async. usageGetting photos on a particular sol taken by this rover, asynchronously.import asyncio
import marsworks
client = marsworks.AsyncClient()
async def main(rover_name, sol) -> list:
images = await client.get_photo_by_sol(rover_name, sol) # You can pass camera too.
return images
imgs = asyncio.run(main("Curiosity", 956))
print(imgs[0].img_src)
print(imgs[0].photo_id)
# and many more attributes! Sync. usageGetting photos on a particular sol taken by this rover, synchronously.import marsworks
client = marsworks.SyncClient()
def main(rover_name, sol) -> list:
images = client.get_photo_by_sol(rover_name, sol) # You can pass camera too.
return images
imgs = main("Curiosity", 956)
print(imgs[0].img_src)
print(imgs[0].photo_id)
# and many more attributes! |
Links
-
Documentation.
Marsworks -
Page.
Marsworks PyPi -
Page.
NASA APIs -
Andy for his contribution.
Thanks to