""" Script 00 – Project setup. Creates all required directories and validates that the raw input files exist. Run once after cloning the repository. """ import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(ROOT)) from src.routing_engine.config import DEFAULT_CONFIG cfg = DEFAULT_CONFIG DIRS = [ cfg.raw_index_dir, cfg.processed_dir, cfg.reference_dir, cfg.quality_dir, cfg.schedules_dir, cfg.figures_dir, cfg.exports_dir, ROOT / "outputs" / "dashboards", ] print("Creating project directories…") for d in DIRS: d.mkdir(parents=True, exist_ok=True) print(f" ok {d.relative_to(ROOT)}") print("\nChecking raw input files…") REQUIRED = [cfg.flight_schedule_file, cfg.aircraft_file, cfg.checks_file, cfg.airports_file] all_ok = True for fname in REQUIRED: p = cfg.raw_dir / fname if p.exists(): size = p.stat().st_size print(f" ok {fname} ({size:,} bytes)") else: print(f" ✗ {fname} NOT FOUND") all_ok = False if all_ok: print("\n[OK] Setup complete. Run scripts in order: 01 -> 02 -> 03 -> 04.") else: print("\n[!] Some raw files are missing. Place them in the 'raw/' folder and re-run.") sys.exit(1)