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

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

spire_xls-16.6.0-py3-none-win_amd64.whl (25.7 MB view details)

Uploaded Python 3Windows x86-64

spire_xls-16.6.0-py3-none-manylinux_2_34_x86_64.whl (39.1 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

spire_xls-16.6.0-py3-none-manylinux2014_aarch64.whl (23.6 MB view details)

Uploaded Python 3

spire_xls-16.6.0-py3-none-macosx_11_0_arm64.whl (27.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

spire_xls-16.6.0-py3-none-macosx_10_7_universal.whl (48.6 MB view details)

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

File details

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

File metadata

  • Download URL: spire_xls-16.6.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 25.7 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.6.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 10c8179ca53be6898a5747135e0a2365d6417cb9ab291ffa7d9c683c73bbcb27
MD5 480b163454d58ab393a0c3b1ada37553
BLAKE2b-256 cc5adbb9f6697287b5a09576fe75fdbf2ee9a18d98a2f01c04a3e243b1d5a3a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.6.0-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 eb2ecb6dcdaa5513560e8be6fcd6677c61bc46cbccdc2c50949a4208c5a87f5d
MD5 37d15fc40f0d8cc2321f6310e80618ad
BLAKE2b-256 6611c80a5d9276cc3a3d438df798b3e3550edde9c8dcdc9bf79a312b253db240

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.6.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e2bf9b1efccaefe968b3c63362f91f60aa2a81c54f0395b57458bca68fc5754d
MD5 256872593067e013fe025b7624e777da
BLAKE2b-256 47de6cb9663504af49ff439bf3d470f726777c7642e769187a357cb7f207d66a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.6.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd3c6fb6951b8950068d49a3740c06afbf18c4c0fd697c07de3a3862caa9ae37
MD5 a9fff1bd463742814cfea75b5613c25b
BLAKE2b-256 5bc5536d3329d6ae863d0ab184a8158977c13cd40874f3afb07088d83fbf56e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.6.0-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 a5edee2f127ebdd2f275e2c4165b369d06df1f795bfeabe8ceee084eb5bff8ae
MD5 4f71b23d287665c6a1b2cbb0f0f245e2
BLAKE2b-256 9a7343c7520e63bf314ed8f7a2a7e6798882fad3165a994f75173332f53a5607

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 Pingdom Monitoring Sentry Error logging StatusPage Status page