Giter VIP home page Giter VIP logo

nasa-background's Introduction

nasa_background build passing

A python CLI application to download NASA pictures and apply them as the background for your pc.

Supported operating systems

  • Ubuntu Linux
  • Windows
  • Mac OS (Untested)

Basic setup

Note: nasa_background requires python >= 3.6

Install the requirements:

$ pip install -r requirements.txt

For Mac OS, appscript should be installed:

$ pip install appscript

Usage

To set the current NASA APOD as background run:

$ python nasa_background.py update

For more information on functionality run:

$ python nasa_background.py --help

Testing:

Install the test specific dependencies:

$ pip install -r test-requirements.txt

Run the tests

$ pytest tests

nasa-background's People

Contributors

kgb33 avatar philippeitis avatar sentouki avatar thomas9292 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sentouki gdpan919

nasa-background's Issues

GUI?

Here's a version of your nasa_background.py file but with a GUI added instead of command line.

I was thinking that previewing the image would be an easy next step to add. This could be done either with a "Preview" button in this window below that will popup a window with the image as a preview, or simply embedding the preview in the window itself.

Right now it simply displays the title and metadata.

image

from tools import nasa_api, background
import PySimpleGUI as sg

def nasa_gui():
    '''Get the newest NASA Picture of the Day and set it as background'''
    meta_info = nasa_api.get_info()

    layout = [  [sg.Text(meta_info['title'], key='-TITLE-')],
                [sg.Text(meta_info["explanation"], size=(50,0), key='-DESCIPTION-')],
                [sg.Button('Set'), sg.Button('Cancel')]]
    window = sg.Window('NASA Picture of the Day', layout)
    event, values = window.read()
    window.close()
    if event == 'Set':
        file_path = nasa_api.download_image()
        background.change_background(file_path)


if __name__ == '__main__':
    nasa_gui()

Not all nasa apod's are images

Sometimes, the media type is video. The program currently bugs in tools.nasa_api.download_image(), when the 'hd_url' key is not present in the meta_info dictionary.

The program should tell the user that for this chosen day, there is no picture available.

Issue can be recreated by attempting to download the image for 2019-12-23

Write tests

Write the tests for nasa_api functions get_info and download_image

Add --auto option to update for automatic execution

I think it would be useful to be able to schedule to update task with either a cron job or task scheduler. For this to work completely automatically, the user should not be prompted anything when the --auto option is activated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.