Skip to content

zehengl/lighten-up-calgary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

lighten-up-calgary

coding_style

A playground for YYC Christmas light displays

Environment

  • Python 3.9
  • Windows 10

Install

Create a virtual environment.

python -m venv .venv
.\.venv\Scripts\activate

Then install dependencies.

pip install -r .\requirements.txt

Use pip install -r requirements-dev.txt for development.

Usage

IMPORTANT: You need a GCP API key for geocoding and MapQuest API key to get the optimized route.

Create a .env file to store your GCP API key and MapQuest API key.

# .env
# required
MAPQUEST_KEY="xxx"
GCP_KEY="yyy"

Crawling address data from Lighten UP Calgary for year 2020

python .\crawl.py 2020

Address data will be saved in 2020.json located at the data folder. Addresses come with latitude/longitude and are formatted.

Visualizing address data

python .\display.py

Interactive html files display.html and route.html will be saved at the output folder.

  1. Given a starting location and a list of addresses, find the best route to see all light displays (route.html)

    Estimated time for the trip is printed in the console.

  2. Simply show all the light displays (display.html)

Demo Webapp

python .\app.py

Credits