
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
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.
Merge Excel files, or split Excel files
Add worksheets, copy worksheets, or rename worksheets
Hide or show worksheets
Remove conditional formatting from Excel
Hide or show Excel comments
Add or delete digital signatures in Excel
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
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()
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()
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
FAQs
A 100% standalone Excel Python API for Processing Excel Files
We found that spire-xls demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.