Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
87 lines
3.1 KiB
Python
87 lines
3.1 KiB
Python
"""
|
|
Create Input/input.xlsx (if missing) and refresh Input/input.xlsx.example.
|
|
|
|
Run from repository root:
|
|
python scripts/bootstrap_input_xlsx.py
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
import pandas as pd
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parent.parent
|
|
INPUT_DIR = PROJECT_ROOT / "Input"
|
|
CONFIG_PATH = INPUT_DIR / "input.xlsx"
|
|
EXAMPLE_PATH = INPUT_DIR / "input.xlsx.example"
|
|
|
|
FACILITY_KEYWORDS = [
|
|
"amaya", "brighton place san diego", "brighton place sd", "brighton place spring valley",
|
|
"brighton place-spring valley", "granite hill", "anberry", "arbor hills", "bayberry",
|
|
"bradley court", "castle manor", "friendship", "gramercy", "kearny", "lakeside",
|
|
"newport", "siena", "stanford court", "temecula", "walnut", "balboa", "cottonwood",
|
|
"country hills", "la mesa", "university care", "blue oak", "bridgewood", "capistrano",
|
|
"eden", "hillcrest heights", "la casa via", "torrey pines", "bradley gardens", "horizon",
|
|
"community care", "jacob", "the shores", "valley vista", "valle vista", "golden hill",
|
|
"grossmont post acute", "lemon grove", "mission hills", "parkside", "somerset",
|
|
"the springs", "victoria", "reo vista", "san diego post acute", "villa las palmas",
|
|
"ridgeview", "windsor gardens", "windsor rosewood",
|
|
]
|
|
FACILITIES = [k.title() for k in FACILITY_KEYWORDS]
|
|
FACILITIES.append("REPLACE_WITH_54TH_FACILITY_NAME")
|
|
|
|
DEFAULT_PLANNER_URL = (
|
|
"https://planner.cloud.microsoft/webui/mytasks/assignedtome/view/grid"
|
|
"?tid=0c15ad2c-19dd-4ded-9cd1-20d344386414"
|
|
)
|
|
|
|
SHEET1_ROWS = [
|
|
("Proxy IP", ""),
|
|
("Proxy Port", ""),
|
|
("Proxy Username", ""),
|
|
("Proxy Password", ""),
|
|
("OneDrive Username", ""),
|
|
("OneDrive Password", ""),
|
|
("Microsoft TOTP Secret", ""),
|
|
("Planner URL", DEFAULT_PLANNER_URL),
|
|
(
|
|
"OneDrive URL",
|
|
"https://netorg393890-my.sharepoint.com/personal/joy_accesspsychology_org"
|
|
"/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Fjoy%5Faccesspsychology%5Forg%2FDocuments"
|
|
"%2FAccess%20Facility%20Spreadsheets3",
|
|
),
|
|
("pdf_folder_path", str(PROJECT_ROOT / "Input" / "PDFs")),
|
|
]
|
|
|
|
|
|
def _build_workbook() -> tuple[pd.DataFrame, pd.DataFrame]:
|
|
sheet1 = pd.DataFrame(SHEET1_ROWS, columns=["Key", "Value"])
|
|
facilities = pd.DataFrame({"Facility Name": FACILITIES})
|
|
return sheet1, facilities
|
|
|
|
|
|
def _write(path: Path, sheet1: pd.DataFrame, facilities: pd.DataFrame) -> None:
|
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
with pd.ExcelWriter(path, engine="openpyxl") as writer:
|
|
sheet1.to_excel(writer, sheet_name="Sheet1", index=False, header=False)
|
|
facilities.to_excel(writer, sheet_name="Facilities", index=False)
|
|
|
|
|
|
def main() -> None:
|
|
sheet1, facilities = _build_workbook()
|
|
|
|
_write(EXAMPLE_PATH, sheet1, facilities)
|
|
print(f"Wrote template -> {EXAMPLE_PATH} ({len(FACILITIES)} facilities)")
|
|
|
|
if CONFIG_PATH.exists():
|
|
print(f"Skipped (already exists): {CONFIG_PATH}")
|
|
return
|
|
|
|
_write(CONFIG_PATH, sheet1, facilities)
|
|
print(f"Created local config -> {CONFIG_PATH}")
|
|
print("Edit input.xlsx with your credentials before running run_download.py")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|