---
name: fastpyxl
description: >
  A high-performance Python library to read/write Excel 2010 xlsx/xlsm files. Use when writing Python code that uses the fastpyxl package.
license: MIT
compatibility: Requires Python >=3.11.
---

# fastpyxl

A high-performance Python library to read/write Excel 2010 xlsx/xlsm files

## Installation

```bash
pip install fastpyxl
```

## API overview

### Classes

Main classes provided by the package

- `Workbook`: Workbook is the container for all other parts of the document
- `cell.Cell`
- `cell.MergedCell`
- `cell.ReadOnlyCell`
- `chart.AreaChart`
- `chart.AreaChart3D`
- `chart.BarChart`
- `chart.BarChart3D`
- `chart.BubbleChart`
- `chart.DoughnutChart`
- `chart.LineChart`
- `chart.LineChart3D`
- `chart.PieChart`
- `chart.PieChart3D`
- `chart.ProjectedPieChart`
- `chart.RadarChart`
- `chart.Reference`
- `chart.ScatterChart`
- `chart.StockChart`
- `chart.SurfaceChart`
- `chart.SurfaceChart3D`
- `chartsheet.Chartsheet`
- `comments.Comment`
- `drawing.Drawing`
- `formatting.Rule`
- `formula.Tokenizer`
- `styles.Alignment`
- `styles.Border`
- `styles.Color`
- `styles.Fill`
- `styles.Font`
- `styles.GradientFill`
- `styles.NamedStyle`
- `styles.NumberFormatDescriptor`
- `styles.PatternFill`
- `styles.Protection`
- `styles.Side`
- `typed_serialisable.ElementList`
- `typed_serialisable.Extension`
- `typed_serialisable.ExtensionList`
- `typed_serialisable.MetaSerialisable`
- `typed_serialisable.NestedValInt`
- `typed_serialisable.Serialisable`

### Dataclasses

Dataclass definitions

- `typed_serialisable.FieldInfo`

### Workbook Methods

Methods for the Workbook class

- `Workbook.create_sheet`
- `Workbook.move_sheet`
- `Workbook.remove`
- `Workbook.remove_sheet`
- `Workbook.create_chartsheet`
- `Workbook.get_sheet_by_name`
- `Workbook.__contains__`
- `Workbook.index`
- `Workbook.get_index`
- `Workbook.__getitem__`
- `Workbook.__delitem__`
- `Workbook.__iter__`
- `Workbook.get_sheet_names`
- `Workbook.create_named_range`
- `Workbook.add_named_style`
- `Workbook.save`
- `Workbook.materialize_pending_style_components`
- `Workbook.copy_worksheet`
- `Workbook.close`

### Functions

Utility functions

- `cell.WriteOnlyCell`
- `chart.Series`
- `compat.deprecated`
- `compat.safe_string`
- `load_workbook`: Open the given filename and return the workbook
- `open`: Open the given filename and return the workbook
- `styles.is_builtin`
- `styles.is_date_format`
- `styles.is_timedelta_format`
- `typed_serialisable.AliasField`
- `typed_serialisable.explicit_none_element`
- `xml.defusedxml_available`
- `xml.defusedxml_env_set`
- `xml.lxml_available`
- `xml.lxml_env_set`

### Constants

Module-level constants and data

- `compat.NUMERIC_TYPES`
- `styles.DEFAULT_FONT`
- `typed_serialisable.Field`
- `xml.DEFUSEDXML`
- `xml.LXML`

### Other

Additional exports

- `packaging`: Stuff related to Office OpenXML packaging: relationships, archive, content types
- `pivot`
- `reader`
- `workbook.Workbook`
- `worksheet`
- `writer`

## Resources

- [Full documentation](https://promptlytechnologies.com/fastpyxl/)
- [llms.txt](llms.txt) — Indexed API reference for LLMs
- [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs
- [Source code](https://github.com/Promptly-Technologies-LLC/fastpyxl)
