-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq_execute_scripts.py
More file actions
35 lines (24 loc) · 1.14 KB
/
q_execute_scripts.py
File metadata and controls
35 lines (24 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from q_functions_split import db_interface, db_query
# --- LEAVE ALONE ---
# steamdb = db_interface('steamdata.db')
steamdb = db_interface('D:\steam\steamdata.db')
# --- FOR DF/CSV/JSON, PUT SQL FILE PATH HERE ---
steamdb.set_query('test.sql')
# --- RUN THIS TO GET DATAFRAME / TEST YOUR OUTPUT ---
# print(steamdb.get_df())
# --- RUN THIS TO GET CSV FILE FROM QUERY ---
# For memory issues, use parameter "chunk=number" example: steamdb.get_csv(chunk=1000)
steamdb.get_csv()
# --- RUN THIS TO GET JSON FILE FROM QUERY ---
# steamdb.get_json()
# # --- RUN THIS TO DELETE NON-GAME GENRE ---
# steamdb.csv_to_table('queries\delete_genres.sql')
# # --- RUN THESE IN ORDER FOR COUNTRY DATA ---
# steamdb.csv_to_table('resources\countries_codes_and_coordinates.csv')
# steamdb.exec_script('queries\create_games_countries.sql')
# steamdb.exec_script('queries\create_game_ownership_by_country.sql')
# # # --- RUN THESE PRIOR TO DOING VISUALIZATION ---
# steamdb.exec_script('queries\create vw_games.sql')
# steamdb.exec_script('queries\create vw_game_ownership.sql')
# steamdb.exec_script('queries\create vw_genre_achievements.sql')
# steamdb.exec_script('test.sql')