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

Uploaded Python 3Windows x86-64

spire_xls-15.11.1-py3-none-manylinux_2_31_x86_64.whl (38.9 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ x86-64

spire_xls-15.11.1-py3-none-manylinux2014_aarch64.whl (23.4 MB view details)

Uploaded Python 3

spire_xls-15.11.1-py3-none-macosx_10_7_universal.whl (48.3 MB view details)

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

File details

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

File metadata

  • Download URL: spire_xls-15.11.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 25.5 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.11.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 735a064289ad54cd909b7067376e05a01f2cb1ef31771ad2e8dd3a2168871b16
MD5 11dda5f72ab65bb8f753febec7ee5fbe
BLAKE2b-256 78281f7c391b2705da0099de17c46a8bc98c24231d2adce38658fcbee7f932ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-15.11.1-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 a032e93366d6cb15f4d63a00501e31f04964af839eeb3d25e689f2ef1d05facb
MD5 95d1d0bd13e6cdccae28af44ef710ee2
BLAKE2b-256 48736ef463ef02fc494e6adda46d71526028fcf645e6219720696b6993cd5caa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-15.11.1-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e8ed9e7b2af77f61fbbd4009989dd6387b47bb7b0dc9de9b6010303d0ff24789
MD5 7b1676d2952422877077381f75670cf3
BLAKE2b-256 0ac19567575b4f4e43d8b9ad373fd71f6a8309d7b0e2c0e1390ce016feff9b05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-15.11.1-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 22170e3d64f6efcb0544348808c20b79ca086e4ea7707807e933cc28a371eb6a
MD5 575c7150918200e5ed1fa723c0d93902
BLAKE2b-256 787e08df677887aeabca5067a9d2dda072048a8192f7cf1f9759abbff1bfacd5

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