openpyxl

Create and manipulate Microsoft Excel workbooks programmatically. Build spreadsheets with formulas, charts, conditional formatting, and pivot tables. Handle large datasets efficiently with streaming mode.

5 stars

Best use case

openpyxl is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create and manipulate Microsoft Excel workbooks programmatically. Build spreadsheets with formulas, charts, conditional formatting, and pivot tables. Handle large datasets efficiently with streaming mode.

Teams using openpyxl should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/openpyxl/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/data/office/openpyxl/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/openpyxl/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How openpyxl Compares

Feature / AgentopenpyxlStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create and manipulate Microsoft Excel workbooks programmatically. Build spreadsheets with formulas, charts, conditional formatting, and pivot tables. Handle large datasets efficiently with streaming mode.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Openpyxl

## Overview

Openpyxl is a Python library for reading and writing Excel 2010+ xlsx/xlsm files. This skill covers comprehensive patterns for spreadsheet automation including:

- **Workbook creation** with multiple worksheets
- **Cell operations** including formatting, merging, and data validation
- **Formula support** for calculations and dynamic content
- **Chart generation** for data visualization within Excel
- **Conditional formatting** for visual data analysis
- **Large dataset handling** with optimized read/write modes
- **Pivot table creation** for data summarization
- **Style management** for professional appearances

## When to Use This Skill

### USE when:

- Creating Excel reports with formulas and calculations
- Generating spreadsheets from database queries
- Automating financial reports and dashboards
- Building Excel templates with formatting
- Processing and transforming existing Excel files
- Creating charts and visualizations in Excel
- Applying conditional formatting rules
- Building data entry forms with validation
- Handling large datasets (100k+ rows)
- Creating pivot tables programmatically
### DON'T USE when:

- Only need to read data into pandas (use pandas.read_excel directly)
- Need real-time Excel manipulation (use xlwings on Windows)
- Working with .xls format (use xlrd/xlwt)
- Creating complex macros (requires VBA)
- Need Excel-specific features like Power Query

## Prerequisites

### Installation

```bash
# Basic installation
pip install openpyxl

# Using uv (recommended)
uv pip install openpyxl

# With image support
pip install openpyxl Pillow


*See sub-skills for full details.*
### Verify Installation

```python
from openpyxl import Workbook, load_workbook
from openpyxl.styles import Font, PatternFill, Alignment, Border
from openpyxl.chart import BarChart, LineChart, PieChart
from openpyxl.utils.dataframe import dataframe_to_rows

print("openpyxl installed successfully!")
```

## Version History

### 1.0.0 (2026-01-17)

- Initial skill creation
- Core capabilities documentation
- 6 complete code examples
- Large dataset handling patterns
- Integration with pandas

## Resources

- **Official Documentation**: https://openpyxl.readthedocs.io/
- **GitHub Repository**: https://github.com/theorchard/openpyxl
- **PyPI Package**: https://pypi.org/project/openpyxl/

## Related Skills

- **pandas-data-processing** - Data analysis and transformation
- **python-docx** - Word document generation
- **plotly** - Interactive chart generation
- **pypdf** - PDF manipulation

---

*This skill provides comprehensive patterns for Excel automation refined from production data processing systems.*

## Sub-Skills

- [1. Basic Workbook Creation](1-basic-workbook-creation/SKILL.md)
- [2. Advanced Cell Formatting](2-advanced-cell-formatting/SKILL.md)
- [3. Chart Generation](3-chart-generation/SKILL.md)
- [4. Conditional Formatting](4-conditional-formatting/SKILL.md)
- [5. Large Dataset Handling with Streaming](5-large-dataset-handling-with-streaming/SKILL.md)
- [6. Pivot Table Creation](6-pivot-table-creation/SKILL.md)
- [Pandas Integration (+1)](pandas-integration/SKILL.md)
- [1. Memory Management (+2)](1-memory-management/SKILL.md)
- [Common Issues](common-issues/SKILL.md)

Related Skills

python-pptx

5
from vamseeachanta/workspace-hub

Create and manipulate PowerPoint presentations programmatically. Build slide decks with layouts, shapes, charts, tables, and images. Generate data-driven presentations from templates.

python-docx

5
from vamseeachanta/workspace-hub

Create and manipulate Microsoft Word documents programmatically. Build reports, contracts, and documentation with full control over paragraphs, tables, headers, styles, and images.

pypdf

5
from vamseeachanta/workspace-hub

Manipulate PDF documents programmatically. Merge, split, rotate, and watermark PDFs. Extract text and metadata. Handle form filling and encryption/decryption.

xlsx-to-python-openpyxl-limitation

5
from vamseeachanta/workspace-hub

Sub-skill of xlsx-to-python: openpyxl Limitation (+3).

openpyxl-pandas-integration

5
from vamseeachanta/workspace-hub

Sub-skill of openpyxl: Pandas Integration (+1).

openpyxl-6-pivot-table-creation

5
from vamseeachanta/workspace-hub

Sub-skill of openpyxl: 6. Pivot Table Creation.

openpyxl-5-large-dataset-handling-with-streaming

5
from vamseeachanta/workspace-hub

Sub-skill of openpyxl: 5. Large Dataset Handling with Streaming.

openpyxl-3-chart-generation

5
from vamseeachanta/workspace-hub

Sub-skill of openpyxl: 3. Chart Generation.

openpyxl-2-advanced-cell-formatting

5
from vamseeachanta/workspace-hub

Sub-skill of openpyxl: 2. Advanced Cell Formatting.

openpyxl-1-memory-management

5
from vamseeachanta/workspace-hub

Sub-skill of openpyxl: 1. Memory Management (+2).

openpyxl-1-basic-workbook-creation

5
from vamseeachanta/workspace-hub

Sub-skill of openpyxl: 1. Basic Workbook Creation.

test-oversized-skill

5
from vamseeachanta/workspace-hub

A test fixture skill that exceeds 200 lines with multiple H2/H3 sections for split testing.