"""Build a minimal Word document listing the six people with open questions. No external deps — a .docx is a zip of OOXML files, so we construct it directly with the stdlib. Output: cascades-staff-open-questions-2026-04-22.docx """ from __future__ import annotations import os import zipfile from xml.sax.saxutils import escape OUT = "clients/cascades-tucson/docs/cloud/questionnaires/cascades-staff-open-questions-2026-04-22.docx" TITLE = "Cascades — One Outstanding Item on Staff Access List" SUBTITLE = "2026-04-22 · prepared by Howard Enos, Computer Guru · post John's reply" INTRO = ( "Thank you for getting back to me on the staff list — almost everything is squared " "away now. Britney and Polett have been removed from the roster (no longer employees), " "Alma's title and access are set (Memory Care Life Enrichment, D+P, ALIS, offsite), " "and drivers will stay on the roster for tracking but no longer get Cascades IT accounts. " "On the two Reliable Agency caregivers: after a HIPAA compliance review, we cannot use " "shared log-ins for PHI access (it's a federal rule, §164.312(a)(2)(i)). Reliable will " "need to provide individual caregiver names before those caregivers can have their own " "Cascades account — otherwise they will need to work under the direct supervision of a " "Cascades-employed caregiver who is signed in. There is one small item still outstanding " "from the staff list itself — see below." ) QUESTIONS = [ { "name": "Ederick Yuzon", "dept": "Caregivers (Tower, Tue–Sat)", "context": ( "Just want to match the spelling on his payroll / ID so his account name is correct." ), "questions": [ "Is his first name spelled \"Ederick\", \"Edrick\", or something else?", ], }, ] CLOSING = ( "Once that spelling is confirmed I will build every caregiver account in one pass. " "The rest of the setup (Alma, Kyla, the two Reliable shared logins, and disabling " "Britney's + the three driver accounts) is ready to start. Thank you!" ) # ----------------------------------------------------------------------------- # OOXML building # ----------------------------------------------------------------------------- NSW = "http://schemas.openxmlformats.org/wordprocessingml/2006/main" def para(text: str, *, style: str | None = None, bold: bool = False, size: int | None = None) -> str: """A single with one run. Font size is in half-points.""" pPr = "" if style: pPr = f'' rPr_parts = [] if bold: rPr_parts.append("") if size is not None: rPr_parts.append(f'') rPr = f"{''.join(rPr_parts)}" if rPr_parts else "" return ( f'{pPr}' f'{rPr}{escape(text)}' f'' ) def bullet(text: str) -> str: return ( '' '' f'{escape(text)}' ) def blank_answer_line() -> str: """A hand-written answer placeholder: 'Answer: ________________'.""" return ( '' '' 'Answer: ' '' '____________________________________________________________' '' ) def section_for(q: dict) -> str: parts = [] parts.append(para(q["name"], style="Heading2")) parts.append(para(q["dept"], bold=True, size=20)) parts.append(para(q["context"])) for ques in q["questions"]: parts.append(bullet(ques)) parts.append(blank_answer_line()) parts.append(para("")) # spacer return "".join(parts) def build_document_xml() -> str: body_parts = [] body_parts.append(para(TITLE, style="Title")) body_parts.append(para(SUBTITLE, bold=False, size=20)) body_parts.append(para("")) body_parts.append(para(INTRO)) body_parts.append(para("")) for q in QUESTIONS: body_parts.append(section_for(q)) body_parts.append(para("")) body_parts.append(para(CLOSING)) body = "".join(body_parts) return ( '' f'' f'{body}' '' '' '' '' '' '' ) STYLES_XML = ''' ''' NUMBERING_XML = ''' ''' CONTENT_TYPES_XML = ''' ''' ROOT_RELS_XML = ''' ''' DOC_RELS_XML = ''' ''' def build_docx(path: str) -> None: os.makedirs(os.path.dirname(path), exist_ok=True) with zipfile.ZipFile(path, "w", zipfile.ZIP_DEFLATED) as z: z.writestr("[Content_Types].xml", CONTENT_TYPES_XML) z.writestr("_rels/.rels", ROOT_RELS_XML) z.writestr("word/_rels/document.xml.rels", DOC_RELS_XML) z.writestr("word/document.xml", build_document_xml()) z.writestr("word/styles.xml", STYLES_XML) z.writestr("word/numbering.xml", NUMBERING_XML) if __name__ == "__main__": build_docx(OUT) print(f"Wrote {OUT}")