Giter Site home page Giter Site logo

discovery_se3_assessment's Introduction

Discovery SE3 take home assessment

Specification

Please set up a Python script that meets the following requirements:

Use the NASA API (https://api.nasa.gov/) to retrieve the Astronomy Picture of the Day

Based on the title (or description) of the photo, retrieve some additional details about the photo. You can use any source(s) you want but we’ve included a few examples you might find useful:

Return a dictionary with the photo source, info about the photo from NASA, and the additional information you retrieved in step 2.

Provide some unit tests - unittest is our preference but pytest is ok.

Please try not to spend more than 2 hours on this project. You can send this as a github repo or a zipped directory including a README on how to run the script if necessary.

If you’ve had to make any assumptions in order to build your script, list them in the README.

Setup

If the code is grabbed from the repo

  1. Generate API key from https://api.nasa.gov/ by registering with name and email
  2. In the src directory, create an empty .env file and copy-paste the api key gotten from the email
    API_KEY=xxxxx
    APOD_API=https://api.nasa.gov/planetary/apod?api_key=${API_KEY}
    WIKI_API=https://en.wikipedia.org/w/api.php
    

If running directly from a tarball, then skip steps 1 and 2.

  1. In the project directory, create a virtual env with the command python3 -m venv venv
  2. From the project root directory, activate the virtual environment with the command source venv/bin/activate
  3. install the necessary packages with the command pip install -r requirements.txt
    • update pip with command pip install --upgrade pip if needed

After the setup the directory should look something like this

.
├── README.md
├── requirements.txt
├── venv
├── src
│   ├── __init__.py
│   ├── main.py
│   ├── .env
│   └── utils
│       ├── __init__.py
│       └── fetch_data.py
└── test
    ├── __init__.py
    ├── data
    │   ├── 2023-04-01-apod-wiki-results.json
    │   ├── 2023-04-01-apod.json
    │   └── 2023-04-01-wiki-extlinks.json
    └── test_fetch_data.py

Usage

after completing setup run command cd src && python3 main.py

  • with no command line options it will run and grab current date of execution's APOD and save the output as a json in the src/out directory with the format YYYY-MM-DD-apod-data.json

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.