-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcollect_all_data.py
More file actions
56 lines (45 loc) · 1.74 KB
/
collect_all_data.py
File metadata and controls
56 lines (45 loc) · 1.74 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
import subprocess
import sys
import time
def run_script(script_name):
"""Run a Python script and return its exit code."""
print(f"\n{'='*50}")
print(f"Running {script_name}...")
print(f"{'='*50}\n")
result = subprocess.run([sys.executable, script_name])
return result.returncode
def main():
print("\n=== Schoolify Comprehensive Data Collection ===\n")
print("This script will run all data collection steps in sequence to build")
print("a complete database of Victorian schools and suburbs.\n")
# Define the scripts to run in order
scripts = [
"download_postcodes.py",
"fetch_vic_govt_schools.py",
"comprehensive_scraper.py",
"update_database.py"
]
# Run each script in sequence
for script in scripts:
if not os.path.exists(script):
print(f"Error: Script {script} not found!")
return
exit_code = run_script(script)
if exit_code != 0:
print(f"\nError: Script {script} failed with exit code {exit_code}")
print("Stopping the data collection process.")
return
# Add a short pause between scripts
time.sleep(1)
# Run the count script to show the results
print("\n=== Data Collection Complete ===\n")
print("Running count_database_entries.py to show the results...\n")
run_script("count_database_entries.py")
print("\n=== All Done! ===\n")
print("Your Schoolify database now contains comprehensive data for Victorian schools and suburbs.")
print("You can view the data in:")
print("- data/school_data_final.json (Schools)")
print("- js/geocode-db.js (Suburbs)")
if __name__ == "__main__":
main()