docagent-cli 0.0.35__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docagent_cli/__init__.py +36 -0
- docagent_cli/__main__.py +6 -0
- docagent_cli/_ask_user_types.py +90 -0
- docagent_cli/_cli_context.py +27 -0
- docagent_cli/_debug.py +52 -0
- docagent_cli/_env_vars.py +56 -0
- docagent_cli/_server_config.py +352 -0
- docagent_cli/_session_stats.py +114 -0
- docagent_cli/_testing_models.py +144 -0
- docagent_cli/_version.py +17 -0
- docagent_cli/agent.py +1193 -0
- docagent_cli/app.py +4979 -0
- docagent_cli/app.tcss +283 -0
- docagent_cli/ask_user.py +301 -0
- docagent_cli/built_in_skills/__init__.py +5 -0
- docagent_cli/built_in_skills/doc-coauthoring/SKILL.md +375 -0
- docagent_cli/built_in_skills/docx/LICENSE.txt +30 -0
- docagent_cli/built_in_skills/docx/SKILL.md +590 -0
- docagent_cli/built_in_skills/docx/scripts/__init__.py +1 -0
- docagent_cli/built_in_skills/docx/scripts/accept_changes.py +135 -0
- docagent_cli/built_in_skills/docx/scripts/comment.py +318 -0
- docagent_cli/built_in_skills/docx/scripts/office/helpers/__init__.py +0 -0
- docagent_cli/built_in_skills/docx/scripts/office/helpers/merge_runs.py +199 -0
- docagent_cli/built_in_skills/docx/scripts/office/helpers/simplify_redlines.py +197 -0
- docagent_cli/built_in_skills/docx/scripts/office/pack.py +159 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- docagent_cli/built_in_skills/docx/scripts/office/soffice.py +183 -0
- docagent_cli/built_in_skills/docx/scripts/office/unpack.py +132 -0
- docagent_cli/built_in_skills/docx/scripts/office/validate.py +111 -0
- docagent_cli/built_in_skills/docx/scripts/office/validators/__init__.py +15 -0
- docagent_cli/built_in_skills/docx/scripts/office/validators/base.py +847 -0
- docagent_cli/built_in_skills/docx/scripts/office/validators/docx.py +446 -0
- docagent_cli/built_in_skills/docx/scripts/office/validators/pptx.py +275 -0
- docagent_cli/built_in_skills/docx/scripts/office/validators/redlining.py +247 -0
- docagent_cli/built_in_skills/docx/scripts/templates/comments.xml +3 -0
- docagent_cli/built_in_skills/docx/scripts/templates/commentsExtended.xml +3 -0
- docagent_cli/built_in_skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- docagent_cli/built_in_skills/docx/scripts/templates/commentsIds.xml +3 -0
- docagent_cli/built_in_skills/docx/scripts/templates/people.xml +3 -0
- docagent_cli/built_in_skills/pdf/LICENSE.txt +30 -0
- docagent_cli/built_in_skills/pdf/SKILL.md +314 -0
- docagent_cli/built_in_skills/pdf/forms.md +294 -0
- docagent_cli/built_in_skills/pdf/reference.md +612 -0
- docagent_cli/built_in_skills/pdf/scripts/check_bounding_boxes.py +65 -0
- docagent_cli/built_in_skills/pdf/scripts/check_fillable_fields.py +11 -0
- docagent_cli/built_in_skills/pdf/scripts/convert_pdf_to_images.py +33 -0
- docagent_cli/built_in_skills/pdf/scripts/create_validation_image.py +37 -0
- docagent_cli/built_in_skills/pdf/scripts/extract_form_field_info.py +122 -0
- docagent_cli/built_in_skills/pdf/scripts/extract_form_structure.py +115 -0
- docagent_cli/built_in_skills/pdf/scripts/fill_fillable_fields.py +98 -0
- docagent_cli/built_in_skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- docagent_cli/built_in_skills/pptx/LICENSE.txt +30 -0
- docagent_cli/built_in_skills/pptx/SKILL.md +232 -0
- docagent_cli/built_in_skills/pptx/editing.md +205 -0
- docagent_cli/built_in_skills/pptx/pptxgenjs.md +420 -0
- docagent_cli/built_in_skills/pptx/scripts/__init__.py +0 -0
- docagent_cli/built_in_skills/pptx/scripts/add_slide.py +195 -0
- docagent_cli/built_in_skills/pptx/scripts/clean.py +286 -0
- docagent_cli/built_in_skills/pptx/scripts/office/helpers/__init__.py +0 -0
- docagent_cli/built_in_skills/pptx/scripts/office/helpers/merge_runs.py +199 -0
- docagent_cli/built_in_skills/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
- docagent_cli/built_in_skills/pptx/scripts/office/pack.py +159 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- docagent_cli/built_in_skills/pptx/scripts/office/soffice.py +183 -0
- docagent_cli/built_in_skills/pptx/scripts/office/unpack.py +132 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validate.py +111 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validators/__init__.py +15 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validators/base.py +847 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validators/docx.py +446 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validators/pptx.py +275 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validators/redlining.py +247 -0
- docagent_cli/built_in_skills/pptx/scripts/thumbnail.py +289 -0
- docagent_cli/built_in_skills/remember/SKILL.md +118 -0
- docagent_cli/built_in_skills/skill-creator/LICENSE.txt +202 -0
- docagent_cli/built_in_skills/skill-creator/SKILL.md +485 -0
- docagent_cli/built_in_skills/skill-creator/agents/analyzer.md +274 -0
- docagent_cli/built_in_skills/skill-creator/agents/comparator.md +202 -0
- docagent_cli/built_in_skills/skill-creator/agents/grader.md +223 -0
- docagent_cli/built_in_skills/skill-creator/assets/eval_review.html +146 -0
- docagent_cli/built_in_skills/skill-creator/eval-viewer/generate_review.py +471 -0
- docagent_cli/built_in_skills/skill-creator/eval-viewer/viewer.html +1325 -0
- docagent_cli/built_in_skills/skill-creator/references/schemas.md +430 -0
- docagent_cli/built_in_skills/skill-creator/scripts/__init__.py +0 -0
- docagent_cli/built_in_skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- docagent_cli/built_in_skills/skill-creator/scripts/generate_report.py +326 -0
- docagent_cli/built_in_skills/skill-creator/scripts/improve_description.py +247 -0
- docagent_cli/built_in_skills/skill-creator/scripts/package_skill.py +136 -0
- docagent_cli/built_in_skills/skill-creator/scripts/quick_validate.py +103 -0
- docagent_cli/built_in_skills/skill-creator/scripts/run_eval.py +310 -0
- docagent_cli/built_in_skills/skill-creator/scripts/run_loop.py +328 -0
- docagent_cli/built_in_skills/skill-creator/scripts/utils.py +47 -0
- docagent_cli/built_in_skills/theme-factory/LICENSE.txt +202 -0
- docagent_cli/built_in_skills/theme-factory/SKILL.md +59 -0
- docagent_cli/built_in_skills/theme-factory/theme-showcase.pdf +0 -0
- docagent_cli/built_in_skills/theme-factory/themes/arctic-frost.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/botanical-garden.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/desert-rose.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/forest-canopy.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/golden-hour.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/midnight-galaxy.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/modern-minimalist.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/ocean-depths.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/sunset-boulevard.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/tech-innovation.md +19 -0
- docagent_cli/built_in_skills/xlsx/LICENSE.txt +30 -0
- docagent_cli/built_in_skills/xlsx/SKILL.md +292 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/helpers/__init__.py +0 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/helpers/merge_runs.py +199 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/pack.py +159 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/soffice.py +183 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/unpack.py +132 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validate.py +111 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validators/__init__.py +15 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validators/base.py +847 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validators/docx.py +446 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validators/pptx.py +275 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validators/redlining.py +247 -0
- docagent_cli/built_in_skills/xlsx/scripts/recalc.py +184 -0
- docagent_cli/clipboard.py +128 -0
- docagent_cli/command_registry.py +284 -0
- docagent_cli/config.py +2418 -0
- docagent_cli/configurable_model.py +162 -0
- docagent_cli/default_agent_prompt.md +12 -0
- docagent_cli/editor.py +142 -0
- docagent_cli/file_ops.py +473 -0
- docagent_cli/formatting.py +28 -0
- docagent_cli/hooks.py +206 -0
- docagent_cli/input.py +787 -0
- docagent_cli/integrations/__init__.py +1 -0
- docagent_cli/integrations/sandbox_factory.py +873 -0
- docagent_cli/integrations/sandbox_provider.py +71 -0
- docagent_cli/local_context.py +718 -0
- docagent_cli/main.py +1641 -0
- docagent_cli/mcp_tools.py +707 -0
- docagent_cli/mcp_trust.py +168 -0
- docagent_cli/media_utils.py +478 -0
- docagent_cli/model_config.py +1620 -0
- docagent_cli/non_interactive.py +948 -0
- docagent_cli/offload.py +371 -0
- docagent_cli/output.py +69 -0
- docagent_cli/project_utils.py +188 -0
- docagent_cli/py.typed +0 -0
- docagent_cli/remote_client.py +515 -0
- docagent_cli/server.py +520 -0
- docagent_cli/server_graph.py +196 -0
- docagent_cli/server_manager.py +365 -0
- docagent_cli/sessions.py +1262 -0
- docagent_cli/skills/__init__.py +18 -0
- docagent_cli/skills/commands.py +1090 -0
- docagent_cli/skills/load.py +192 -0
- docagent_cli/subagents.py +173 -0
- docagent_cli/system_prompt.md +247 -0
- docagent_cli/textual_adapter.py +1352 -0
- docagent_cli/theme.py +842 -0
- docagent_cli/token_state.py +31 -0
- docagent_cli/tool_display.py +298 -0
- docagent_cli/tools.py +236 -0
- docagent_cli/ui.py +420 -0
- docagent_cli/unicode_security.py +516 -0
- docagent_cli/update_check.py +454 -0
- docagent_cli/widgets/__init__.py +9 -0
- docagent_cli/widgets/_links.py +63 -0
- docagent_cli/widgets/approval.py +442 -0
- docagent_cli/widgets/ask_user.py +398 -0
- docagent_cli/widgets/autocomplete.py +691 -0
- docagent_cli/widgets/chat_input.py +1827 -0
- docagent_cli/widgets/diff.py +248 -0
- docagent_cli/widgets/history.py +188 -0
- docagent_cli/widgets/loading.py +177 -0
- docagent_cli/widgets/mcp_viewer.py +362 -0
- docagent_cli/widgets/message_store.py +675 -0
- docagent_cli/widgets/messages.py +1751 -0
- docagent_cli/widgets/model_selector.py +964 -0
- docagent_cli/widgets/status.py +372 -0
- docagent_cli/widgets/theme_selector.py +164 -0
- docagent_cli/widgets/thread_selector.py +1905 -0
- docagent_cli/widgets/tool_renderers.py +148 -0
- docagent_cli/widgets/tool_widgets.py +274 -0
- docagent_cli/widgets/welcome.py +339 -0
- docagent_cli-0.0.35.data/data/docagent_cli/default_agent_prompt.md +12 -0
- docagent_cli-0.0.35.dist-info/METADATA +200 -0
- docagent_cli-0.0.35.dist-info/RECORD +300 -0
- docagent_cli-0.0.35.dist-info/WHEEL +4 -0
- docagent_cli-0.0.35.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Desert Rose
|
|
2
|
+
|
|
3
|
+
A soft and sophisticated theme with dusty, muted tones perfect for elegant presentations.
|
|
4
|
+
|
|
5
|
+
## Color Palette
|
|
6
|
+
|
|
7
|
+
- **Dusty Rose**: `#d4a5a5` - Soft primary color
|
|
8
|
+
- **Clay**: `#b87d6d` - Earthy accent
|
|
9
|
+
- **Sand**: `#e8d5c4` - Warm neutral backgrounds
|
|
10
|
+
- **Deep Burgundy**: `#5d2e46` - Rich dark contrast
|
|
11
|
+
|
|
12
|
+
## Typography
|
|
13
|
+
|
|
14
|
+
- **Headers**: FreeSans Bold
|
|
15
|
+
- **Body Text**: FreeSans
|
|
16
|
+
|
|
17
|
+
## Best Used For
|
|
18
|
+
|
|
19
|
+
Fashion presentations, beauty brands, wedding planning, interior design, boutique businesses.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Forest Canopy
|
|
2
|
+
|
|
3
|
+
A natural and grounded theme featuring earth tones inspired by dense forest environments.
|
|
4
|
+
|
|
5
|
+
## Color Palette
|
|
6
|
+
|
|
7
|
+
- **Forest Green**: `#2d4a2b` - Primary dark green
|
|
8
|
+
- **Sage**: `#7d8471` - Muted green accent
|
|
9
|
+
- **Olive**: `#a4ac86` - Light accent color
|
|
10
|
+
- **Ivory**: `#faf9f6` - Backgrounds and text
|
|
11
|
+
|
|
12
|
+
## Typography
|
|
13
|
+
|
|
14
|
+
- **Headers**: FreeSerif Bold
|
|
15
|
+
- **Body Text**: FreeSans
|
|
16
|
+
|
|
17
|
+
## Best Used For
|
|
18
|
+
|
|
19
|
+
Environmental presentations, sustainability reports, outdoor brands, wellness content, organic products.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Golden Hour
|
|
2
|
+
|
|
3
|
+
A rich and warm autumnal palette that creates an inviting and sophisticated atmosphere.
|
|
4
|
+
|
|
5
|
+
## Color Palette
|
|
6
|
+
|
|
7
|
+
- **Mustard Yellow**: `#f4a900` - Bold primary accent
|
|
8
|
+
- **Terracotta**: `#c1666b` - Warm secondary color
|
|
9
|
+
- **Warm Beige**: `#d4b896` - Neutral backgrounds
|
|
10
|
+
- **Chocolate Brown**: `#4a403a` - Dark text and anchors
|
|
11
|
+
|
|
12
|
+
## Typography
|
|
13
|
+
|
|
14
|
+
- **Headers**: FreeSans Bold
|
|
15
|
+
- **Body Text**: FreeSans
|
|
16
|
+
|
|
17
|
+
## Best Used For
|
|
18
|
+
|
|
19
|
+
Restaurant presentations, hospitality brands, fall campaigns, cozy lifestyle content, artisan products.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Midnight Galaxy
|
|
2
|
+
|
|
3
|
+
A dramatic and cosmic theme with deep purples and mystical tones for impactful presentations.
|
|
4
|
+
|
|
5
|
+
## Color Palette
|
|
6
|
+
|
|
7
|
+
- **Deep Purple**: `#2b1e3e` - Rich dark base
|
|
8
|
+
- **Cosmic Blue**: `#4a4e8f` - Mystical mid-tone
|
|
9
|
+
- **Lavender**: `#a490c2` - Soft accent color
|
|
10
|
+
- **Silver**: `#e6e6fa` - Light highlights and text
|
|
11
|
+
|
|
12
|
+
## Typography
|
|
13
|
+
|
|
14
|
+
- **Headers**: FreeSans Bold
|
|
15
|
+
- **Body Text**: FreeSans
|
|
16
|
+
|
|
17
|
+
## Best Used For
|
|
18
|
+
|
|
19
|
+
Entertainment industry, gaming presentations, nightlife venues, luxury brands, creative agencies.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Modern Minimalist
|
|
2
|
+
|
|
3
|
+
A clean and contemporary theme with a sophisticated grayscale palette for maximum versatility.
|
|
4
|
+
|
|
5
|
+
## Color Palette
|
|
6
|
+
|
|
7
|
+
- **Charcoal**: `#36454f` - Primary dark color
|
|
8
|
+
- **Slate Gray**: `#708090` - Medium gray for accents
|
|
9
|
+
- **Light Gray**: `#d3d3d3` - Backgrounds and dividers
|
|
10
|
+
- **White**: `#ffffff` - Text and clean backgrounds
|
|
11
|
+
|
|
12
|
+
## Typography
|
|
13
|
+
|
|
14
|
+
- **Headers**: DejaVu Sans Bold
|
|
15
|
+
- **Body Text**: DejaVu Sans
|
|
16
|
+
|
|
17
|
+
## Best Used For
|
|
18
|
+
|
|
19
|
+
Tech presentations, architecture portfolios, design showcases, modern business proposals, data visualization.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Ocean Depths
|
|
2
|
+
|
|
3
|
+
A professional and calming maritime theme that evokes the serenity of deep ocean waters.
|
|
4
|
+
|
|
5
|
+
## Color Palette
|
|
6
|
+
|
|
7
|
+
- **Deep Navy**: `#1a2332` - Primary background color
|
|
8
|
+
- **Teal**: `#2d8b8b` - Accent color for highlights and emphasis
|
|
9
|
+
- **Seafoam**: `#a8dadc` - Secondary accent for lighter elements
|
|
10
|
+
- **Cream**: `#f1faee` - Text and light backgrounds
|
|
11
|
+
|
|
12
|
+
## Typography
|
|
13
|
+
|
|
14
|
+
- **Headers**: DejaVu Sans Bold
|
|
15
|
+
- **Body Text**: DejaVu Sans
|
|
16
|
+
|
|
17
|
+
## Best Used For
|
|
18
|
+
|
|
19
|
+
Corporate presentations, financial reports, professional consulting decks, trust-building content.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Sunset Boulevard
|
|
2
|
+
|
|
3
|
+
A warm and vibrant theme inspired by golden hour sunsets, perfect for energetic and creative presentations.
|
|
4
|
+
|
|
5
|
+
## Color Palette
|
|
6
|
+
|
|
7
|
+
- **Burnt Orange**: `#e76f51` - Primary accent color
|
|
8
|
+
- **Coral**: `#f4a261` - Secondary warm accent
|
|
9
|
+
- **Warm Sand**: `#e9c46a` - Highlighting and backgrounds
|
|
10
|
+
- **Deep Purple**: `#264653` - Dark contrast and text
|
|
11
|
+
|
|
12
|
+
## Typography
|
|
13
|
+
|
|
14
|
+
- **Headers**: DejaVu Serif Bold
|
|
15
|
+
- **Body Text**: DejaVu Sans
|
|
16
|
+
|
|
17
|
+
## Best Used For
|
|
18
|
+
|
|
19
|
+
Creative pitches, marketing presentations, lifestyle brands, event promotions, inspirational content.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Tech Innovation
|
|
2
|
+
|
|
3
|
+
A bold and modern theme with high-contrast colors perfect for cutting-edge technology presentations.
|
|
4
|
+
|
|
5
|
+
## Color Palette
|
|
6
|
+
|
|
7
|
+
- **Electric Blue**: `#0066ff` - Vibrant primary accent
|
|
8
|
+
- **Neon Cyan**: `#00ffff` - Bright highlight color
|
|
9
|
+
- **Dark Gray**: `#1e1e1e` - Deep backgrounds
|
|
10
|
+
- **White**: `#ffffff` - Clean text and contrast
|
|
11
|
+
|
|
12
|
+
## Typography
|
|
13
|
+
|
|
14
|
+
- **Headers**: DejaVu Sans Bold
|
|
15
|
+
- **Body Text**: DejaVu Sans
|
|
16
|
+
|
|
17
|
+
## Best Used For
|
|
18
|
+
|
|
19
|
+
Tech startups, software launches, innovation showcases, AI/ML presentations, digital transformation content.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
© 2025 Anthropic, PBC. All rights reserved.
|
|
2
|
+
|
|
3
|
+
LICENSE: Use of these materials (including all code, prompts, assets, files,
|
|
4
|
+
and other components of this Skill) is governed by your agreement with
|
|
5
|
+
Anthropic regarding use of Anthropic's services. If no separate agreement
|
|
6
|
+
exists, use is governed by Anthropic's Consumer Terms of Service or
|
|
7
|
+
Commercial Terms of Service, as applicable:
|
|
8
|
+
https://www.anthropic.com/legal/consumer-terms
|
|
9
|
+
https://www.anthropic.com/legal/commercial-terms
|
|
10
|
+
Your applicable agreement is referred to as the "Agreement." "Services" are
|
|
11
|
+
as defined in the Agreement.
|
|
12
|
+
|
|
13
|
+
ADDITIONAL RESTRICTIONS: Notwithstanding anything in the Agreement to the
|
|
14
|
+
contrary, users may not:
|
|
15
|
+
|
|
16
|
+
- Extract these materials from the Services or retain copies of these
|
|
17
|
+
materials outside the Services
|
|
18
|
+
- Reproduce or copy these materials, except for temporary copies created
|
|
19
|
+
automatically during authorized use of the Services
|
|
20
|
+
- Create derivative works based on these materials
|
|
21
|
+
- Distribute, sublicense, or transfer these materials to any third party
|
|
22
|
+
- Make, offer to sell, sell, or import any inventions embodied in these
|
|
23
|
+
materials
|
|
24
|
+
- Reverse engineer, decompile, or disassemble these materials
|
|
25
|
+
|
|
26
|
+
The receipt, viewing, or possession of these materials does not convey or
|
|
27
|
+
imply any license or right beyond those expressly granted above.
|
|
28
|
+
|
|
29
|
+
Anthropic retains all right, title, and interest in these materials,
|
|
30
|
+
including all copyrights, patents, and other intellectual property rights.
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: xlsx
|
|
3
|
+
description: "Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved."
|
|
4
|
+
license: Proprietary. LICENSE.txt has complete terms
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Requirements for Outputs
|
|
8
|
+
|
|
9
|
+
## All Excel files
|
|
10
|
+
|
|
11
|
+
### Professional Font
|
|
12
|
+
- Use a consistent, professional font (e.g., Arial, Times New Roman) for all deliverables unless otherwise instructed by the user
|
|
13
|
+
|
|
14
|
+
### Zero Formula Errors
|
|
15
|
+
- Every Excel model MUST be delivered with ZERO formula errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?)
|
|
16
|
+
|
|
17
|
+
### Preserve Existing Templates (when updating templates)
|
|
18
|
+
- Study and EXACTLY match existing format, style, and conventions when modifying files
|
|
19
|
+
- Never impose standardized formatting on files with established patterns
|
|
20
|
+
- Existing template conventions ALWAYS override these guidelines
|
|
21
|
+
|
|
22
|
+
## Financial models
|
|
23
|
+
|
|
24
|
+
### Color Coding Standards
|
|
25
|
+
Unless otherwise stated by the user or existing template
|
|
26
|
+
|
|
27
|
+
#### Industry-Standard Color Conventions
|
|
28
|
+
- **Blue text (RGB: 0,0,255)**: Hardcoded inputs, and numbers users will change for scenarios
|
|
29
|
+
- **Black text (RGB: 0,0,0)**: ALL formulas and calculations
|
|
30
|
+
- **Green text (RGB: 0,128,0)**: Links pulling from other worksheets within same workbook
|
|
31
|
+
- **Red text (RGB: 255,0,0)**: External links to other files
|
|
32
|
+
- **Yellow background (RGB: 255,255,0)**: Key assumptions needing attention or cells that need to be updated
|
|
33
|
+
|
|
34
|
+
### Number Formatting Standards
|
|
35
|
+
|
|
36
|
+
#### Required Format Rules
|
|
37
|
+
- **Years**: Format as text strings (e.g., "2024" not "2,024")
|
|
38
|
+
- **Currency**: Use $#,##0 format; ALWAYS specify units in headers ("Revenue ($mm)")
|
|
39
|
+
- **Zeros**: Use number formatting to make all zeros "-", including percentages (e.g., "$#,##0;($#,##0);-")
|
|
40
|
+
- **Percentages**: Default to 0.0% format (one decimal)
|
|
41
|
+
- **Multiples**: Format as 0.0x for valuation multiples (EV/EBITDA, P/E)
|
|
42
|
+
- **Negative numbers**: Use parentheses (123) not minus -123
|
|
43
|
+
|
|
44
|
+
### Formula Construction Rules
|
|
45
|
+
|
|
46
|
+
#### Assumptions Placement
|
|
47
|
+
- Place ALL assumptions (growth rates, margins, multiples, etc.) in separate assumption cells
|
|
48
|
+
- Use cell references instead of hardcoded values in formulas
|
|
49
|
+
- Example: Use =B5*(1+$B$6) instead of =B5*1.05
|
|
50
|
+
|
|
51
|
+
#### Formula Error Prevention
|
|
52
|
+
- Verify all cell references are correct
|
|
53
|
+
- Check for off-by-one errors in ranges
|
|
54
|
+
- Ensure consistent formulas across all projection periods
|
|
55
|
+
- Test with edge cases (zero values, negative numbers)
|
|
56
|
+
- Verify no unintended circular references
|
|
57
|
+
|
|
58
|
+
#### Documentation Requirements for Hardcodes
|
|
59
|
+
- Comment or in cells beside (if end of table). Format: "Source: [System/Document], [Date], [Specific Reference], [URL if applicable]"
|
|
60
|
+
- Examples:
|
|
61
|
+
- "Source: Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL]"
|
|
62
|
+
- "Source: Company 10-Q, Q2 2025, Exhibit 99.1, [SEC EDGAR URL]"
|
|
63
|
+
- "Source: Bloomberg Terminal, 8/15/2025, AAPL US Equity"
|
|
64
|
+
- "Source: FactSet, 8/20/2025, Consensus Estimates Screen"
|
|
65
|
+
|
|
66
|
+
# XLSX creation, editing, and analysis
|
|
67
|
+
|
|
68
|
+
## Overview
|
|
69
|
+
|
|
70
|
+
A user may ask you to create, edit, or analyze the contents of an .xlsx file. You have different tools and workflows available for different tasks.
|
|
71
|
+
|
|
72
|
+
## Important Requirements
|
|
73
|
+
|
|
74
|
+
**LibreOffice Required for Formula Recalculation**: You can assume LibreOffice is installed for recalculating formula values using the `scripts/recalc.py` script. The script automatically configures LibreOffice on first run, including in sandboxed environments where Unix sockets are restricted (handled by `scripts/office/soffice.py`)
|
|
75
|
+
|
|
76
|
+
## Reading and analyzing data
|
|
77
|
+
|
|
78
|
+
### Data analysis with pandas
|
|
79
|
+
For data analysis, visualization, and basic operations, use **pandas** which provides powerful data manipulation capabilities:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
import pandas as pd
|
|
83
|
+
|
|
84
|
+
# Read Excel
|
|
85
|
+
df = pd.read_excel('file.xlsx') # Default: first sheet
|
|
86
|
+
all_sheets = pd.read_excel('file.xlsx', sheet_name=None) # All sheets as dict
|
|
87
|
+
|
|
88
|
+
# Analyze
|
|
89
|
+
df.head() # Preview data
|
|
90
|
+
df.info() # Column info
|
|
91
|
+
df.describe() # Statistics
|
|
92
|
+
|
|
93
|
+
# Write Excel
|
|
94
|
+
df.to_excel('output.xlsx', index=False)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Excel File Workflows
|
|
98
|
+
|
|
99
|
+
## CRITICAL: Use Formulas, Not Hardcoded Values
|
|
100
|
+
|
|
101
|
+
**Always use Excel formulas instead of calculating values in Python and hardcoding them.** This ensures the spreadsheet remains dynamic and updateable.
|
|
102
|
+
|
|
103
|
+
### ❌ WRONG - Hardcoding Calculated Values
|
|
104
|
+
```python
|
|
105
|
+
# Bad: Calculating in Python and hardcoding result
|
|
106
|
+
total = df['Sales'].sum()
|
|
107
|
+
sheet['B10'] = total # Hardcodes 5000
|
|
108
|
+
|
|
109
|
+
# Bad: Computing growth rate in Python
|
|
110
|
+
growth = (df.iloc[-1]['Revenue'] - df.iloc[0]['Revenue']) / df.iloc[0]['Revenue']
|
|
111
|
+
sheet['C5'] = growth # Hardcodes 0.15
|
|
112
|
+
|
|
113
|
+
# Bad: Python calculation for average
|
|
114
|
+
avg = sum(values) / len(values)
|
|
115
|
+
sheet['D20'] = avg # Hardcodes 42.5
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### ✅ CORRECT - Using Excel Formulas
|
|
119
|
+
```python
|
|
120
|
+
# Good: Let Excel calculate the sum
|
|
121
|
+
sheet['B10'] = '=SUM(B2:B9)'
|
|
122
|
+
|
|
123
|
+
# Good: Growth rate as Excel formula
|
|
124
|
+
sheet['C5'] = '=(C4-C2)/C2'
|
|
125
|
+
|
|
126
|
+
# Good: Average using Excel function
|
|
127
|
+
sheet['D20'] = '=AVERAGE(D2:D19)'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This applies to ALL calculations - totals, percentages, ratios, differences, etc. The spreadsheet should be able to recalculate when source data changes.
|
|
131
|
+
|
|
132
|
+
## Common Workflow
|
|
133
|
+
1. **Choose tool**: pandas for data, openpyxl for formulas/formatting
|
|
134
|
+
2. **Create/Load**: Create new workbook or load existing file
|
|
135
|
+
3. **Modify**: Add/edit data, formulas, and formatting
|
|
136
|
+
4. **Save**: Write to file
|
|
137
|
+
5. **Recalculate formulas (MANDATORY IF USING FORMULAS)**: Use the scripts/recalc.py script
|
|
138
|
+
```bash
|
|
139
|
+
python scripts/recalc.py output.xlsx
|
|
140
|
+
```
|
|
141
|
+
6. **Verify and fix any errors**:
|
|
142
|
+
- The script returns JSON with error details
|
|
143
|
+
- If `status` is `errors_found`, check `error_summary` for specific error types and locations
|
|
144
|
+
- Fix the identified errors and recalculate again
|
|
145
|
+
- Common errors to fix:
|
|
146
|
+
- `#REF!`: Invalid cell references
|
|
147
|
+
- `#DIV/0!`: Division by zero
|
|
148
|
+
- `#VALUE!`: Wrong data type in formula
|
|
149
|
+
- `#NAME?`: Unrecognized formula name
|
|
150
|
+
|
|
151
|
+
### Creating new Excel files
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
# Using openpyxl for formulas and formatting
|
|
155
|
+
from openpyxl import Workbook
|
|
156
|
+
from openpyxl.styles import Font, PatternFill, Alignment
|
|
157
|
+
|
|
158
|
+
wb = Workbook()
|
|
159
|
+
sheet = wb.active
|
|
160
|
+
|
|
161
|
+
# Add data
|
|
162
|
+
sheet['A1'] = 'Hello'
|
|
163
|
+
sheet['B1'] = 'World'
|
|
164
|
+
sheet.append(['Row', 'of', 'data'])
|
|
165
|
+
|
|
166
|
+
# Add formula
|
|
167
|
+
sheet['B2'] = '=SUM(A1:A10)'
|
|
168
|
+
|
|
169
|
+
# Formatting
|
|
170
|
+
sheet['A1'].font = Font(bold=True, color='FF0000')
|
|
171
|
+
sheet['A1'].fill = PatternFill('solid', start_color='FFFF00')
|
|
172
|
+
sheet['A1'].alignment = Alignment(horizontal='center')
|
|
173
|
+
|
|
174
|
+
# Column width
|
|
175
|
+
sheet.column_dimensions['A'].width = 20
|
|
176
|
+
|
|
177
|
+
wb.save('output.xlsx')
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Editing existing Excel files
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
# Using openpyxl to preserve formulas and formatting
|
|
184
|
+
from openpyxl import load_workbook
|
|
185
|
+
|
|
186
|
+
# Load existing file
|
|
187
|
+
wb = load_workbook('existing.xlsx')
|
|
188
|
+
sheet = wb.active # or wb['SheetName'] for specific sheet
|
|
189
|
+
|
|
190
|
+
# Working with multiple sheets
|
|
191
|
+
for sheet_name in wb.sheetnames:
|
|
192
|
+
sheet = wb[sheet_name]
|
|
193
|
+
print(f"Sheet: {sheet_name}")
|
|
194
|
+
|
|
195
|
+
# Modify cells
|
|
196
|
+
sheet['A1'] = 'New Value'
|
|
197
|
+
sheet.insert_rows(2) # Insert row at position 2
|
|
198
|
+
sheet.delete_cols(3) # Delete column 3
|
|
199
|
+
|
|
200
|
+
# Add new sheet
|
|
201
|
+
new_sheet = wb.create_sheet('NewSheet')
|
|
202
|
+
new_sheet['A1'] = 'Data'
|
|
203
|
+
|
|
204
|
+
wb.save('modified.xlsx')
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Recalculating formulas
|
|
208
|
+
|
|
209
|
+
Excel files created or modified by openpyxl contain formulas as strings but not calculated values. Use the provided `scripts/recalc.py` script to recalculate formulas:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
python scripts/recalc.py <excel_file> [timeout_seconds]
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Example:
|
|
216
|
+
```bash
|
|
217
|
+
python scripts/recalc.py output.xlsx 30
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The script:
|
|
221
|
+
- Automatically sets up LibreOffice macro on first run
|
|
222
|
+
- Recalculates all formulas in all sheets
|
|
223
|
+
- Scans ALL cells for Excel errors (#REF!, #DIV/0!, etc.)
|
|
224
|
+
- Returns JSON with detailed error locations and counts
|
|
225
|
+
- Works on both Linux and macOS
|
|
226
|
+
|
|
227
|
+
## Formula Verification Checklist
|
|
228
|
+
|
|
229
|
+
Quick checks to ensure formulas work correctly:
|
|
230
|
+
|
|
231
|
+
### Essential Verification
|
|
232
|
+
- [ ] **Test 2-3 sample references**: Verify they pull correct values before building full model
|
|
233
|
+
- [ ] **Column mapping**: Confirm Excel columns match (e.g., column 64 = BL, not BK)
|
|
234
|
+
- [ ] **Row offset**: Remember Excel rows are 1-indexed (DataFrame row 5 = Excel row 6)
|
|
235
|
+
|
|
236
|
+
### Common Pitfalls
|
|
237
|
+
- [ ] **NaN handling**: Check for null values with `pd.notna()`
|
|
238
|
+
- [ ] **Far-right columns**: FY data often in columns 50+
|
|
239
|
+
- [ ] **Multiple matches**: Search all occurrences, not just first
|
|
240
|
+
- [ ] **Division by zero**: Check denominators before using `/` in formulas (#DIV/0!)
|
|
241
|
+
- [ ] **Wrong references**: Verify all cell references point to intended cells (#REF!)
|
|
242
|
+
- [ ] **Cross-sheet references**: Use correct format (Sheet1!A1) for linking sheets
|
|
243
|
+
|
|
244
|
+
### Formula Testing Strategy
|
|
245
|
+
- [ ] **Start small**: Test formulas on 2-3 cells before applying broadly
|
|
246
|
+
- [ ] **Verify dependencies**: Check all cells referenced in formulas exist
|
|
247
|
+
- [ ] **Test edge cases**: Include zero, negative, and very large values
|
|
248
|
+
|
|
249
|
+
### Interpreting scripts/recalc.py Output
|
|
250
|
+
The script returns JSON with error details:
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"status": "success", // or "errors_found"
|
|
254
|
+
"total_errors": 0, // Total error count
|
|
255
|
+
"total_formulas": 42, // Number of formulas in file
|
|
256
|
+
"error_summary": { // Only present if errors found
|
|
257
|
+
"#REF!": {
|
|
258
|
+
"count": 2,
|
|
259
|
+
"locations": ["Sheet1!B5", "Sheet1!C10"]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Best Practices
|
|
266
|
+
|
|
267
|
+
### Library Selection
|
|
268
|
+
- **pandas**: Best for data analysis, bulk operations, and simple data export
|
|
269
|
+
- **openpyxl**: Best for complex formatting, formulas, and Excel-specific features
|
|
270
|
+
|
|
271
|
+
### Working with openpyxl
|
|
272
|
+
- Cell indices are 1-based (row=1, column=1 refers to cell A1)
|
|
273
|
+
- Use `data_only=True` to read calculated values: `load_workbook('file.xlsx', data_only=True)`
|
|
274
|
+
- **Warning**: If opened with `data_only=True` and saved, formulas are replaced with values and permanently lost
|
|
275
|
+
- For large files: Use `read_only=True` for reading or `write_only=True` for writing
|
|
276
|
+
- Formulas are preserved but not evaluated - use scripts/recalc.py to update values
|
|
277
|
+
|
|
278
|
+
### Working with pandas
|
|
279
|
+
- Specify data types to avoid inference issues: `pd.read_excel('file.xlsx', dtype={'id': str})`
|
|
280
|
+
- For large files, read specific columns: `pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])`
|
|
281
|
+
- Handle dates properly: `pd.read_excel('file.xlsx', parse_dates=['date_column'])`
|
|
282
|
+
|
|
283
|
+
## Code Style Guidelines
|
|
284
|
+
**IMPORTANT**: When generating Python code for Excel operations:
|
|
285
|
+
- Write minimal, concise Python code without unnecessary comments
|
|
286
|
+
- Avoid verbose variable names and redundant operations
|
|
287
|
+
- Avoid unnecessary print statements
|
|
288
|
+
|
|
289
|
+
**For Excel files themselves**:
|
|
290
|
+
- Add comments to cells with complex formulas or important assumptions
|
|
291
|
+
- Document data sources for hardcoded values
|
|
292
|
+
- Include notes for key calculations and model sections
|
|
File without changes
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"""Merge adjacent runs with identical formatting in DOCX.
|
|
2
|
+
|
|
3
|
+
Merges adjacent <w:r> elements that have identical <w:rPr> properties.
|
|
4
|
+
Works on runs in paragraphs and inside tracked changes (<w:ins>, <w:del>).
|
|
5
|
+
|
|
6
|
+
Also:
|
|
7
|
+
- Removes rsid attributes from runs (revision metadata that doesn't affect rendering)
|
|
8
|
+
- Removes proofErr elements (spell/grammar markers that block merging)
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
import defusedxml.minidom
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def merge_runs(input_dir: str) -> tuple[int, str]:
|
|
17
|
+
doc_xml = Path(input_dir) / "word" / "document.xml"
|
|
18
|
+
|
|
19
|
+
if not doc_xml.exists():
|
|
20
|
+
return 0, f"Error: {doc_xml} not found"
|
|
21
|
+
|
|
22
|
+
try:
|
|
23
|
+
dom = defusedxml.minidom.parseString(doc_xml.read_text(encoding="utf-8"))
|
|
24
|
+
root = dom.documentElement
|
|
25
|
+
|
|
26
|
+
_remove_elements(root, "proofErr")
|
|
27
|
+
_strip_run_rsid_attrs(root)
|
|
28
|
+
|
|
29
|
+
containers = {run.parentNode for run in _find_elements(root, "r")}
|
|
30
|
+
|
|
31
|
+
merge_count = 0
|
|
32
|
+
for container in containers:
|
|
33
|
+
merge_count += _merge_runs_in(container)
|
|
34
|
+
|
|
35
|
+
doc_xml.write_bytes(dom.toxml(encoding="UTF-8"))
|
|
36
|
+
return merge_count, f"Merged {merge_count} runs"
|
|
37
|
+
|
|
38
|
+
except Exception as e:
|
|
39
|
+
return 0, f"Error: {e}"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _find_elements(root, tag: str) -> list:
|
|
45
|
+
results = []
|
|
46
|
+
|
|
47
|
+
def traverse(node):
|
|
48
|
+
if node.nodeType == node.ELEMENT_NODE:
|
|
49
|
+
name = node.localName or node.tagName
|
|
50
|
+
if name == tag or name.endswith(f":{tag}"):
|
|
51
|
+
results.append(node)
|
|
52
|
+
for child in node.childNodes:
|
|
53
|
+
traverse(child)
|
|
54
|
+
|
|
55
|
+
traverse(root)
|
|
56
|
+
return results
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _get_child(parent, tag: str):
|
|
60
|
+
for child in parent.childNodes:
|
|
61
|
+
if child.nodeType == child.ELEMENT_NODE:
|
|
62
|
+
name = child.localName or child.tagName
|
|
63
|
+
if name == tag or name.endswith(f":{tag}"):
|
|
64
|
+
return child
|
|
65
|
+
return None
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _get_children(parent, tag: str) -> list:
|
|
69
|
+
results = []
|
|
70
|
+
for child in parent.childNodes:
|
|
71
|
+
if child.nodeType == child.ELEMENT_NODE:
|
|
72
|
+
name = child.localName or child.tagName
|
|
73
|
+
if name == tag or name.endswith(f":{tag}"):
|
|
74
|
+
results.append(child)
|
|
75
|
+
return results
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _is_adjacent(elem1, elem2) -> bool:
|
|
79
|
+
node = elem1.nextSibling
|
|
80
|
+
while node:
|
|
81
|
+
if node == elem2:
|
|
82
|
+
return True
|
|
83
|
+
if node.nodeType == node.ELEMENT_NODE:
|
|
84
|
+
return False
|
|
85
|
+
if node.nodeType == node.TEXT_NODE and node.data.strip():
|
|
86
|
+
return False
|
|
87
|
+
node = node.nextSibling
|
|
88
|
+
return False
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _remove_elements(root, tag: str):
|
|
94
|
+
for elem in _find_elements(root, tag):
|
|
95
|
+
if elem.parentNode:
|
|
96
|
+
elem.parentNode.removeChild(elem)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _strip_run_rsid_attrs(root):
|
|
100
|
+
for run in _find_elements(root, "r"):
|
|
101
|
+
for attr in list(run.attributes.values()):
|
|
102
|
+
if "rsid" in attr.name.lower():
|
|
103
|
+
run.removeAttribute(attr.name)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def _merge_runs_in(container) -> int:
|
|
109
|
+
merge_count = 0
|
|
110
|
+
run = _first_child_run(container)
|
|
111
|
+
|
|
112
|
+
while run:
|
|
113
|
+
while True:
|
|
114
|
+
next_elem = _next_element_sibling(run)
|
|
115
|
+
if next_elem and _is_run(next_elem) and _can_merge(run, next_elem):
|
|
116
|
+
_merge_run_content(run, next_elem)
|
|
117
|
+
container.removeChild(next_elem)
|
|
118
|
+
merge_count += 1
|
|
119
|
+
else:
|
|
120
|
+
break
|
|
121
|
+
|
|
122
|
+
_consolidate_text(run)
|
|
123
|
+
run = _next_sibling_run(run)
|
|
124
|
+
|
|
125
|
+
return merge_count
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def _first_child_run(container):
|
|
129
|
+
for child in container.childNodes:
|
|
130
|
+
if child.nodeType == child.ELEMENT_NODE and _is_run(child):
|
|
131
|
+
return child
|
|
132
|
+
return None
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def _next_element_sibling(node):
|
|
136
|
+
sibling = node.nextSibling
|
|
137
|
+
while sibling:
|
|
138
|
+
if sibling.nodeType == sibling.ELEMENT_NODE:
|
|
139
|
+
return sibling
|
|
140
|
+
sibling = sibling.nextSibling
|
|
141
|
+
return None
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def _next_sibling_run(node):
|
|
145
|
+
sibling = node.nextSibling
|
|
146
|
+
while sibling:
|
|
147
|
+
if sibling.nodeType == sibling.ELEMENT_NODE:
|
|
148
|
+
if _is_run(sibling):
|
|
149
|
+
return sibling
|
|
150
|
+
sibling = sibling.nextSibling
|
|
151
|
+
return None
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def _is_run(node) -> bool:
|
|
155
|
+
name = node.localName or node.tagName
|
|
156
|
+
return name == "r" or name.endswith(":r")
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def _can_merge(run1, run2) -> bool:
|
|
160
|
+
rpr1 = _get_child(run1, "rPr")
|
|
161
|
+
rpr2 = _get_child(run2, "rPr")
|
|
162
|
+
|
|
163
|
+
if (rpr1 is None) != (rpr2 is None):
|
|
164
|
+
return False
|
|
165
|
+
if rpr1 is None:
|
|
166
|
+
return True
|
|
167
|
+
return rpr1.toxml() == rpr2.toxml()
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def _merge_run_content(target, source):
|
|
171
|
+
for child in list(source.childNodes):
|
|
172
|
+
if child.nodeType == child.ELEMENT_NODE:
|
|
173
|
+
name = child.localName or child.tagName
|
|
174
|
+
if name != "rPr" and not name.endswith(":rPr"):
|
|
175
|
+
target.appendChild(child)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def _consolidate_text(run):
|
|
179
|
+
t_elements = _get_children(run, "t")
|
|
180
|
+
|
|
181
|
+
for i in range(len(t_elements) - 1, 0, -1):
|
|
182
|
+
curr, prev = t_elements[i], t_elements[i - 1]
|
|
183
|
+
|
|
184
|
+
if _is_adjacent(prev, curr):
|
|
185
|
+
prev_text = prev.firstChild.data if prev.firstChild else ""
|
|
186
|
+
curr_text = curr.firstChild.data if curr.firstChild else ""
|
|
187
|
+
merged = prev_text + curr_text
|
|
188
|
+
|
|
189
|
+
if prev.firstChild:
|
|
190
|
+
prev.firstChild.data = merged
|
|
191
|
+
else:
|
|
192
|
+
prev.appendChild(run.ownerDocument.createTextNode(merged))
|
|
193
|
+
|
|
194
|
+
if merged.startswith(" ") or merged.endswith(" "):
|
|
195
|
+
prev.setAttribute("xml:space", "preserve")
|
|
196
|
+
elif prev.hasAttribute("xml:space"):
|
|
197
|
+
prev.removeAttribute("xml:space")
|
|
198
|
+
|
|
199
|
+
run.removeChild(curr)
|