Vincent Chi, Bill Ni, Jason Tung, Wei Wen Zhou
Our website is designed to provide the user with information correlating certain locations (much like an almanac) but do so while also giving more “live” information like current news in the area, the weather, what time the sun will set on a given day, etc. We plan on presenting this in a newspaper format (like NYT) with horoscopes, poems, and maybe a crossword puzzle.
Our project utilizes various APIs, so the user needs a json file with the API keys formatted as such (the skeleton is provided under keys.json
):
{
"newsapi":"xxxxxxxxx",
"darksky":"xxxxxxxxx",
"calendarindex":"xxxxxxxxx",
"nasa":"xxxxxxxxx"
}
This will be elaborated upon in the instructions. Just fetch your API keys for now.
All of the APIs we used are hyperlinked in the table below with a brief description. The hyperlinks should be sufficient to get the user started on procuring API keys. Please note that not all of the apis need keys.
api | description |
---|---|
calendar index | Gives dates of holidays and observances |
sunrise-sunset | Provides time for sunrise, high noon, and sunset |
darksky | To get the past, current, and future weather at a location |
ipapi | To get the information about location based on ip address |
horoscope-api | To get the daily, weekly, monthly horoscope |
newsapi | To get the news or anything |
poemist | Get a random poem |
nasa-api | Used to fetch a picture of location based on long/lat |
Our dependencies, as listed in requirements.txt, are as follows:
dependency | version | origin | description |
---|---|---|---|
Click | 7.0 | Flask | unused |
Flask | 1.0.2 | Flask | microframework of choice |
itsdangerous | 1.1.0 | Flask | unused |
Jinja2 | 2.10 | Flask | templating language |
MarkupSafe | 1.1.0 | Flask | unused |
Werkzeug | 0.14.1 | Flask | unused |
json | n/a | py3.7.1-stdlib | converts json strings into python dictionaries and vice-versa |
datetime | n/a | py3.7.1-stdlib | fetches current date and time |
urllib | n/a | py3.7.1-stdlib | fetches json data from urls |
urllib.request | n/a | py3.7.1-stdlib | fetches json data from urls |
Install our dependencies with the follow command in the root directory of our repo:
pip3 install -r requirements.txt
- Clone the repo
ssh
git clone git@github.com:jason-tung/sd_p01.git
https
git clone https://github.com/jason-tung/sd_p01.git
- (optional) make a virtual env
python3 -m venv <venv_name>
- (optional) activate virtual env
. <path-to-venv>/bin/activate
- enter the repo directory
cd <path-to-repo>
- install requirements
python 3.7
pip3 install -r requirements.txt
if in virtual env with python 3.7
pip install -r requirements.txt
6a. edit/make file named keys.json
.
6b. fill the keys.json
file with your corresponding api keys in the following format (the api keys i filled out are made up):
{
"newsapi":"xxxxxxxxx",
"darksky":"xxxxxxxxx",
"calendarindex":"xxxxxxxxx",
"nasa":"xxxxxxxxx"
}
- run the app.py with python3
python 3.7
python3 app.py
if in virtual env with python 3.7
python app.py
-
go to localhost 127.0.0.1:5000 on any browser