dfk1352/LibreOffice-skills / skills/libreoffice-calc
libreoffice-calc
VerifiedUse when creating, editing, formatting, exporting, or extracting LibreOffice Calc (.ods) spreadsheets via UNO, including session-based cell and range edits, sheets, named ranges, validation, charts, patch workflows, and snapshots.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.3 KB |
| references/troubleshooting.md | markdown | 3.5 KB |
| scripts/calc/__init__.py | script | 586 B |
| scripts/calc/core.py | script | 3.5 KB |
| scripts/calc/exceptions.py | script | 2.5 KB |
| scripts/calc/patch.py | script | 11.5 KB |
| scripts/calc/session.py | script | 19.5 KB |
| scripts/calc/snapshot.py | script | 7.3 KB |
| scripts/calc/targets.py | script | 12.9 KB |
| scripts/colors.py | script | 4.6 KB |
| scripts/constants.py | script | 180 B |
| scripts/exceptions.py | script | 748 B |
| scripts/patch_base.py | script | 12.1 KB |
| scripts/session.py | script | 2.6 KB |
| scripts/uno_bridge.py | script | 9.1 KB |
references/troubleshooting.md
View on GitHub# Troubleshooting
## "Binary URP bridge disposed during call" with LibreOffice 26.x
Symptom examples:
- `RuntimeException: Binary URP bridge disposed during call`
- `loadComponentFromURL` succeeds but returns a broken proxy
Cause:
- LibreOffice 26.x installs to `/opt/libreoffice26.x/` with a versioned
binary (e.g. `libreoffice26.2`) instead of the usual `soffice` in PATH.
System Python does not inherit the `URE_BOOTSTRAP` and `UNO_PATH` environment
variables that LO's bundled Python sets automatically. Without them,
`uno.getComponentContext()` creates a minimal context that cannot bridge to
a running LO instance.
What to check:
1. Ensure you are using the latest version of this skill (the UNO bridge now
detects versioned binaries and sets the required variables automatically).
2. If using a custom `PYTHONPATH` setup, verify that the `uno_bridge.py` from
this skill's `scripts/` directory is the one being imported.
3. As a manual workaround, set the variables before running your script:
```bash
export URE_BOOTSTRAP="vnd.sun.star.pathname:/opt/libreoffice26.2/program/fundamentalrc"
export UNO_PATH="/opt/libreoffice26.2/program"
```
## UNO import fails after setting `PYTHONPATH`
Symptom examples:
- `ModuleNotFoundError: No module named 'uno'`
- Calc imports work, but opening a spreadsheet fails before LibreOffice starts
Cause:
- `PYTHONPATH=<skill_base_dir>/scripts` exposes the bundled skill modules, but
some environments still need the system LibreOffice Python packages on the
Python import path.
What to check:
1. LibreOffice is installed on the machine.
2. The Python process can import `uno`.
3. If `uno` is missing, add the distro LibreOffice Python path before running
your script. A common Linux path is `/usr/lib/python3/dist-packages`.
Example:
```bash
PYTHONPATH="skills/libreoffice-calc/scripts:/usr/lib/python3/dist-packages" python3 your_script.py
```
If your platform uses a different LibreOffice Python location, use that path
instead.
## Patch result says `document_persisted = false`
Meaning:
- `document_persisted` reports whether the patch mutations currently exist in a
saved spreadsheet state.
- Standalone `calc.patch(...)` saves the file when successful mutations should
persist.
- `session.patch(...)` reports `true` when the session now holds successful
in-memory mutations, even before the session is later closed and stored.
## Chart follow-up targeting feels unclear
Recommendations:
1. When `create_chart()` sets `title`, reuse that same string as the most
stable later chart target name.
2. Use `CalcTarget(kind="chart", sheet=..., name=...)` when the chart title or
assigned name is known.
3. Use chart `index` only when chart order is stable and intentional.
## Version Compatibility
Some Calc skill features depend on LibreOffice 26.2 or newer. The core editing
API (create, session, export, patch, snapshots) works on older versions.
### JSON / XML import (26.2+)
`create_spreadsheet(path, source="data.json")` and
`create_spreadsheet(path, source="data.xml")` rely on the orcus-based
auto-detection added in LibreOffice 26.2. When a JSON or XML file is passed as
`source`, `loadComponentFromURL` auto-detects the format through orcus without
needing a `FilterName`. The imported data is then saved as an ODS spreadsheet.
On older versions, this auto-detection is not available and the call will fail
with a UNO import error or silently produce an empty spreadsheet.
Workaround: convert JSON / XML to CSV or ODS externally before importing on
pre-26.2 installations.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |