Skip to main content

A 100% standalone Excel Python API for Processing Excel Files

Project description

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

Project details


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

Spire.Xls-14.7.3-py3-none-win_amd64.whl (24.1 MB view details)

Uploaded Python 3 Windows x86-64

Spire.Xls-14.7.3-py3-none-manylinux1_x86_64.whl (37.3 MB view details)

Uploaded Python 3

Spire.Xls-14.7.3-py3-none-macosx_10_7_universal.whl (43.4 MB view details)

Uploaded Python 3 macOS 10.7+ universal

File details

Details for the file Spire.Xls-14.7.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: Spire.Xls-14.7.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 24.1 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-14.7.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0f11fc8698a8a965c1e86169a5969708a05087753a07588b5b9246f8075904d1
MD5 7847c5f7454fc72dc53ac2e01e639917
BLAKE2b-256 1b6c15f5ffabdbbac0ab7a92f90b5886ed9fe0a7b472466177d87dafa85dbe5c

See more details on using hashes here.

File details

Details for the file Spire.Xls-14.7.3-py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for Spire.Xls-14.7.3-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f91470afd13ac7d258f2b16aec99fb9effbe0712f51646c86f9557b6e725a3ac
MD5 332acd6dc59f1ac63e249afebf682f0b
BLAKE2b-256 dff622bbf603a1e53acea94528ff62b40aa65008153479dff7b596fac1165689

See more details on using hashes here.

File details

Details for the file Spire.Xls-14.7.3-py3-none-macosx_10_7_universal.whl.

File metadata

File hashes

Hashes for Spire.Xls-14.7.3-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 062c812de54825458f4071fe0ad146fc286a5d1c129cad33b5db75f004139101
MD5 896d95121dcd4f1be0991695e6e609b0
BLAKE2b-256 291f83ddbe7a64cdd95ea6d8e23dbd88d7429bcc0c5b029e08530f48cf37bb9c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page