/Project_01

REST API project

Primary LanguagePython

Shipbuilder's Guide to the Galaxy by Quaternary Star System

Roster/Roles

  • Elizabeth Doss
    • Handle API requests cleanly
    • Connect frontend/backend
    • Write methods that can access each API and return the desired information
  • Yevgeniy Gorbachev
    • Handle the backend
    • Handle caching in database
    • Search through database
    • Generate queries using natural language input
    • Math
  • Kevin Li
    • Project manager
    • Make changes to repository when necessary
  • Emory Walsh
    • Handle the frontend
    • Create templates
    • Routing
    • Styling with Bootstrap

Website Description

Data is fetched from the Wolfram|Alpha API, Wikipedia API, and the NASA Exoplanet API.

This website will (hopefully) provide information and answer questions the visitor may have regarding spacecraft, engines, space travel, exoplanets, etc. A search query is taken in from the user. The website parses the query for keywords, then parses the three APIs as appropriate for information relating to the search, and feeding it back to the user. Searches not containing keywords or erroneous queries will error out.

The amount of APIs searched through depends on the keywords. Something like “how long to reach {{exoplanet}} with SpaceX Falcon 9” will work like this:

  • Search exoplanets API for the planet
  • Search Wikipedia API for the engine/rocket
  • Use the data gathered from the two above APIs to send an equation to Wolfram|Alpha
  • Return the result.

Instructions for running this project

Cloning

First, procure the ability to run Git commands.

  • On Windows: Install Git Bash.

  • On macOS: Use the git-osx-installer. If you have XCode installed on your machine, you may already have Git functionality.

  • On Linux (preferably an Ubuntu based distribution): You already have Git!

Now, you can clone this repo. To do so, type into a terminal session:

git clone https://github.com/pollsmor/Project_01.git

The project repo should then clone into whatever folder you ran the clone command in.

Dependencies

You must install the pip modules listed in the /doc/requirements.txt file. To do so, install them in a Terminal with:

pip install -r <location of requirements.txt file>

The -r flag is necessary to distinguish it from a typical pip install. Without the -r, pip will look for a package online called "requirements.txt". That is obviously not desirable.

Note that on certain systems (like the school computers), the pip command may be restricted. To get around this, create a virtual environment with:

python3 -m venv <name_of_venv>

Note that if your system only has Python 3 installed, just remove the 3 from the above command.

To activate the virtual environment, cd into the directory you created the environment in, and run the "activate" file. Now, you should be able to pip install the requirements. To deactivate the environment, run the "deactivate" file.

Run the program

After installing the required dependencies, all you need to do to run the program is to type into a terminal session:

python3 app.py

Again, remove the 3 after the "python" if necessary.