kdubss / NodeJS-Weather-App

NodeJS Command-Line-Interface weather app, which uses the CLI to fetch the current weather conditions for a geospatial location input. Python Flask server written to fetch/parse JSON data from the Dark Sky API, and, D3 used to visualize weather data. Currently, the browser front end is in development, but the goal is to create the Front-End using React
9 stars 2 forks source link
d3 darksky-api data data-visualization flask flask-server javascript pandas python weather

Weather-App: JavaScript, Python/Pandas, D3.js, (React.js)

Table Of Contents

Still to do...

  1. Description
  2. CLI-Tool
  3. Web-App
  4. API-Requests
  5. Flask-Server
  6. D3.js
  7. Weather Data Parameters

Description

A CLI weather-tool / (app) which fetches a lat/lon coordinates of user-input address (postal codes, zip codes, cities, etc.), from the Google maps API, and uses those coordinates to fetch the past, current, and forecasted weather data from the forecast.io (darksky.net) API (requires an API-key). Currently, this only functions as a CLI (command-line-interface) tool, where functionality is run by Node.js (e.g. $node app.js -a [address]) based on the user-input address.

The goal of this project is to ultimately use React.js to create the font-end of an on-line app where current, hourly, and minutely weather data will be displayed, both visually as time-series figures and as data tables, depending on the input-address from the user. Visual representation will be presented by using D3.js; Back-end will be powered by Node.js (currently, to test out and learn the D3.js library, the back-end server will be powered by Python); Data fetching, parsing, and manipulations will be done so using Python/Pandas.

Back 2 ToC 👆

1. Command-Line-Tool (written in JavaScript)

The CLI tool is a quick way of fetching the current weather conditions from the DarkSky API. Simply call the app.js script via. node and the -a flag to specify a specific address (either a city's name - i.e. Vancouver, or a postal/zip code, or even a country's name) to output the current weather conditions for the specified address.

fetch_by_name

fetch_by_zip

fetch_by_country

2. Web-App (work-in-progress; written in Python/D3.js)

The web-app is still a work-in-progress, but from the current code there is a currently functional MVP with the current code-base. Currently, there are two parts to the MVP. Firstly, weather.py is run, to fetch the weather data from the DarkSky API. Second, when all the data has been fetched, parsed, and saved, the Flask server passes the data to the static html files that renders the data using D3.

Still to do:

1. Revise the D3 code to be more modular → complete

Back 2 ToC 👆

API requests

1. Forecast requests

2. Time-Machine requests

Back 2 ToC 👆

Flask server

Back 2 ToC 👆

D3.js charts

Line Chart

D3 Render

multitemp

solved

forecast

hindcast

Back 2 ToC 👆

Data Parameters (found at forecast.io) - Hourly Data

(for full details on request response formats, see here)