1. Products
  2.   Spreadsheet
  3.   Python
  4.   Aspose.Cells for Python via .NET

Aspose.Cells for Python via .NET

 
 

C# .NET API to Create & Convert Excel Spreadsheets

A useful Python library enables developers to generate, edit, manipulate & convert Microsoft Excel Spreadsheet programmatically.

Aspose.Cells for Python via .NET is a very useful and flexible library that allows developers to create and manipulate Microsoft Excel files programmatically using Python code. The library provides support for a wide range of Microsoft Excel file formats, including XLS, XLSX, XLSM, XLSB, XLTX, XLTM, XLAM, and so on. This library is built on top of the .NET framework and provides an easy-to-use interface for Python developers to access the features of the Aspose.Cells library.

Aspose.Cells for Python via .NET API is well-documented, with plenty of examples and sample code available to help developers get started. There are several important features part of the library, such as adding new worksheets, copying or moving worksheets between workbooks, auto-filters creation, adding comments to Excel cells, rendering worksheets to raster images, rendering worksheets to PDF, implementing data sorting, calculating complex Excel formulae, insert hyperlinks to link data, protect/unprotect worksheets, create pivot tables and pivot charts, encrypt files, adjust page orientation, page scaling, setting paper size, apply all characters formatting and many more.

Aspose.Cells for Python via .NET is very easy to handle and makes software developer’s job easy by providing them a comprehensive set of features for creating, reading, writing, printing, exporting, and manipulating Excel files. The library provides a set of Python classes and methods that map directly to the functionality of the Aspose.Cells library. This makes it easy for developers to work with Excel files without having to write complex .NET code. The library provides high-performance memory management and optimized code execution making it easy to execute large Excel files quickly and efficiently.

Previous Next

Getting Started with Aspose.Cells for Python via .NET

Aspose.Cells for Python via .NET is distributed as a ZIP archive. You need to have Python 3.6 or higher versions to be installed. You can easily use Aspose.Cells for Python via .NET from pypi with the following command.

Install Aspose.Cells for Python via .NET via pypi

 $ pip install aspose-cells-python 
You can also download it directly from Aspose product release page.

Excel Spreadsheet Creation via Python API

Aspose.Cells for Python via .NET has included complete support for Microsoft Excel Spreadsheet creation and management using Python commands. The library has included several important features for simple or complex spreadsheets creation and management, such as adding new worksheet to existing workbook, creating shared worksheets, Copy and Move Worksheets, add images and charts to worksheets, important text to spreadsheet, replace text inside worksheets, managing document properties, adding styles for content formatting, merging rows and columns, and many more.

Creating a New Workbook in Different Formats via Python API

import aspose.cells
from aspose.cells import Workbook

# Create an instance of the Workbook class.
workbook = Workbook()

# Insert the words Hello World! into a cell accessed.
workbook.worksheets.get(0).cells.get("A1").put_value("Hello World")

# Save as XLS file
workbook.save("output.xls")

# Save as XLSX file
workbook.save("output.xlsx")

# Save as ods file
workbook.save("output.ods")

Protect Excel Spreadsheet via Python API

Aspose.Cells for Python via .NET provides complete capability for protecting and unprotecting their Excel spreadsheet documents inside their own Python applications. The library enables software developers from preventing others from accessing data in Excel files, protecting Excel file with a password, preventing viewing hidden worksheets, protecting structure of your Excel workbook with a password, locking the entireExcel worksheet from accidentally or deliberately changing, moving, or deleting data in a worksheet and so on.

Opening Encrypted Excel Files via Python

import aspose.cells
from aspose.cells import Workbook, LoadOptions, LoadFormat

# The path to the documents directory.
dataDir = ""

# Opening Microsoft Excel 2007 Xlsx Files
loadOptions = LoadOptions(LoadFormat.XLSX)

# Specify the password
loadOptions.password = "1234"

# Create a Workbook object and opening the file from its path
wbEncrypted = Workbook(dataDir + "EncryptedExcel.xlsx", loadOptions)
print("Encrypted excel file opened successfully!")

Use Formulas to Process Data via Python API

Aspose.Cells for Python via .NET has included the capability to process data with formulas and functions. The library has provided a large set of built-in functions and formulas that enables software developers to compute complex calculations with ease. The library supports a huge set of mathematical, string, Boolean, date/time, statistical, database, lookup and reference formulas. Moreover, it also possible to add user defined formulas that users want to include as an excel add-in. You can also use an array formula or add an R1C1 reference style formula to a cell inside your Python applications.

Excel Spreadsheet Conversion via Python API

Aspose.Cells for Python via .NET API is a very useful tool for converting Excel Spreadsheet to other supported file formats inside Python applications. There are several important features part of the library such as xporting spreadsheets to Markdown format , converting Excel Spreadsheet to PDF, Workbook to XPS, converting Excel files to OpenOffice & LibreOffice Calc, Excel workbook to MHTML, converting a workbook to JSON, Excel to TIFF and many more.  

Convert Excel Spreadsheets to Other File Formats via Python API

import aspose.cells
from aspose.cells import Workbook,SaveFormat
 
#load file to be converted
wk = Workbook("Book.xlsx");

#Convert XLS to PDF, XPS and HTML
wk.save("output.pdf", SaveFormat.PDF);

wk.save("output.xps", SaveFormat.XPS);

wk.save("houtput.html", SaveFormat.HTML);
 English