Skip to main content

A Python Library for Processing Excel Spreadsheets

Foo

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

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

Advanced Cell Manipulation & Calculation Engine

Excel Charts, Images, Shapes and Other Elements

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

spire_xls-16.7.1-py3-none-win_amd64.whl (26.0 MB view details)

Uploaded Python 3Windows x86-64

spire_xls-16.7.1-py3-none-manylinux_2_34_x86_64.whl (39.9 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

spire_xls-16.7.1-py3-none-manylinux2014_aarch64.whl (23.9 MB view details)

Uploaded Python 3

spire_xls-16.7.1-py3-none-macosx_11_0_arm64.whl (27.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

spire_xls-16.7.1-py3-none-macosx_10_7_universal.whl (49.3 MB view details)

Uploaded Python 3macOS 10.7+ universal (x86-64, i386, PPC64, PPC)

File details

Details for the file spire_xls-16.7.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: spire_xls-16.7.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 26.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for spire_xls-16.7.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ff05fbb57dce9a81dd1364811321d99db4725e57ccb3a9dc37874b67aba145a0
MD5 c7a50a23facfd281d444eaa1a87e0364
BLAKE2b-256 397effa56eab0354cde25a3feeeba42c1285c232da4c5e7f1d9757287e7ffecc

See more details on using hashes here.

File details

Details for the file spire_xls-16.7.1-py3-none-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for spire_xls-16.7.1-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0d4678840277fb8932b6375339d0c0230d5c2e6a90c685833fdc239add6dbd87
MD5 8eecaacf83a2fc2158671adc2bbf8d5d
BLAKE2b-256 02dd5976d48f350122a2af0e2b65fb88d07edf522584ffb2434b1fff5b11c1dc

See more details on using hashes here.

File details

Details for the file spire_xls-16.7.1-py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for spire_xls-16.7.1-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 893f614a526780ed13e3c80970d4838c800809055e90a42892a786e74d905d6e
MD5 e0486304767478d4098441d788af5496
BLAKE2b-256 29866f570bc7ddccbf732859d699d238f8ad5985016071e324e040a926e96521

See more details on using hashes here.

File details

Details for the file spire_xls-16.7.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spire_xls-16.7.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9c6f6a7cbbb55a34475abd0fb59110a9af6280287e393ebf21a02e9066c7f685
MD5 7fe75e9f30c2c7f3b7ea6dbec6cb7749
BLAKE2b-256 222967b6790b5e0e50dd1ae7b38127ad90c869c82d1f47653b64176c822672ce

See more details on using hashes here.

File details

Details for the file spire_xls-16.7.1-py3-none-macosx_10_7_universal.whl.

File metadata

File hashes

Hashes for spire_xls-16.7.1-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 4d535634dc531626888547bab51912fd4047631793442489b63cb114c3708ed4
MD5 ebbf2da20436f83d467b360cb33a3d8c
BLAKE2b-256 9ad50991026e1c3d0271299744b30247951f39cc966ca98aefbe1aca6e7c4173

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page