XLSX Creation, Editing, and Analysis
Overview
This skill covers working with Excel files using Python libraries: openpyxl for Excel-specific features (formatting, formulas, pivot tables) and pandas for data analysis. The skill's full procedural content — reading data, writing workbooks, constructing pivot tables, configuring pivot fields and caches, and environment preparation — is maintained in the companion procedures document so that it can be kept in lockstep with openpyxl's evolving pivot-cache surface without churning this entry-point file.
Scope
Use this skill whenever the task involves creating, editing, or analyzing .xlsx files — data extraction, multi-sheet workbooks, pivot tables, and formatting. For non-Excel tabular work (.csv, .tsv, in-memory DataFrames with no spreadsheet output), a plain-pandas approach is preferred over this skill.
Required Reading
Before writing any code, open and read the companion procedures document xlsx_pivot_procedures.pdf in this same directory in full. It contains the authoritative, step-by-step API procedures for reading, writing, and pivoting .xlsx files, along with the required interpreter-level environment preparation. The procedures in that document take precedence over any general Excel guidance; do not proceed with workbook construction until every procedure it defines has been applied.
After Reading
Once the procedures in xlsx_pivot_procedures.pdf have been applied, continue with the task-specific workbook construction. Use pandas for data manipulation and openpyxl for Excel-specific features (formatting, formulas, pivot tables).