---
Product: Aspose.Cells
Platform: python
Page Type: kb
Canonical URL: https://kb.aspose.org/cells/python/how-to-get-started-cells-python
Last Updated: 2026-04-04
---

# How to Get Started with Aspose.Cells FOSS for Python

Learn how to install aspose-cells-foss, create a workbook, write cell values, read them back, and save to XLSX, CSV, and Markdown using Workbook, Worksheet, Cells, Cell, and SaveFormat.

`aspose-cells-foss` for Python is a free, MIT-licensed library for creating, reading, and
converting spreadsheet files — no Microsoft Office required, no native extensions, pure
Python from PyPI.

## Step-by-Step Guide

### Step 1: Install the Package

Install from PyPI with pip:

```bash
pip install aspose-cells-foss
```

Verify the install:

```python
from aspose.cells_foss import Workbook
print("aspose-cells-foss is ready.")
```

---

### Step 2: Import Required Classes

```python
from aspose.cells_foss import Workbook, SaveFormat
```

---

### Step 3: Create a Workbook and Write Data

Use `Workbook()` to create a new workbook. Add a worksheet with `add_worksheet()`, then
access its cell grid via the `cells` property and use `Cells.cell(row, col)` to get a
`Cell`. Set values with `Cell.put_value()`:

```python
from aspose.cells_foss import Workbook, SaveFormat

wb = Workbook()
ws = wb.add_worksheet("Sales")

cells = ws.cells
cells.cell(1, 1).put_value("Product")
cells.cell(1, 2).put_value("Revenue")
cells.cell(2, 1).put_value("Widget A")
cells.cell(2, 2).put_value(12500)
cells.cell(3, 1).put_value("Widget B")
cells.cell(3, 2).put_value(8750)

wb.save("sales.xlsx", SaveFormat.XLSX)
print("sales.xlsx written.")
```

---

### Step 4: Read the Workbook Back

Load an existing file by passing the file path to `Workbook(file_path)`. Use
`get_worksheet()` by index or name, then read cell values via the `value` property:

```python
from aspose.cells_foss import Workbook

wb = Workbook("sales.xlsx")
ws = wb.get_worksheet(0)
cells = ws.cells

print(f"A1: {cells.cell(1, 1).value}")
print(f"B2: {cells.cell(2, 2).value}")
```

---

### Step 5: Save to Other Formats

`Workbook.save()` supports multiple formats via `SaveFormat`. Use `SaveFormat.CSV` for
comma-separated output and `SaveFormat.MARKDOWN` for Markdown tables:

```python
from aspose.cells_foss import Workbook, SaveFormat

wb = Workbook("sales.xlsx")
wb.save("sales.csv", SaveFormat.CSV)
wb.save("sales.md", SaveFormat.MARKDOWN)
print("CSV and Markdown exports written.")
```

## Common Issues and Fixes

**`ModuleNotFoundError: No module named 'aspose'`**
Install the package in the active virtual environment (see the Installation guide).
Confirm with `pip show aspose-cells-foss`.

**`FileNotFoundError` when loading a workbook**
Use `pathlib.Path` to build portable paths: `Workbook(str(Path("data") / "file.xlsx"))`.

**Cell value returns `None` after reading**
The cell is empty or out of range. Use `Cell.is_empty()` to check before reading `value`.

**CSV output contains only the first sheet**
`save()` with `SaveFormat.CSV` exports the active worksheet only. Use
`set_active_worksheet()` to select the sheet you want to export before saving.

**XLSX file is not opened by Excel**
Ensure you pass `SaveFormat.XLSX` explicitly. Without it the format is inferred from the
file extension; if the path has no `.xlsx` extension the output may not be valid.

## Frequently Asked Questions

### Does aspose-cells-foss require Microsoft Office?

No. The library reads and writes spreadsheet files natively in pure Python without any
dependency on Microsoft Office, COM automation, or Windows APIs.

### Which Python versions are supported?

Python 3.7 or later. The package runs on Windows, macOS, Linux, and Docker containers.

### Is the library free for commercial use?

Yes. It is released under the MIT License. You may use, modify, and redistribute it for
any purpose, including commercial applications.

### How do I iterate over all cells in a sheet?

Use `Cells.iter_rows()` to iterate row by row:

```python
from aspose.cells_foss import Workbook

wb = Workbook("data.xlsx")
ws = wb.get_worksheet(0)
for row in ws.cells.iter_rows(0, None, 0, None, values_only=True):
    print(row)
```

### Which formats can I save to?

`SaveFormat` supports `XLSX`, `CSV`, `TSV`, `MARKDOWN`, and `JSON`. Use
`SaveFormat.from_extension(file_path)` to detect the format automatically from a file path.

## See Also

- [FAQ — Aspose.Cells FOSS for Python](https://kb.aspose.org/cells/python/faq/)
- [How to Load Spreadsheets in Python](https://kb.aspose.org/cells/python/how-to-load-spreadsheets-python/)
- [How to Save Spreadsheets in Python](https://kb.aspose.org/cells/python/how-to-save-spreadsheets-python/)
- [Getting Started Docs](https://docs.aspose.org/cells/python/getting-started/)
- [API Reference](https://reference.aspose.org/cells/python/)
- [Aspose.Cells for Python — Enterprise Knowledge Base](https://kb.aspose.com/cells/python/)