diff options
| author | Priyansh <[email protected]> | 2021-12-09 03:01:49 -0500 |
|---|---|---|
| committer | Priyansh <[email protected]> | 2021-12-09 03:01:49 -0500 |
| commit | 3b48c04470e2c368ba18716bb789b40942d6989f (patch) | |
| tree | 1cb97d5271f2233fbf9d0ef864b91fc8a61efb17 /app/main.py | |
| parent | 22e1d761027501bfa59b92776cf1c13eef3a0004 (diff) | |
| download | temp_pred_arima-3b48c04470e2c368ba18716bb789b40942d6989f.tar.xz temp_pred_arima-3b48c04470e2c368ba18716bb789b40942d6989f.zip | |
changed project structure
Diffstat (limited to 'app/main.py')
| -rw-r--r-- | app/main.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/app/main.py b/app/main.py deleted file mode 100644 index c2308f9..0000000 --- a/app/main.py +++ /dev/null @@ -1,32 +0,0 @@ -from flask import Flask, render_template -from flask import Markup -import sqlite3 as sql -import pandas as pd - -app = Flask(__name__) - - -def execute_sql_statement(sql_statement, conn): - cur = conn.cursor() - cur.execute(sql_statement) - rows = cur.fetchall() - return rows - -def get_list_of_dict(keys, list_of_tuples): - list_of_dict = [dict(zip(keys, values)) for values in list_of_tuples] - return list_of_dict - -def get_cities_list(): - conn = sql.connect("database.db") - sql_statement = 'SELECT DISTINCT(City_Name) as City_Name, Lat, Long FROM City_table join Loc_Table on City_Table.City_Id = Loc_table.City_Id' - df=pd.read_sql_query(sql_statement, conn).to_records(index=False) - return df - [email protected]("/") [email protected]("/index") -def index(): - - cities_list = get_cities_list() - keys = ("city", "latitude", "longitude") - cities_list = get_list_of_dict(keys, cities_list) - return render_template("index.html", cities_list=cities_list)
\ No newline at end of file |
