File tree Expand file tree Collapse file tree
statvar_imports/crdc/instructional_wifi_devices Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 logging .StreamHandler ()
2020 ]
2121)
22+ OUTPUT_DIR = Path ("input_files" )
23+ # Create the output directory if it doesn't exist
24+ try :
25+ OUTPUT_DIR .mkdir (exist_ok = True )
26+ logging .info (f"Output directory created/verified: { OUTPUT_DIR .resolve ()} " )
27+ except Exception as e :
28+ logging .fatal (f"FATAL: Could not create output directory { OUTPUT_DIR .resolve ()} . Exiting. Error: { e } " )
29+ exit (1 )
2230
2331# --- Configuration ---
2432BASE_URL = "https://civilrightsdata.ed.gov/assets/ocr/docs/"
@@ -53,19 +61,6 @@ def generate_year_strings(start_year=2020):
5361
5462YEAR_STRINGS = generate_year_strings ()
5563
56- OUTPUT_DIR = Path ("input_files" )
57-
58- # Create the output directory if it doesn't exist
59- try :
60- OUTPUT_DIR .mkdir (exist_ok = True )
61- logging .info (f"Output directory created/verified: { OUTPUT_DIR .resolve ()} " )
62- except Exception as e :
63- logging .fatal (f"FATAL: Could not create output directory { OUTPUT_DIR .resolve ()} . Exiting. Error: { e } " )
64- exit (1 )
65-
66- logging .info (f"Checking for data from academic years (newest first): { ', ' .join (YEAR_STRINGS )} " )
67-
68-
6964def get_full_year (year_string ):
7065 """
7166 Derives the full year (e.g., 2024 from '2023-24') for the YEAR column.
@@ -155,4 +150,4 @@ def process_crdc_data(year_string):
155150 # Be polite to the server by adding a small delay between large downloads
156151 time .sleep (2 )
157152
158- logging .info ("\n All tasks complete." )
153+ logging .info ("\n All tasks complete." )
You can’t perform that action at this time.
0 commit comments