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

Uploaded Python 3Windows x86-64

spire_xls-16.5.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.5.0-py3-none-manylinux2014_aarch64.whl (23.5 MB view details)

Uploaded Python 3

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

Uploaded Python 3macOS 11.0+ ARM64

spire_xls-16.5.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.5.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: spire_xls-16.5.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.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 81c9862fede6bda1004eb333a9661b51225eb9c418984868e7152c99382f87e7
MD5 8ac2b16a5ed9a9275c3588fc76165f2e
BLAKE2b-256 e0a7a264d9f1a5cad09d6bcd4f9959ca5434438bb78031f61e49c2cbdc194b80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.5.0-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 de8197e75264d464cdbb358c18b8e0c5009e0fdd434083ffc452f97d6dad075b
MD5 7633182aebdee58d7acbf6a9599fcc63
BLAKE2b-256 39adc3ea5474c75daca4a34eb604d15b71b8d4631faf0b6247225b1430c0694d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.5.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 feafb5e83810046e5e6806b7440b5cc82374e1aae55f3adb4b1afd594a632e6b
MD5 105c79d5d0cdd447b9d5c3caa4a8f916
BLAKE2b-256 f46054ac50808dd3e923874f640289135e8a6c4427c1ec5df740a49a4379165c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.5.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 630173a184edf7f1705ceb6a7b75fafe61012a816ba809ff6721513a389c5cab
MD5 3e50085a6f170a8c67adc4818e19c22a
BLAKE2b-256 ed88563b5c0d0736a0d0e437252d18929c7fd8c812cca386c958e10aac3e2f76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.5.0-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 0581ecff41702ac38288f9399b30cd32066282b8a5cb0ac7f269ac7f2e5ee7d0
MD5 d6d7d7a8442c20dc69c4ed125f3fe207
BLAKE2b-256 a1a0ceb743ca100654468fde7a7a3fd3c39283c6ce42418825c15fa89067987a

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