A Python Library for Processing Excel Spreadsheets
Product Page | Documentation | Examples | Forum | Temporary License | Customized Demo
Spire.XLS for Python is a powerful Python Excel API that can be used to create, read, write, and convert Excel spreadsheets in any type of Python applications without installing Microsoft Office.
Spire.XLS for Python provides a comprehensive set of interfaces that allow for the manipulation of Excel files with ease. By utilizing it, developers can automate spreadsheet-related tasks, streamline data analysis, and build applications that interact seamlessly with Excel documents.
Excel Spreadsheets Processing & Security Features
-
Merge Excel files, or split Excel files
-
Add worksheets, copy worksheets, or rename worksheets
-
Hide or show worksheets
-
Remove conditional formatting from Excel
-
Hide or show Excel comments
-
Add or delete digital signatures in Excel
Compatible with: old Excel 97-2003 format (.xls), Excel 2007, Excel 2010, Excel 2013, Excel 2016 and Excel 2019 (.xlsx, .xlsb, .xlsm), and Open Office(.ods) format
High Quality Excel File Conversion
- Convert Excel (XLS or XLSX) to PDF
- Conversion between Excel and HTML
- Convert Excel to Images (PNG, JPG or BMP)
- Conversion between Excel and CSV
- Convert Excel to XML
- Convert Excel to TXT
- Convert CSV to PDF
- Convert Excel to SVG
- Convert Excel to XPS
- Convert XLS to XLSM
- Conversion between XLS and XLSX
- Convert Excel to ODS (OpenDocument Spreadsheet)
- Convert Excel charts to Images
Advanced Cell Manipulation & Calculation Engine
- Merge or unmerge Excel cells
- Wrap or unwrap text in Excel Cells
- Align text in Excel cells
- Add or remove cell borders in Excel
- Set fonts in Excel cells (including font size, color, bold, italic, underlining, etc.)
- Set fill color, gradient or pattern for Excel cells
- Find & replace data in Excel cells
- Add or read Excel formulas
- Calculate Excel formulas
- Remove Excel formulas
- Create, edit or delete named ranges in Excel
Excel Charts, Images, Shapes and Other Elements
- Create pie charts in Excel
- Create column charts in Excel
- Create bar charts in Excel
- Create line charts in Excel
- Create radar charts in Excel
- Insert or delete pictures in Excel
- Compress, resize, or move images in Excel
- Replace or extract images in Excel
- Insert or remove shapes in Excel
- Create or operate pivot tables in Excel
- Add, update, or delete textboxes in Excel
- Insert hyperlinks in Excel
- Update or remove hyperlinks in Excel
- Add header & footer in Excel
- Add watermarks in Excel
Examples
Create an Excel File in Python
from spire.xls.common import *
from spire.xls import *
outputFile = "CreateAnExcelWithFiveSheet.xlsx"
# Create an object of Workbook class
workbook = Workbook()
# Add five sheets to this file
workbook.CreateEmptySheets(5)
# Loop through the added worksheets
for i in range(0, 5):
sheet = workbook.Worksheets[i]
sheet.Name = "Sheet" + str(i)
# Add text to cells
for row in range(1, 151):
for col in range(1, 51):
sheet.Range[row,col].Text = "row" + str(row) + " col" + str(col)
# Save the Excel file
workbook.SaveToFile(outputFile, ExcelVersion.Version2016)
workbook.Dispose()
Convert Excel to PDF in Python
from spire.xls import *
from spire.xls.common import *
inputFile = "Input.xlsx"
outputFile = "ExcelToPDF.pdf"
# Create a Workbook object
workbook = Workbook()
# Load an Excel document
workbook.LoadFromFile(inputFile)
# Set worksheet to fit to page when converting
workbook.ConverterSetting.SheetFitToPage = True
# Convert the Excel file to PDF
workbook.SaveToFile(outputFile, FileFormat.PDF)
workbook.Dispose()
Convert Excel to Image in Python
from spire.xls import *
from spire.xls.common import *
# Create a Workbook object
workbook = Workbook()
# Load an Excel file
workbook.LoadFromFile("Sample.xlsx")
# Get the first worksheet
sheet = workbook.Worksheets[0]
# Save the worksheet to an image
image = sheet.ToImage(sheet.FirstRow, sheet.FirstColumn, sheet.LastRow, sheet.LastColumn)
# Save the image to a PNG file
image.Save("SheetToImage.png", ImageFormat.get_Png())
workbook.Dispose()
Product Page | Documentation | Examples | Forum | Temporary License | Customized Demo
Metadata
Release files for spire-xls 16.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| spire_xls-16.8.2-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| spire_xls-16.8.2-py3-none-manylinux_2_34_x86_64.whl | Python 3 | none | Linux glibc 2.34+ x86-64 | Details |
| spire_xls-16.8.2-py3-none-manylinux2014_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| spire_xls-16.8.2-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| spire_xls-16.8.2-py3-none-macosx_10_7_universal.whl | Python 3 | none | macOS 10.7+ universal (x86-64, i386, PPC64, PPC) | Details |
Total release size: 166.8 MB
Release files / spire_xls-16.8.2-py3-none-win_amd64.whl
| Download URL | spire_xls-16.8.2-py3-none-win_amd64.whl |
|---|---|
| Size | 26.0 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e4636a213b3f771be2fa5a739392fa5c80cbdcc35a6ea2f394fc850eec2f824b
|
|
BLAKE2b-256 checksum How to use checksums |
9cffd84e5f26f93434b3cd42922ab284021426db86968e330a402657892163e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / spire_xls-16.8.2-py3-none-manylinux_2_34_x86_64.whl
| Download URL | spire_xls-16.8.2-py3-none-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 39.9 MB |
| Tags | Linux glibc 2.34+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
849afa4680ee6df0a7dfbc3b001ab202236dc4ac5b75a6c6fa37845d8194450e
|
|
BLAKE2b-256 checksum How to use checksums |
43934e69a11846f833920e981a0b4e0c96adb90558e1117e149de861aa7a01e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / spire_xls-16.8.2-py3-none-manylinux2014_aarch64.whl
| Download URL | spire_xls-16.8.2-py3-none-manylinux2014_aarch64.whl |
|---|---|
| Size | 23.9 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
03861ef12db3e7f2bbc122c45b8f1e09690b9188a56f6f0dc1050a34d5cddb1b
|
|
BLAKE2b-256 checksum How to use checksums |
5d52735e8a13b103fc3c37ac1dbcf8309c0e5eee4df328f5ac07c7d1cf32d5bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / spire_xls-16.8.2-py3-none-macosx_11_0_arm64.whl
| Download URL | spire_xls-16.8.2-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 27.8 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c01c57ea17a7bd27b12194595e23f9c8f4ad6f2dce3fa8d7644a2c84321e6dd7
|
|
BLAKE2b-256 checksum How to use checksums |
be94d883f1edbf1fa9845ad1a18e84c9ef9e5750da3a1a7c8a982b2211b22f54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / spire_xls-16.8.2-py3-none-macosx_10_7_universal.whl
| Download URL | spire_xls-16.8.2-py3-none-macosx_10_7_universal.whl |
|---|---|
| Size | 49.3 MB |
| Tags | Python 3 macOS 10.7+ universal (x86-64, i386, PPC64, PPC) |
|
SHA-256 checksum How to use checksums |
e281a9b7922acb08d6da4d9bcccfba498a3bb2350e8558405ea8b7247673ca56
|
|
BLAKE2b-256 checksum How to use checksums |
fc014915a058fa5fd3ca3cee1e6dfe225dfa5cfaeb20fca392e3e573d97a94c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|