Skip to main content

A 100% standalone Excel Python API for Processing Excel Files

Project description

Python API for Processing Excel Files

Foo

Product Page | Documentation | Examples | Forum | Temporary License | Customized Demo

Spire.XLS for Python is a professional Excel Python API that can be used to create, read, write, and convert Excel files in any type of Python applications without installing Microsoft Office.

The API supports both the old Excel 97-2003 format (.xls) and the new Excel 2007, Excel 2010, Excel 2013, Excel 2016 and Excel 2019 (.xlsx, .xlsb, .xlsm), along with Open Office(.ods) format. It features fast and reliably compared with developing your own spreadsheet manipulation solution or using Microsoft Automation.

100% Standalone Python API

Spire.XLS for Python is a 100% standalone Excel Python class library without requiring Microsoft Excel or Microsoft Office to be installed on the system.

Freely Operate Excel Files

Create/Save/Merge/Split/Get Excel files. Encrypt/Decrypt Excel files, add/delete digital signature, tracking changes, lock/unlock worksheets. Create/Add/Rename/Edit/Delete/Move worksheets. Insert/Modify/Remove hyperlinks. Add/Remove/Change/Hide/Show comments in Excel. Merge/Unmerge Excel cells, freeze/unfreeze Excel panes, insert/delete Excel rows and columns. Add/Read/Calculate/Remove Excel formulas. Create/Refresh pivot table. Apply/Remove conditional format in Excel. Add/Set/Change Excel header and footer.

Easily Manipulate Cells & Excel Calculation Engine at Runtime

Developers can easily manipulate Excel cells and Evaluate formula value in Python at runtime. Super-fast, scalable excel calculation engine is compatible with the 97-2003/2007/2010/2013/2016/2019 Excel. Cell Styles are supported by this Excel Python API, such as cell merging/unmerging, text wrapping/unwrapping, text alignment, rotation, interior, borders, lock/unlock and etc. Font formats, like setting font type, size, color, bold, italic, strikeout and underlining etc. is also fully supported. Conditional formatting, text search and replace, filter and data validation can be applied to cells as easily as you expect.

Powerful & High Quality Excel File Conversion

Convert Excel to PDF/Excel to HTML/Excel to XML/Excel to CSV/Excel to Image/Excel to XPS/Excel to SVG Convert CSV to Excel/CSV toPDF/Datatable Convert selected range of cells to PDF Convert XLS to XLSM and maintain macro Convert Excel to OpenDocument Spreadsheet(.ods) format Save Excel chart sheet to SVG/Image Convert HTML to Excel

Chart, Data and other Elements

Spire.XLS for Python provides a wide range of Chart: Pie Chart, Bar Chart, Column Chart, Line Chart, Radar Chart and etc. This Excel Python API also supports data transportation between database and Excel in Python. Hyperlinks and templates are also supported by Spire.XLS for Python.

Examples

Create an Excel File in Python

from spire.common import *
from spire.xls import *


outputFile = "CreateAnExcelWithFiveSheet.xlsx"

workbook = Workbook()
workbook.CreateEmptySheets(5)
for i in range(0, 5):
    sheet = workbook.Worksheets[i]
    sheet.Name = "Sheet" + str(i)
    for row in range(1, 151):
        for col in range(1, 51):
            sheet.Range[row,col].Text = "row" + str(row) + " col" + str(col)

workbook.SaveToFile(outputFile, ExcelVersion.Version2010)
workbook.Dispose()

Convert Excel to PDF in Python

from spire.xls import *
from spire.common import *


inputFile = "./Demos/Data/ToPDF.xlsx"
outputFile = "ToPDF.pdf"

#create a workbook
workbook = Workbook()
#load a excel document
workbook.LoadFromFile(inputFile)
workbook.ConverterSetting.SheetFitToPage = True
#convert to PDF file
workbook.SaveToFile(outputFile, FileFormat.PDF)
workbook.Dispose()

Convert Excel to Image in Python

from spire.xls import *
from spire.common import *


inputFile = "./Demos/Data/SheetToImage.xlsx"
outputFile = "SheetToImage.png"

workbook = Workbook()
workbook.LoadFromFile(inputFile)
sheet = workbook.Worksheets[0]
sheet.ToImage(sheet.FirstRow, sheet.FirstColumn, sheet.LastRow, sheet.LastColumn).Save(outputFile)
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-14.2.2-py3-none-win_amd64.whl (23.9 MB view details)

Uploaded Python 3Windows x86-64

Spire.Xls-14.2.2-py3-none-manylinux1_x86_64.whl (37.2 MB view details)

Uploaded Python 3

Spire.Xls-14.2.2-py3-none-macosx_10_7_universal.whl (43.3 MB view details)

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

File details

Details for the file Spire.Xls-14.2.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: Spire.Xls-14.2.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 23.9 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-14.2.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 05340b3040f3cf9f065cc26a7a64884a9cb4de26229d94da80f26979586cad88
MD5 8ffb22cad17e18c96d8a6a1aa394dec8
BLAKE2b-256 0f3de542f37f30649d1b8724e64f4bdaca9858abf5df17c7fd7fc1a10e7cf1ed

See more details on using hashes here.

File details

Details for the file Spire.Xls-14.2.2-py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for Spire.Xls-14.2.2-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9cd544e466d996f76bbf1c639a72b60b9ea8aab333332e982b56c3636481c4bc
MD5 6e9b2fdec47d78300f34208d8591d2a5
BLAKE2b-256 7703c7ce28c11bc4235358468c1be865eb9bf908ed3f527ddf1ee179e1bad937

See more details on using hashes here.

File details

Details for the file Spire.Xls-14.2.2-py3-none-macosx_10_7_universal.whl.

File metadata

File hashes

Hashes for Spire.Xls-14.2.2-py3-none-macosx_10_7_universal.whl
Algorithm Hash digest
SHA256 76a0a1e172328bc5e68e19ead0d2db981634163b32d8cbfb5bea3c932947e1ec
MD5 e066da64f3a7ed85c996a29824697c5f
BLAKE2b-256 ffc1d0e68c4f8fddf6cc5708286d62b9abed127ecb6c74046aed76db5ff90286

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