A powerful library for manipulating and converting Excel (XLS, XLSX, XLSB), CSV, ODS, PDF, JSON, JPG, PNG, BMP, EMF, SVG and HTML files.
Project description
Product Page | Docs | API Reference | Demos | Blog | Code Samples | Free Support | Temporary License | EULA
Try our free online apps demonstrating some of the most popular Aspose.Cells functionality.
A powerful library for manipulating and converting Excel (XLS, XLSX, XLSB), CSV, ODS, PDF, JSON, JPG, PNG, BMP, SVG, EMF and HTML files.
Aspsoe.Cells API Features
Aspose.Cells offers a wide arrange of features for creating, reading, manipulating and saving Excel® files:
Spreadsheet generation & manipulation via API.
High-quality file format conversion & rendering.
Print Microsoft Excel® files to physical or virtual printers.
Combine, modify, protect, or parse Excel® sheets.
Apply worksheet formatting.
Configure and apply page setup for the worksheets.
Create & customize Excel® charts, Pivot Tables, conditional formatting rules, slicers, tables & spark-lines.
Convert Excel® charts to images & PDF.
Convert Excel® files to various other formats.
Formula calculation engine that supports all basic and advanced Excel functions.
Supported Read & Write Formats
Microsoft Excel®: XLS, XLSX, XLSB, XLSM, XLT, XLTX, XLTM, SpreadsheetML
OpenOffice: ODS, SXC, FODS
Text: JSON, TXT, CSV, TSV, Tab-Delimited
Web: HTML, MHTML
iWork®: Numbers
Save Excel® Files As
Microsoft Word®: DOCX
Microsoft PowerPoint®: PPTX
Microsoft Excel®: XLAM
Fixed Layout: PDF, XPS
Text: JSON, TXT, CSV, TSV, Tab-Delimited, XML
Image: TIFF, PNG, BMP, JPEG, GIF, SVG
Metafile: EMF
Markdown: MD
Create Excel file from scratch using Python
# import the python package
import aspose.cells
from aspose.cells import License, Workbook, FileFormatType
# Create a new Workbook
workbook = Workbook()
# Get the first worksheet
worksheet = workbook.worksheets[0]
# Get the "A1" cell
cells = worksheet.cells
cell = cells.get("A1")
# Write "Hello World" to "A1" in the first sheet
cell.put_value("Hello World!")
# save this workbook to XLSX
workbook.save("HelloWorld.xlsx")
Convert Excel XLSX file to PDF using Python
# import the python package
import aspose.cells
from aspose.cells import License, Workbook, FileFormatType
workbook = Workbook("HelloWorld.xlsx")
# save this workbook to resultFile,you can see a chart while open the file with MS-Excel*/
workbook.save("HelloWorld.pdf");
Create a simple pivot table using Aspose.Cells
from aspose.cells import Workbook
from aspose.cells.pivot import PivotFieldType
# Instantiating a Workbook object
workbook = Workbook()
# Obtaining the reference of the newly added worksheet
sheet = workbook.worksheets[0]
cells = sheet.cells
# Setting the value to the cells
cell = cells.get("A1")
cell.put_value("Sport")
cell = cells.get("B1")
cell.put_value("Quarter")
cell = cells.get("C1")
cell.put_value("Sales")
cell = cells.get("A2")
cell.put_value("Golf")
cell = cells.get("A3")
cell.put_value("Golf")
cell = cells.get("A4")
cell.put_value("Tennis")
cell = cells.get("A5")
cell.put_value("Tennis")
cell = cells.get("A6")
cell.put_value("Tennis")
cell = cells.get("A7")
cell.put_value("Tennis")
cell = cells.get("A8")
cell.put_value("Golf")
cell = cells.get("B2")
cell.put_value("Qtr3")
cell = cells.get("B3")
cell.put_value("Qtr4")
cell = cells.get("B4")
cell.put_value("Qtr3")
cell = cells.get("B5")
cell.put_value("Qtr4")
cell = cells.get("B6")
cell.put_value("Qtr3")
cell = cells.get("B7")
cell.put_value("Qtr4")
cell = cells.get("B8")
cell.put_value("Qtr3")
cell = cells.get("C2")
cell.put_value(1500)
cell = cells.get("C3")
cell.put_value(2000)
cell = cells.get("C4")
cell.put_value(600)
cell = cells.get("C5")
cell.put_value(1500)
cell = cells.get("C6")
cell.put_value(4070)
cell = cells.get("C7")
cell.put_value(5000)
cell = cells.get("C8")
cell.put_value(6430)
pivotTables = sheet.pivot_tables
# Adding a PivotTable to the worksheet
index = pivotTables.add("=A1:C8", "E3", "PivotTable2")
# Accessing the instance of the newly added PivotTable
pivotTable = pivotTables[index]
# Unshowing grand totals for rows.
pivotTable.row_grand = False
# Draging the first field to the row area.
pivotTable.add_field_to_area(PivotFieldType.ROW, 0)
# Draging the second field to the column area.
pivotTable.add_field_to_area(PivotFieldType.COLUMN, 1)
# Draging the third field to the data area.
pivotTable.add_field_to_area(PivotFieldType.DATA, 2)
# Saving the Excel file
workbook.save("pivotTable_test_out.xls")
Convert Excel workbook to JSON
from aspose.cells import Workbook
# Instantiating a Workbook object
workbook = Workbook()
# Obtaining the reference of the newly added worksheet
sheet = workbook.worksheets[0]
cells = sheet.cells
# Setting the value to the cells
cell = cells.get("A1")
cell.put_value("First name")
cell = cells.get("A2")
cell.put_value("Simon")
cell = cells.get("A3")
cell.put_value("Kevin")
cell = cells.get("A4")
cell.put_value("Leo")
cell = cells.get("A5")
cell.put_value("Johnson")
cell = cells.get("B1")
cell.put_value("Age")
cell = cells.get("C1")
cell.put_value("Value")
cell = cells.get("B2")
cell.put_value(32)
cell = cells.get("B3")
cell.put_value(33)
cell = cells.get("B4")
cell.put_value(34)
cell = cells.get("B5")
cell.put_value(35)
cell = cells.get("C2")
cell.put_value(123.546)
cell = cells.get("C3")
cell.put_value(56.78)
cell = cells.get("C4")
cell.put_value(34)
cell = cells.get("C5")
cell.put_value(9)
# Saving the Excel file to json
workbook.save("Out.json")
Product Page | Docs | API Reference | Demos | Blog | Free Support | Temporary License | EULA
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for aspose_cells_python-24.10.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 450d9bc7e67be3eb7f7796cab5d6a38432c9092d04ceecfacf07a684a5abd722 |
|
MD5 | 002a9685f379096f88de5dc027280c9e |
|
BLAKE2b-256 | d68f29d0e2d2064fd1f62b479aa2df064d2a55d435703561d0640ec26d83092a |
Hashes for aspose_cells_python-24.10.0-py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c002bde0ef74f4dc3f25c0f024aab656e56eeffa9b1276d999d3facc089b2a49 |
|
MD5 | 0579d72f00328864f8a6899dcf2926ad |
|
BLAKE2b-256 | b05377738476d67305e127438b86b8815b6a9957c1607b8d8ae00c9389d34238 |
Hashes for aspose_cells_python-24.10.0-py3-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af434318f71c6d9404c09a738aa816f818ea064d06b7dd64bf6b8e34b52c1ecb |
|
MD5 | 856fdf98ce9ebde287b5476fbb7e9af3 |
|
BLAKE2b-256 | 64a2941a17fb152d60ea714ccbbbebfdd53acec75cac74d8ac2d285c5ee93b67 |
Hashes for aspose_cells_python-24.10.0-py3-none-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89f875be8fa43a6d9927372cdaa1e34ab5c104eae90875f6bf71253a06b0ec6a |
|
MD5 | 3479fd29f8e14f0d7e6af72bb0eb3c58 |
|
BLAKE2b-256 | 389763618d1dd1ba34ec2b016c939f65f20898e776aeb5568d1575556854d734 |
Hashes for aspose_cells_python-24.10.0-py3-none-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba474f9d1d11c58c658e608b30c74a3eb46853506976b775a90e9d779b8382ee |
|
MD5 | 776721e1679f56fbc52f1545c1bb9209 |
|
BLAKE2b-256 | c751c26b41d307cf17d612a484a9b451386c932df1a67ef3c28c1e512327a002 |