Skip to main content

Python Nasa API

Simple wrapper for NASA Api written in python which was previously written by abh80 in Javascript as NPM which is deprecated now so i aka Science Spot recreated it in Python using requests modules!

Quick Docs

You need NASA's Official API to use this module!

Load Client Class

# Import Client Class
from nasaapi import Client

# Load your api
nasa = Client(api)
# Replace your api with the original one!

Apod

print(nasa.apod())
# Will return a dict

print(nasa.apod_image())
# Will retun apod image url

Earth

print(nasa.earth(lat, lon, date))
# Lat Lon parameters should be latitude and longitude
# Date parameter should be in the form of YYYY-MM-DD
# Will return a dict

print(nasa.earth_image(lat, lon, date))
# Will return image url

Insight Weather Data

print(nasa.insight())
# Will return a dict

Data of mars rovers

There are two methods to get this data

1. Using MarsRovers Class

from nasaapi import MarsRovers

rovers = MarsRovers(api_key, sols, camera)
# api_key would be your NASA Api key. Sols would be the Mars Days. Camera is the name of camera to view

print(rovers.curiosity()) # Get data of Curiosity Rover
print(rovers.opportunity()) # Get data of Oportunity Rover
print(rovers.spirit()) # Get data of Spirit Rover

2. Using Client Class

rovers = nasa.mars_rovers(sols, camera)
# Sols would be the Mars Days. Camera is the name of camera to view

print(rovers.curiosity()) # Get data of Curiosity Rover
print(rovers.opportunity()) # Get data of Oportunity Rover
print(rovers.spirit()) # Get data of Spirit Rover

Techport

Get data of nasa's techport

print(nasa.techport(id))
# ID will be the id of the techport project!
# Will return dict unless its a better id

Two Line Element Sets of Nasa

Get data of nasa's tle

print(nasa.tle.search(query))
# Will return data of a search

print(nasa.tle.get(query))
# Will get of 1 data only

NIVL aka Nasa Image and Video Library

Get images, Search Images, and other image and video library of NASA

print(nasa.nivl.search(query))
# Query will be the query you will search

print(nasa.nivl.asset(id))
# Get Asset by ID

print(nasa.nivl.metadata(id))
# Get Metadata by ID

print(nasa.nivl.captions(id))
# Get Captions by ID

Support

Metadata

Release files for python-nasa-api 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-nasa-api 0.0.2
File Size Uploaded Provenance Actions
python-nasa-api-0.0.2.tar.gz 2.9 kB Without provenance Details for python-nasa-api-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-nasa-api 0.0.2
File Interpreter ABI Platform Actions
python_nasa_api-0.0.2-py3-none-any.whl Python 3 none any Details for python_nasa_api-0.0.2-py3-none-any.whl

Total release size: 5.9 kB

Release files / python-nasa-api-0.0.2.tar.gz

Download URL python-nasa-api-0.0.2.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
35edb2ecd8eb43641573fa5338ca4224be98387e9f9836997541256dac52b1d8
BLAKE2b-256 checksum
How to use checksums
00756d73f0eaef2560f55a63d6ecc3b7838d15a6a8a75969c57b2737e896d266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.5.0

Release files / python_nasa_api-0.0.2-py3-none-any.whl

Download URL python_nasa_api-0.0.2-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b02deb631eec0bda0afa922625ee939ee06190c790df172177a7a51fe4bb5154
BLAKE2b-256 checksum
How to use checksums
891ded787e9656105897fe4fa5a350d74c88a81970bec017140beca2fdb87487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.5.0

Security for python-nasa-api 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page