openpyxl

3.1.5 · active · verified Sat Mar 28

A Python library to read/write Excel 2010 xlsx/xlsm files. Current version: 3.1.5. Openpyxl is actively maintained with regular updates to support the latest Excel features and Python versions.

Warnings

Install

Imports

Quickstart

A simple example to create a new Excel file and write data to it.

from openpyxl import Workbook

# Create a new workbook and select the active worksheet
wb = Workbook()
ws = wb.active

# Write data to a cell
ws['A1'] = 'Hello, World!'

# Save the workbook
wb.save('example.xlsx')

view raw JSON →