{"record":{"id":"79016cbd413ec12c","repo":"Graphify-Labs/graphify","slug":"google-sheets-export-requires-the-office-extra-pi","errorCode":null,"errorMessage":"Google Sheets export requires the office extra: pip install graphifyy[office,google]","messagePattern":"Google Sheets export requires the office extra: pip install graphifyy\\[office,google\\]","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"graphify/google_workspace.py","lineNumber":211,"sourceCode":"        out_path.write_text(_with_frontmatter(path, shortcut, body, \"text/markdown\"), encoding=\"utf-8\")\n        return out_path\n\n    if ext == \".gslides\":\n        with tempfile.NamedTemporaryFile(\"w+b\", suffix=\".txt\", delete=False, dir=out_dir) as tmp:\n            tmp_path = Path(tmp.name)\n        try:\n            _run_gws_export(shortcut[\"file_id\"] or \"\", \"text/plain\", tmp_path, shortcut.get(\"resource_key\"))\n            body = tmp_path.read_text(encoding=\"utf-8\", errors=\"replace\")\n        finally:\n            tmp_path.unlink(missing_ok=True)\n        if not body.strip():\n            return None\n        out_path.write_text(_with_frontmatter(path, shortcut, body, \"text/plain\"), encoding=\"utf-8\")\n        return out_path\n\n    if ext == \".gsheet\":\n        if xlsx_to_markdown is None:\n            raise RuntimeError(\"Google Sheets export requires the office extra: pip install graphifyy[office,google]\")\n        with tempfile.NamedTemporaryFile(\"w+b\", suffix=\".xlsx\", delete=False, dir=out_dir) as tmp:\n            tmp_path = Path(tmp.name)\n        try:\n            _run_gws_export(\n                shortcut[\"file_id\"] or \"\",\n                \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n                tmp_path,\n                shortcut.get(\"resource_key\"),\n            )\n            body = xlsx_to_markdown(tmp_path)\n        finally:\n            tmp_path.unlink(missing_ok=True)\n        if not body.strip():\n            return None\n        out_path.write_text(\n            _with_frontmatter(\n                path,\n                shortcut,","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/graphify/google_workspace.py#L193-L229","documentation":"Raised when exporting a .gsheet shortcut to markdown: the flow downloads the sheet as .xlsx via gws and then converts it with xlsx_to_markdown, which is imported lazily from graphify's office tooling. If that import failed at module load (xlsx_to_markdown is None), the office extra (openpyxl etc.) is missing and the error names the extra install — note the message's 'graphifyy[office,google]' spelling mirrors the packaged extra name.","triggerScenarios":"Scanning a tree containing .gsheet files in an install without the office extra: the module-level `from graphify... import xlsx_to_markdown` was guarded, leaving the name None, and the .gsheet branch refuses to proceed with a None converter.","commonSituations":"pip-installing core graphify and then pointing it at a Drive-synced folder of spreadsheets; CI images built from minimal requirements; the google extra installed but office forgotten.","solutions":["pip install 'graphifyy[office,google]' (install both extras so gws-side helpers and xlsx parsing are present)","Verify the converter imports in the same interpreter: `python -c \"from graphify.office import xlsx_to_markdown\"` (module path per your install)","If spreadsheets are out of scope, exclude .gsheet files from the scan"],"exampleFix":"# before\npip install graphifyy\ngraphify build .   # RuntimeError: Google Sheets export requires the office extra\n\n# after\npip install 'graphifyy[office,google]'\ngraphify build .","handlingStrategy":"validation","validationCode":"import importlib.util\n\noffice_ok = importlib.util.find_spec(\"openpyxl\") is not None\nif not office_ok:\n    raise SystemExit(\"Google Sheets export needs the office extra: pip install 'graphifyy[office,google]'\")","typeGuard":null,"tryCatchPattern":"try:\n    export_google_shortcut(gsheet_path, out_dir)\nexcept RuntimeError as e:\n    if \"office extra\" in str(e):\n        raise SystemExit(f\"setup error: {e}\")  # install extras, don't skip silently\n    raise","preventionTips":["Install graphify with all needed extras up front: pip install 'graphifyy[office,google]'","Probe for openpyxl before scanning trees that contain .gsheet files","Document which file types require which extras next to your scan configuration"],"tags":["dependency","extras","google-workspace","spreadsheets","optional-features"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}