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.
- Create, load, edit, and save
.xlsxworkbooks - 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
.xlsxfiles - Import CSV and export CSV, TSV, JSON, Markdown, and PDF
- Preserve unsupported workbook parts where possible during load/save round trips
Install the package from PyPI:
pip install aspose-cells-fossThe package requires Python 3.10 or later. Its core runtime dependencies are
pycryptodome>=3.15.0 and olefile>=0.46.
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"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")from aspose.cells_foss import Workbook
workbook = Workbook("report.xlsx")
worksheet = workbook.worksheets[0]
print(worksheet.cells["B2"].value)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")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")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-pythonfrom 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)| Format | Load | Save |
|---|---|---|
| XLSX | Yes | Yes |
| Encrypted XLSX | Yes | Yes |
| CSV | Yes | Yes |
| TSV | No | Yes |
| JSON | No | Yes |
| Markdown | No | Yes |
| No | Yes |
CSV import is available through Workbook.load_csv() or load_csv_workbook().
- 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
.xlsxformat. Other spreadsheet formats such as.xls,.ods, and.xlsbare 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-pythonrenderer.
- Browse the executable examples for feature-specific workflows.
- See the package's public exports in
aspose/cells_foss/__init__.py. - Read the current release notes.
- Review development conventions in AGENTS.md.
- Found a bug or have a feature request? Open an issue.
Install the development dependencies and collect or run the examples:
pip install -e ".[dev]"
python -m pytest examples -vGenerated workbooks are written below examples/outputfiles/ and are not intended for source
control.
This project is licensed under the MIT License. Third-party notices are available in License/ThirdPartyNotices.txt.
