Adds pivot tables, native charts, dropdowns, highlighting and a print layout to a sheet.
Say it in your own words; the assistant finds this recipe by itself. Examples:
Turn an uploaded sheet into something a manager can read, in ONE command per step, with real Excel features (GridCraft engine, no Excel needed): a pivot table (sum, count, average by region, product, month…) on its own sheet with a native pivot chart, a column/line/pie chart from a range, dropdown lists and value limits on a column, highlighting (top 10, above a threshold, colour scale, data bars, duplicates, blanks), frozen header row, and a print-ready layout (landscape, fit to one page wide, repeat the header on every page, page numbers), plus a PDF preview. Every result is formula-checked. Use for: make a pivot of sales by region and month, add a chart, I need a dropdown for status, highlight everything over 10,000, make it printable, PDF of the summary. Triggers: pivot, pivottabel, sum by, chart, diagram, dropdown, data validation, conditional formatting, highlight, colour scale, freeze, print area, fit to page, printable, PDF of sheet.
python3 /skills/pivot-and-chart/scripts/pivot.py <verb> IN OUT [options] drives gridcraft-cli,
a native spreadsheet engine that writes real Excel pivot tables, charts, validations and
conditional formats. Inputs in /work/in (xlsx, or a CSV, which is converted first); results in
/work/out. Every verb prints one OK … line (with a formula check) or one ERROR … line.
Chain verbs by feeding the output of one into the next.
| Need | Command |
|---|---|
| Pivot table on a new sheet (+ chart) | pivot.py pivot /work/in/sales.csv /work/out/sales.xlsx --rows region --columns product --values units:sum,price:average --chart column --title "Units by region" |
| Pivot over a specific range/sheet | add --source 'Data!A1:E3001' (default: the first sheet's used range), --filters month |
| Chart from a range | pivot.py chart /work/in/book.xlsx /work/out/book.xlsx --range A1:B13 --type line --title "Revenue" --at H2 [--sheet Data] |
| Dropdown list on a column | pivot.py dropdown /work/in/tasks.xlsx /work/out/tasks.xlsx --range C2:C500 --list "Open,In progress,Done" |
| Only numbers in a range | pivot.py dropdown … --range D2:D500 --between 0 100 |
| Highlight cells | pivot.py highlight /work/in/book.xlsx /work/out/book.xlsx --range D2:D500 --rule top10 (also bottom10, above:10000, below:0, colorscale, databar, duplicates, blanks, errors) |
| Print-ready sheet | pivot.py print /work/in/book.xlsx /work/out/book.xlsx --landscape --fit-width --repeat-rows 1:1 --freeze A2 --footer "Page &P of &N" --table |
| PDF preview of a sheet | pivot.py preview /work/out/book.xlsx /work/out/book.pdf [--sheet Pivot] |
| Anything else the engine can do | pivot.py spec IN OUT --script /work/spec.json with a list of {"command", "params"} (gridcraft-cli commands lists all 346) |
Value functions: sum, count, average, max, min. Field names are the column headers of
the source range. --sheet NAME selects the sheet for chart, dropdown, highlight, print and
preview. After the last step, run preview so the person can see the result, and give the
links to the workbook and the PDF.
SKILL.mdgate.jsonscripts/__pycache__/pivot.cpython-311.pycscripts/__pycache__/pivot.cpython-313.pycscripts/pivot.pyWritten by Percerno, MIT licence.