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

Uploaded Python 3Windows x86-64

spire_xls-15.7.1-py3-none-manylinux_2_31_x86_64.whl (38.3 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ x86-64

spire_xls-15.7.1-py3-none-manylinux2014_aarch64.whl (23.1 MB view details)

Uploaded Python 3

spire_xls-15.7.1-py3-none-macosx_10_7_universal.whl (47.6 MB view details)

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

File details

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

File metadata

  • Download URL: spire_xls-15.7.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 25.2 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.7.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9fd476b7eab046db8b771463666e5f0e3f7668d52e12ee07649d0563f8898f65
MD5 4b5101a8935aa1abdeb5f18879b7df70
BLAKE2b-256 f2fff387ded0e5e587b44e8f594afdf9eea3551b63ad5adef81975e8ec09588a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-15.7.1-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 b55d680c6a1956aab1dc2ad585e3700bd13420134b5c45e14a1412b2ab3cb167
MD5 01a6ae883203c3dd163266dad96367ec
BLAKE2b-256 c7ff4dd8da79c9e2ce296fcff5f4682ba2a32cbd439a548cd0c53aed4a8e64af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-15.7.1-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 89be0454bc5b02052c8f6d7c1b5320c2b90db5a0e172b71ebeda84e639769115
MD5 e584fcd981635fbc53078cc971ed8f4b
BLAKE2b-256 b835dc48ec59426255482c2239e971826ee010e861ff5ea1920deb2955f474ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-15.7.1-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 615336047aac3999d90018c2de0e88f16c942d4e46c2c3ef7973f9dd5d824332
MD5 0a1d4b6185df67325d6692760a01a062
BLAKE2b-256 2df46bebad80c85ed6ba34f3fb8a86e04844f02cd2f7b6c2a1140b148e013990

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