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

Uploaded Python 3Windows x86-64

spire_xls-15.5.0-py3-none-manylinux_2_31_x86_64.whl (38.0 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ x86-64

spire_xls-15.5.0-py3-none-manylinux2014_aarch64.whl (22.9 MB view details)

Uploaded Python 3

spire_xls-15.5.0-py3-none-macosx_10_7_universal.whl (47.3 MB view details)

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

File details

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

File metadata

  • Download URL: spire_xls-15.5.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 25.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-15.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 272daae2b471308f923e0e2ac93bf71f8eb406dcaa9fba79a25deaf8657f734a
MD5 1dca12d458d256c336421652ef6cd6ba
BLAKE2b-256 4544152bde1bf5fc250843731adc56ba33120a6bbc927955ae2cf8dc77979aba

See more details on using hashes here.

File details

Details for the file spire_xls-15.5.0-py3-none-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for spire_xls-15.5.0-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 7c073786afb82d0f8a4ca5237a3817d2b51e3d9cb7c636220001ba617b2bff60
MD5 4643dff7951872cbd13fe3a0a8739505
BLAKE2b-256 0444c078d8950dab76a074f725a2de9a36d72f94010ecba91c7106f3e851b7e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-15.5.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6ee3f441e68e1057a6c0dd2bb6aca325487b56d143e96748263d654c20237858
MD5 a373ab53fcb16dd328e137214c74f4df
BLAKE2b-256 f760c8568b9ffcb4117917db4d692a034541cad1bab8de0622f6ba26bd62ea85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-15.5.0-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 8f3278ba7a450dc2e77bf2412ae4686be2b189eacca9206b49b58c6fd826bd38
MD5 d24a652636deeb1d2242d90da885ed03
BLAKE2b-256 88ef8c89896769b08178302e390ad4c1a33f85860e8511fdf6dad6c77d2f89b9

See more details on using hashes here.

Supported by

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