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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.31+ x86-64

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

Uploaded Python 3

spire_xls-16.2.0-py3-none-macosx_11_0_arm64.whl (27.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

spire_xls-16.2.0-py3-none-macosx_10_7_universal.whl (48.4 MB view details)

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

File details

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

File metadata

  • Download URL: spire_xls-16.2.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.2.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f2fa2ed4c27869e0efb5ae5582f78e6fd33d87e7c3ac8de3218623a9106a8454
MD5 c46f920038cade25de2520668555c3ed
BLAKE2b-256 4ff86d858eb7cb847bcea5c050c795cc463adb94c8daf77f5bb7fc8863871089

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.2.0-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 38824be9a7ad75925e8a6407e2f0a424cbafee61eed9f31cd37c8b7f2eeb8f04
MD5 a9295499a2e8e8d073d3c32ac4513d11
BLAKE2b-256 ecc70eeab69abec84b2ba5e68872578a03ff039ff54fcf4571e40777445d1dab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.2.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e5c415efce85bdfd1bf50c63d86a139b09588f81b6c2f85abf3ac3d8376c3088
MD5 295783cec410f53cfc6303e3ef612a27
BLAKE2b-256 198b33c5b68c27004041f4810e46b466409376c9c85edd80c5fdd4027d13c9e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.2.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f942369307999a52d300cbb778d9a282e46e84ed01a567bc27e9195c46e19040
MD5 c4d6677ce2229f88e7e436b25e94b37c
BLAKE2b-256 7bc040c9b3fe5f27551ceb5a2fccf32855736324a98814925c06691577bde75e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spire_xls-16.2.0-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 fa8377343c2930bb1ab35379d2df3382ddc782d70f1e64cd1c698e779f45ceed
MD5 3b7e0e57fbd693ae1b3cd1fa8ad5ce40
BLAKE2b-256 8c83714466be3bb4504d5fcb7050e78e1ea2fca60d7a3fb15d80503f77dbe285

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