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-14.9.3-py3-none-win_amd64.whl (24.6 MB view details)

Uploaded Python 3Windows x86-64

Spire.Xls-14.9.3-py3-none-manylinux1_x86_64.whl (37.7 MB view details)

Uploaded Python 3

Spire.Xls-14.9.3-py3-none-macosx_10_7_universal.whl (46.9 MB view details)

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

File details

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

File metadata

  • Download URL: Spire.Xls-14.9.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 24.6 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.9.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3c45309180abd62a2ff83d2d9276a8600d72aeba4ecf405f2c97fef04950a9ac
MD5 0b4a72acdfe45005feb6ebd0b1fbc374
BLAKE2b-256 1824ad3b6d20fb43c404f1ddabf95863b44a1475275df4715fb11e985fa53607

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Spire.Xls-14.9.3-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fd283907dc59dbcffbe989280df321080f353ebe9562b80ab34ef51edbbcb750
MD5 7afcbcb8058d43eebfb38af979a18394
BLAKE2b-256 711813899880b3ad37613a8d035144cc1f13e0c79a91fbedaefe0070457d6cc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Spire.Xls-14.9.3-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 5bcfb76de2e8319e444cb8d4b5a56578aad5175481ee7ee2a7a4a38bf60beef8
MD5 89b8088ee502cd78122ff2d2f239eae1
BLAKE2b-256 a626e7fc02174c583f659b9575e52c877b51720e0f1083d0ba164bb304a074e8

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