Skip to main content

Aspose.Cells FOSS for Python

PyPI version Python License: MIT Contributors

Aspose.Cells FOSS for Python

Aspose.Cells FOSS for Python is a free, open-source, pure-Python library for creating, reading, modifying, and exporting Excel .xlsx workbooks without requiring Microsoft Excel.

Features

  • Create, load, edit, and save .xlsx workbooks
  • Read and write cell values and formulas using A1 references
  • Apply fonts, fills, borders, alignment, and number formats
  • Manage worksheets, merged cells, hyperlinks, page setup, and page breaks
  • Create and preserve charts, pictures, shapes, tables, and sparklines
  • Add data validation, conditional formatting, auto-filters, and comments
  • Configure workbook, worksheet, and cell protection
  • Read and write password-encrypted .xlsx files
  • Import CSV and export CSV, TSV, JSON, Markdown, and PDF
  • Preserve unsupported workbook parts where possible during load/save round trips

Installation

Install the package from PyPI:

pip install aspose-cells-foss

The package requires Python 3.10 or later. Its core runtime dependencies are pycryptodome>=3.15.0 and olefile>=0.46.

PDF support

PDF export uses skia-python, which is not currently installed by the core package. Install the renderer separately:

pip install "skia-python>=144.0.post2,<145"

Quick start

Create a workbook

from aspose.cells_foss import Workbook

workbook = Workbook()
worksheet = workbook.worksheets[0]

worksheet.cells["A1"].value = "Product"
worksheet.cells["B1"].value = "Revenue"
worksheet.cells["A2"].value = "Widget"
worksheet.cells["B2"].value = 1250.50

workbook.save("report.xlsx")

Read a workbook

from aspose.cells_foss import Workbook

workbook = Workbook("report.xlsx")
worksheet = workbook.worksheets[0]

print(worksheet.cells["B2"].value)

Apply cell styling

from aspose.cells_foss import Workbook

workbook = Workbook()
cell = workbook.worksheets[0].cells["A1"]
cell.value = "Quarterly Report"

style = cell.get_style()
style.font.bold = True
style.font.color = "#FF0000"
style.font.size = 14
cell.apply_style(style)

workbook.save("styled.xlsx")

Add a validation list

from aspose.cells_foss import DataValidationType, Workbook

workbook = Workbook()
worksheet = workbook.worksheets[0]

validation = worksheet.data_validations.add("A1:A10")
validation.type = DataValidationType.LIST
validation.formula1 = '"Yes,No"'

workbook.save("validation.xlsx")

Export a workbook

The output format is inferred from the file extension:

from aspose.cells_foss import Workbook

workbook = Workbook("report.xlsx")
workbook.save("report.csv")
workbook.save("report.json")
workbook.save("report.md")
workbook.save("report.pdf")  # Requires skia-python

Encrypt a workbook

from aspose.cells_foss import Workbook

workbook = Workbook()
workbook.worksheets[0].cells["A1"].value = "Confidential"
workbook.save("protected.xlsx", password="example-password")

loaded = Workbook("protected.xlsx", password="example-password")
print(loaded.worksheets[0].cells["A1"].value)

Supported formats

Format Load Save
XLSX Yes Yes
Encrypted XLSX Yes Yes
CSV Yes Yes
TSV No Yes
JSON No Yes
Markdown No Yes
PDF No Yes

CSV import is available through Workbook.load_csv() or load_csv_workbook().

Scope

  • Formula expressions and cached results are preserved, but this project is not a full Excel calculation engine.
  • Native workbook loading and saving targets the Open XML .xlsx format. Other spreadsheet formats such as .xls, .ods, and .xlsb are not supported.
  • Some advanced Excel features are preserved as source package parts rather than exposed as editable Python objects.
  • PDF output depends on locally available fonts and the optional skia-python renderer.

Examples and API

Development

Install the development dependencies and collect or run the examples:

pip install -e ".[dev]"
python -m pytest examples -v

Generated workbooks are written below examples/outputfiles/ and are not intended for source control.

License

This project is licensed under the MIT License. Third-party notices are available in License/ThirdPartyNotices.txt.

Metadata

Release files for aspose-cells-foss 26.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aspose-cells-foss 26.10.0
File Size Uploaded
aspose_cells_foss-26.10.0.tar.gz 642.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aspose-cells-foss 26.10.0
File Interpreter ABI Platform
aspose_cells_foss-26.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / aspose_cells_foss-26.10.0.tar.gz

Download URL aspose_cells_foss-26.10.0.tar.gz
Size 642.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2573acaf38c107bb9c69c09227bc5d40e92b41450340a1a568f1bb00118b3cfe
BLAKE2b-256 checksum
How to use checksums
ea5dde61d495b0dc9aa28f866c6f772de84b3f9bebc040d3ea1558282627332f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / aspose_cells_foss-26.10.0-py3-none-any.whl

Download URL aspose_cells_foss-26.10.0-py3-none-any.whl
Size 690.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea60cf8ce1e8b2d2d360f14518171c4595810a5bddd9e595652d29658c54730f
BLAKE2b-256 checksum
How to use checksums
6e81d6ed1a3a3c53059bcbe40e6f3dce39e8caa37259370001397b81521d4581
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

26.10.0 This release

2 release files

26.7.0

2 release files

26.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page