Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

xlsx

БесплатноЗапускает вложенные скриптыНе проверен

Comprehensive Excel spreadsheet creation, editing, and analysis with support for formulas, formatting, charts, data analysis, and visualization. Use when…

AutumnsGroveот AutumnsGrove★ 41 звезда на GitHub43 установки в других каталогах

Об этом скилле

Excel (XLSX) Skill

Overview

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.

Core Capabilities

1. File Operations

  • Reading: Load .xlsx, .xlsm, and .csv files
  • Writing: Create new Excel workbooks from scratch
  • Editing: Modify existing workbooks while preserving formulas, formatting, and charts
  • Converting: Transform between CSV, Excel, and other formats

2. Data Management

  • Cell Operations: Read, write, and modify individual cells or ranges
  • Formulas: Create and manage Excel formulas (SUM, VLOOKUP, INDEX/MATCH, etc.)
  • Data Validation: Set dropdown lists, numeric ranges, date constraints
  • Named Ranges: Define and use named cell ranges for easier formula management

3. Formatting

  • Cell Styling: Fonts, colors, borders, alignment, number formats
  • Conditional Formatting: Apply rules-based formatting
  • Row/Column Sizing: Set widths, heights, auto-fit
  • Merge Cells: Combine cells for headers and labels

4. Charts & Visualizations

  • Chart Types: Line, bar, column, pie, scatter, area, combo charts
  • Chart Customization: Titles, legends, data labels, colors
  • Multiple Series: Multi-dataset charts with secondary axes
  • Chart Positioning: Place charts in specific locations

5. Multi-Worksheet Operations

  • Sheet Management: Create, rename, delete, reorder worksheets
  • Cross-Sheet Formulas: Reference data across multiple sheets
  • Sheet Copying: Duplicate sheets with formatting intact
  • Sheet Protection: Lock/unlock sheets and ranges

6. Data Analysis

  • Filtering: Auto-filter data ranges
  • Sorting: Multi-level sorting
  • Pivot Tables: Programmatic pivot table creation
  • Statistical Functions: Built-in and custom calculations

Installation

# Primary library
pip install openpyxl

# For data analysis
pip install pandas openpyxl

# Or with uv
uv pip install openpyxl pandas

Essential Workflows

Workflow 1: Creating a New Workbook from Scratch

from 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")

Workflow 2: Reading and Analyzing Existing Workbooks

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()

Workflow 3: Editing Workbooks While Preserving Formulas

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
Полный SKILL.md на GitHub

Установить xlsx в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

README.mdexamples/dashboard-creation.mdexamples/data-transformation.mdexamples/financial-report.mdexamples/workflow-examples.mdreferences/best-practices.mdreferences/library-reference.mdscripts/example_usage.pyscripts/excel_helper.py

FAQ

Что делает скилл xlsx?

Comprehensive Excel spreadsheet creation, editing, and analysis with support for formulas, formatting, charts, data analysis, and visualization. Use when working with .xlsx, .xlsm, .csv files for: (1) Creating spreadsheets with formulas and formatting, (2) Reading/analyzing data, (3) Modifying existing spreadsheets while preserving formulas, (4) Creating charts and visualizations, (5) Data transformation and analysis, (6) Multi-worksheet operations

Как установить скилл xlsx?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл xlsx запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить xlsx с