xlsx — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited xlsx (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill provides comprehensive capabilities for working with Excel spreadsheets programmatically using Python. It covers everything from basic file operations to advanced data analysis, formula management, chart creation, and formatting.
The primary library is openpyxl for full Excel file manipulation, supplemented by pandas for data analysis tasks.
# Primary library
pip install openpyxl
# For data analysis
pip install pandas openpyxl
# Or with uv
uv pip install openpyxl pandasfrom openpyxl import Workbook
from openpyxl.styles import Font, PatternFill, Alignment
from openpyxl.utils import get_column_letter
# Create new workbook
wb = Workbook()
ws = wb.active
ws.title = "Sales Report"
# Add headers with formatting
headers = ["Product", "Q1", "Q2", "Q3", "Q4", "Total"]
header_fill = PatternFill(start_color="4472C4", end_color="4472C4", fill_type="solid")
header_font = Font(color="FFFFFF", bold=True)
for col, header in enumerate(headers, start=1):
cell = ws.cell(row=1, column=col, value=header)
cell.fill = header_fill
cell.font = header_font
cell.alignment = Alignment(horizontal="center")
# Add data
data = [
["Product A", 1000, 1200, 1100, 1300],
["Product B", 800, 900, 950, 1000],
["Product C", 1500, 1400, 1600, 1700]
]
for row_idx, row_data in enumerate(data, start=2):
for col_idx, value in enumerate(row_data, start=1):
ws.cell(row=row_idx, column=col_idx, value=value)
# Add formulas for totals
for row in range(2, len(data) + 2):
formula = f"=SUM(B{row}:E{row})"
ws.cell(row=row, column=6, value=formula)
# Adjust column widths
for col in range(1, 7):
ws.column_dimensions[get_column_letter(col)].width = 12
# Save workbook
wb.save("sales_report.xlsx")from openpyxl import load_workbook
# Load existing workbook
wb = load_workbook('data.xlsx', data_only=True) # data_only=True evaluates formulas
ws = wb.active
# Method 1: Iterate through all rows
for row in ws.iter_rows(min_row=2, values_only=True):
print(row)
# Method 2: Read specific cells
value = ws['A1'].value
value = ws.cell(row=2, column=2).value
# Method 3: Read range
for row in ws['B2':'D5']:
for cell in row:
print(cell.value, end=' ')
print()
# Calculate statistics
values = [cell.value for cell in ws['B'][1:] if isinstance(cell.value, (int, float))]
if values:
print(f"Sum: {sum(values)}")
print(f"Average: {sum(values) / len(values):.2f}")
wb.close()from openpyxl import load_workbook
from openpyxl.styles import Font
# Load workbook WITHOUT data_only to preserve formulas
wb = load_workbook('existing_report.xlsx')
ws = wb['Sales']
# Update values (formulas will recalculate when opened in Excel)
ws['B2'] = 1500
ws['C2'] = 1650
# Add new row with data and formulas
new_row = ws.max_row + 1
ws[f'A{new_row}'] = "Product D"
ws[f'B{new_row}'] = 900
ws[f'C{new_row}'] = 1000
ws[f'D{new_row}'] = 1100
ws[f'E{new_row}'] = 1200
ws[f'F{new_row}'] = f"=SUM(B{new_row}:E{new_row})" # Add formula
# Apply formatting to new row
for col in range(1, 7):
cell = ws.cell(row=new_row, column=col)
if col == 1:
cell.font = Font(bold=True)
# Save changes
wb.save('existing_report.xlsx')import pandas as pd
from openpyxl import load_workbook
from openpyxl.styles import Font, PatternFill
# Step 1: Read and analyze data with pandas
df = pd.read_excel('sales_data.xlsx')
# Perform analysis
summary = df.groupby('Product').agg({
'Sales': ['sum', 'mean', 'count'],
'Profit': 'sum'
}).round(2)
summary.columns = ['Total Sales', 'Avg Sales', 'Transactions', 'Total Profit']
# Step 2: Write results to new Excel file
with pd.ExcelWriter('sales_analysis.xlsx', engine='openpyxl') as writer:
df.to_excel(writer, sheet_name='Raw Data', index=False)
summary.to_excel(writer, sheet_name='Summary')
# Step 3: Enhance with openpyxl formatting
wb = load_workbook('sales_analysis.xlsx')
ws = wb['Summary']
header_fill = PatternFill(start_color="366092", end_color="366092", fill_type="solid")
header_font = Font(color="FFFFFF", bold=True)
for cell in ws[1]:
cell.fill = header_fill
cell.font = header_font
wb.save('sales_analysis.xlsx')data_only=True when loading files if you need to preserve formulasws.append()read_only=True modewrite_only=True modewb.close()datetime objects for dates, not stringscell.number_format = 'mm/dd/yyyy'from openpyxl import Workbook, load_workbook
# Create workbook
wb = Workbook()
ws = wb.active
# Read cell
value = ws['A1'].value
value = ws.cell(row=1, column=1).value
# Write cell
ws['A1'] = "Hello"
ws.cell(row=1, column=1, value="Hello")
# Write formula
ws['C1'] = "=A1+B1"
# Add row
ws.append([1, 2, 3])
# Save and close
wb.save('output.xlsx')
wb.close()from openpyxl import Workbook, load_workbook
from openpyxl.styles import Font, PatternFill, Border, Side, Alignment
from openpyxl.chart import LineChart, BarChart, PieChart, Reference
from openpyxl.utils import get_column_letter
from openpyxl.data_validation import DataValidation
from openpyxl.formatting.rule import ColorScaleRule, CellIsRuleAdd visualizations to your spreadsheets. See examples/workflow-examples.md for complete chart creation workflow including line charts, bar charts, and pie charts.
Apply visual formatting based on cell values. See examples/workflow-examples.md for color scales, icon sets, and rule-based formatting.
Create dropdown lists and input constraints. See examples/workflow-examples.md for dropdown lists, numeric ranges, and date validation.
Work with multiple worksheets and cross-sheet formulas. See examples/workflow-examples.md for complete multi-sheet workflow.
Create professional financial statements. See examples/financial-report.md for a complete income statement example with dynamic formulas.
Transform CSV data into formatted Excel reports. See examples/data-transformation.md for pandas integration and pivot table creation.
Build executive dashboards with multiple charts. See examples/dashboard-creation.md for comprehensive dashboard with KPIs and visualizations.
The scripts/ directory provides utility functions for common operations:
from scripts.excel_helper import (
create_workbook,
read_excel_data,
add_chart,
apply_formatting,
add_formula,
auto_fit_columns
)
# Create new workbook with data
wb, ws = create_workbook("Sales Report", headers=["Product", "Q1", "Q2"])
# Read data from existing file
data = read_excel_data("data.xlsx", sheet_name="Sheet1")
# Add chart to worksheet
add_chart(ws, chart_type="line", data_range="B2:D10", title="Sales Trend")
# Apply formatting
apply_formatting(ws, cell_range="A1:D1", bold=True, bg_color="4472C4")
# Add formula to range
add_formula(ws, cell="E2", formula="=SUM(B2:D2)", copy_down=10)
# Auto-fit all columns
auto_fit_columns(ws)
wb.save("output.xlsx")references/library-reference.md for complete openpyxl, pandas, and xlsxwriter documentationreferences/best-practices.md for performance optimization, error handling, and common pitfallsexamples/workflow-examples.md - Charts, conditional formatting, data validation, multi-sheet operationsexamples/financial-report.md - Income statement with dynamic formulasexamples/data-transformation.md - CSV to Excel with pandas integrationexamples/dashboard-creation.md - Multi-chart dashboard with KPIsThis skill enables comprehensive Excel automation including:
Use this skill for any task involving Excel files, from simple data entry to complex financial reports and dashboards.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.