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

Uploaded Python 3Windows x86-64

spire_xls-16.4.0-py3-none-manylinux_2_31_x86_64.whl (39.1 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ x86-64

spire_xls-16.4.0-py3-none-manylinux2014_aarch64.whl (23.5 MB view details)

Uploaded Python 3

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

Uploaded Python 3macOS 11.0+ ARM64

spire_xls-16.4.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.4.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: spire_xls-16.4.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 25.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-16.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5275e48b64596c53c96ccb29627730fa0ce3e43a71fbce7e835c78880ba5ab04
MD5 8e5c4f9e58a07117982d734213005bca
BLAKE2b-256 a4e4388c479b7cb7a1761784dd218e4b2df90757ac740266952379df1b66b447

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.4.0-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 62083e17e4cf2fd30b17186c9448e933847834da5dd92be1385c8f35e3ef0aaa
MD5 b61fbeeb6674400ede13ceb274c9aec0
BLAKE2b-256 d8a46137ae6770922d359ab2e03ec7d36e88bce9ca51d59ca13d95ea7c700576

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.4.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 708d546ddb57c455827dec49e13a5afe847ed4522d5462459aaeb84709f2f920
MD5 4ab4aa63c2a77cc814c1b700e9507d65
BLAKE2b-256 fbae20256469ba800b5f09e3c89161a509dfcca625ea1cc84a6ba32032cc8156

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.4.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b0947df090aa8cdfa18b226c142b3f5bd9484fdb670a3b70689d492b090a7494
MD5 e20dde11d0a67197e65725f1f246a77c
BLAKE2b-256 42434a7e9e8593ad66bb716c193e9aa9c5fb0c6ef2daa2d39e2ca7fa24c15f39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.4.0-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 2f9af4f8d8d52698ec9277e0cd18e434d102baa98a117bf734a68d1f42c90dd6
MD5 782c929b7378f222b5e1006380b9215b
BLAKE2b-256 ef39c796ece8eb1d6fb859f91e168cb33d2d6e7e7eb36859917c09277766695c

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