January 9, 2020

416 words 2 mins read

thewhiteh4t/spacepaper

thewhiteh4t/spacepaper

High Quality Images from NASA APOD

repo name thewhiteh4t/spacepaper
repo link https://github.com/thewhiteh4t/spacepaper
homepage
language Python
size (curr.) 165 kB
stars (curr.) 14
created 2019-01-02
license MIT License

SpacePaper

NASA APOD - Astronomy Picture of the Day

One of the most popular websites at NASA is the Astronomy Picture of the Day. Each day a different image or photograph of our fascinating universe is featured, along with a brief explanation written by a professional astronomer.

NASA APOD

The official NASA APOD page displays a single image everyday, SpacePaper retrieves images for a specific Month and Year.

APOD API allows us to retrieve images from June 1995 - Current Year.

API Requests are handled by a python script and it generates a Javascript file which displays images on the frontend.

Rate Limits

When you execute SpacePaper for the first time it will ask for an API Key, you have two options here :

  • Demo Key
  • Register for a Key

Demo Key

In documentation examples, the special DEMO_KEY api key is used. This API key can be used for initially exploring APIs prior to signing up, but it has much lower rate limits, so you’re encouraged to signup for your own API key if you plan to use the API (signup is quick and easy). The rate limits for the DEMO_KEY are:

  • Hourly Limit: 30 requests per IP address per hour
  • Daily Limit: 50 requests per IP address per day

If you want to use Demo Key, execute SpacePaper and enter DEMO_KEY, if you start getting errors after sometime that’s because rate limit was exceeded.

Registered key

Get your Key

  • Hourly Limit: 1,000 requests per hour

Exceeding these limits will lead to your API key being temporarily blocked from making further requests. The block will automatically be lifted by waiting an hour.

Install

SpacePaper uses Python3 Standard Library Packages along with Requests and PHP In-built Server. If you already have the above you can skip this step…

Linux / Termux -->

git clone https://github.com/thewhiteh4t/spacepaper.git
cd spacepaper
chmod 777 install.sh
./install.sh

install

Usage

usage: spacepaper.py [-h] [-m MONTH] [-y YEAR] [-r]

SpacePaper Provides High Quality Images from NASA APOD [ June 1995 Onwards ]

optional arguments:
  -h, --help            show this help message and exit
  -m MONTH, --month MONTH
  -y YEAR, --year YEAR
  -r, --random

Without Arguments

python3 spacepaper.py

Get Images for a Specific Month and Year

python3 spacepaper.py -m 12 -y 2018

Get Images for a Random Month and Year

python3 spacepaper.py -r

usage

Tested on

  • Ubuntu 18.04
  • Kali Linux
  • Termux

Demo

Youtube

comments powered by Disqus