Skip to content

ycraaron/flask-weather-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3 Branches

  • This repo has 3 braches.
  • master: weather API
  • merge_interval: a tail recursion algorithm of merging a list of interval.
  • stack_tower: algorithm for stacking a bunch of books in to a stable tower.

Weather API

  1. A worker that fetches the current weather data for HK and SG every minute.
  2. Store the temperature and humidity, etc data with timestamps in MongoDB
  3. Provide a RESTFUL API endpoint to query the weather data from the database.

Links

Tech stack

 - Flask + MongoDB + Python

Functionality

  1. Collect weather data from pyowm.
  2. Prepare and process data, store the data into MongoDB.

Installation

  • make sure mongodb > 3.4 is installed and running
  • git clone this repo
  • pip3 install -r dev-requirement.txt OR pip3 install flask pymongo -y
  • pip3 install pyowm

Run

Run worker to get weather data:

$/path/to/python3 worker.py

Run server:

$/path/to/python3 app.py

Test use case:

Releases

No releases published

Packages

No packages published

Languages