LibreOffice Calc
Overview
LibreOffice Calc skill for creating, editing, converting, and automating spreadsheet workflows using the native ODS (OpenDocument Spreadsheet) format.
When to Use This Skill
Use this skill when:
- Creating new spreadsheets in ODS format
- Converting between ODS, XLSX, CSV, PDF formats
- Automating data processing and analysis
- Creating formulas, charts, and pivot tables
- Batch processing spreadsheet operations
Core Capabilities
1. Spreadsheet Creation
- Create new ODS spreadsheets from scratch
- Generate spreadsheets from templates
- Create data entry forms
- Build dashboards and reports
2. Format Conversion
- ODS to other formats: XLSX, CSV, PDF, HTML
- Other formats to ODS: XLSX, XLS, CSV, DBF
- Batch conversion of multiple files
3. Data Automation
- Formula automation and calculations
- Data import from CSV, database, APIs
- Data export to various formats
- Batch data processing
4. Data Analysis
- Pivot tables and data summarization
- Statistical functions and analysis
- Data validation and filtering
- Conditional formatting
5. Integration
- Command-line automation via soffice
- Python scripting with UNO
- Database connectivity
Workflows
Creating a New Spreadsheet
Method 1: Command-Line
soffice --calc template.ods
Method 2: Python with UNO
import uno
def create_spreadsheet():
local_ctx = uno.getComponentContext()
resolver = local_ctx.ServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", local_ctx
)
ctx = resolver.resolve(
"uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"
)
smgr = ctx.ServiceManager
doc = smgr.createInstanceWithContext("com.sun.star.sheet.SpreadsheetDocument", ctx)
sheets = doc.getSheets()
sheet = sheets.getByIndex(0)
cell = sheet.getCellByPosition(0, 0)
cell.setString("Hello from LibreOffice Calc!")
doc.storeToURL("file:///path/to/spreadsheet.ods", ())
doc.close(True)
Method 3: Using ezodf
import ezodf
doc = ezodf.newdoc('ods', 'spreadsheet.ods')
sheet = doc.sheets[0]
sheet['A1'].set_value('Hello')
sheet['B1'].set_value('World')
doc.save()
Converting Spreadsheets
# ODS to XLSX
soffice --headless --convert-to xlsx spreadsheet.ods
# ODS to CSV
soffice --headless --convert-to csv spreadsheet.ods
# ODS to PDF
soffice --headless --convert-to pdf spreadsheet.ods
# XLSX to ODS
soffice --headless --convert-to ods spreadsheet.xlsx
# Batch convert
for file in *.ods; do
soffice --headless --convert-to xlsx "$file"
done
Formula Automation
import uno
def create_formula_spreadsheet():
local_ctx = uno.getComponentContext()
resolver = local_ctx.ServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", local_ctx
)
ctx = resolver.resolve(
"uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"
)
smgr = ctx.ServiceManager
doc = smgr.createInstanceWithContext("com.sun.star.sheet.SpreadsheetDocument", ctx)
sheet = doc.getSheets().getByIndex(0)
sheet.getCellByPosition(0, 0).setDoubleValue(100)
sheet.getCellByPosition(0, 1).setDoubleValue(200)
cell = sheet.getCellByPosition(0, 2)
cell.setFormula("SUM(A1:A2)")
doc.storeToURL("file:///path/to/formulas.ods", ())
doc.close(True)
Format Conversion Reference
Supported Input Formats
- ODS (native), XLSX, XLS, CSV, DBF, HTML
Supported Output Formats
- ODS, XLSX, XLS, CSV, PDF, HTML
Command-Line Reference
soffice --headless
soffice --headless --convert-to <format> <file>
soffice --calc # Calc
Python Libraries
pip install ezodf # ODS handling
pip install odfpy # ODF manipulation
pip install pandas # Data analysis
Best Practices
- Use named ranges for clarity
- Document complex formulas
- Use data validation for input control
- Create templates for recurring reports
- Store ODS source files in version control
- Test conversions thoroughly
- Use CSV for data exchange
- Handle conversion failures gracefully
Troubleshooting
Cannot open socket
killall soffice.bin
soffice --headless --accept="socket,host=localhost,port=8100;urp;"
Resources
Related Skills
- writer
- impress
- draw
- base
- xlsx-official
- workflow-automation
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
1---2name: calc3description: "Spreadsheet creation, format conversion (ODS/XLSX/CSV), formulas, data automation with LibreOffice Calc."4category: spreadsheet-processing5risk: safe6source: personal7date_added: "2026-02-27"8metadata:9 source: https://skillmd.com/skills/mhassan0000/calc10---1112# LibreOffice Calc1314## Overview1516LibreOffice Calc skill for creating, editing, converting, and automating spreadsheet workflows using the native ODS (OpenDocument Spreadsheet) format.1718## When to Use This Skill1920Use this skill when:21- Creating new spreadsheets in ODS format22- Converting between ODS, XLSX, CSV, PDF formats23- Automating data processing and analysis24- Creating formulas, charts, and pivot tables25- Batch processing spreadsheet operations2627## Core Capabilities2829### 1. Spreadsheet Creation30- Create new ODS spreadsheets from scratch31- Generate spreadsheets from templates32- Create data entry forms33- Build dashboards and reports3435### 2. Format Conversion36- ODS to other formats: XLSX, CSV, PDF, HTML37- Other formats to ODS: XLSX, XLS, CSV, DBF38- Batch conversion of multiple files3940### 3. Data Automation41- Formula automation and calculations42- Data import from CSV, database, APIs43- Data export to various formats44- Batch data processing4546### 4. Data Analysis47- Pivot tables and data summarization48- Statistical functions and analysis49- Data validation and filtering50- Conditional formatting5152### 5. Integration53- Command-line automation via soffice54- Python scripting with UNO55- Database connectivity5657## Workflows5859### Creating a New Spreadsheet6061#### Method 1: Command-Line62```bash63soffice --calc template.ods64```6566#### Method 2: Python with UNO67```python68import uno6970def create_spreadsheet():71 local_ctx = uno.getComponentContext()72 resolver = local_ctx.ServiceManager.createInstanceWithContext(73 "com.sun.star.bridge.UnoUrlResolver", local_ctx74 )75 ctx = resolver.resolve(76 "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"77 )78 smgr = ctx.ServiceManager79 doc = smgr.createInstanceWithContext("com.sun.star.sheet.SpreadsheetDocument", ctx)80 sheets = doc.getSheets()81 sheet = sheets.getByIndex(0)82 cell = sheet.getCellByPosition(0, 0)83 cell.setString("Hello from LibreOffice Calc!")84 doc.storeToURL("file:///path/to/spreadsheet.ods", ())85 doc.close(True)86```8788#### Method 3: Using ezodf89```python90import ezodf9192doc = ezodf.newdoc('ods', 'spreadsheet.ods')93sheet = doc.sheets[0]94sheet['A1'].set_value('Hello')95sheet['B1'].set_value('World')96doc.save()97```9899### Converting Spreadsheets100101```bash102# ODS to XLSX103soffice --headless --convert-to xlsx spreadsheet.ods104105# ODS to CSV106soffice --headless --convert-to csv spreadsheet.ods107108# ODS to PDF109soffice --headless --convert-to pdf spreadsheet.ods110111# XLSX to ODS112soffice --headless --convert-to ods spreadsheet.xlsx113114# Batch convert115for file in *.ods; do116 soffice --headless --convert-to xlsx "$file"117done118```119120### Formula Automation121```python122import uno123124def create_formula_spreadsheet():125 local_ctx = uno.getComponentContext()126 resolver = local_ctx.ServiceManager.createInstanceWithContext(127 "com.sun.star.bridge.UnoUrlResolver", local_ctx128 )129 ctx = resolver.resolve(130 "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"131 )132 smgr = ctx.ServiceManager133 doc = smgr.createInstanceWithContext("com.sun.star.sheet.SpreadsheetDocument", ctx)134 sheet = doc.getSheets().getByIndex(0)135 136 sheet.getCellByPosition(0, 0).setDoubleValue(100)137 sheet.getCellByPosition(0, 1).setDoubleValue(200)138 139 cell = sheet.getCellByPosition(0, 2)140 cell.setFormula("SUM(A1:A2)")141 142 doc.storeToURL("file:///path/to/formulas.ods", ())143 doc.close(True)144```145146## Format Conversion Reference147148### Supported Input Formats149- ODS (native), XLSX, XLS, CSV, DBF, HTML150151### Supported Output Formats152- ODS, XLSX, XLS, CSV, PDF, HTML153154## Command-Line Reference155156```bash157soffice --headless158soffice --headless --convert-to <format> <file>159soffice --calc # Calc160```161162## Python Libraries163164```bash165pip install ezodf # ODS handling166pip install odfpy # ODF manipulation167pip install pandas # Data analysis168```169170## Best Practices1711721. Use named ranges for clarity1732. Document complex formulas1743. Use data validation for input control1754. Create templates for recurring reports1765. Store ODS source files in version control1776. Test conversions thoroughly1787. Use CSV for data exchange1798. Handle conversion failures gracefully180181## Troubleshooting182183### Cannot open socket184```bash185killall soffice.bin186soffice --headless --accept="socket,host=localhost,port=8100;urp;"187```188189## Resources190191- [LibreOffice Calc Guide](https://documentation.libreoffice.org/)192- [UNO API Reference](https://api.libreoffice.org/)193- [ezodf Documentation](http://ezodf.rst2.org/)194195## Related Skills196197- writer198- impress199- draw200- base201- xlsx-official202- workflow-automation203204## Limitations205- Use this skill only when the task clearly matches the scope described above.206- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.207- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.