odt-filemgr-oc

Create, parse, and edit ODT (OpenDocument Text) files locally using Python and odfdo. Use when the user asks to create, edit, read, update, append to, inspect, or manipulate any ODT file. Works with the nextcloud-aio-oc skill for NextCloud integration — that skill handles downloading and uploading the binary file; this skill handles all document-level editing.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "odt-filemgr-oc" with this command: npx skills add juicyroots/odt-filemgr-oc

ODT File Manager

Local ODT document creation and editing powered by odfdo.

Library: odfdo v3.20+ — actively maintained, single dep (lxml), full ODF support.

Required Setup

pip install odfdo

Skill Boundaries

This skill is purely local — it has no network access and knows nothing about NextCloud.

For NextCloud workflows, pair with nextcloud-aio-oc:

StepSkill
Find file on NextCloudnextcloud-aio-ocnode scripts/nextcloud.js files search
Download binary ODTnextcloud-aio-ocpython3 scripts/files_binary.py download
Edit / create ODTodt-filemgr-ocpython3 scripts/odt_tool.py ...
Upload binary ODTnextcloud-aio-ocpython3 scripts/files_binary.py upload

Scripts live at: ~/.openclaw/skills/odt-filemgr-oc/scripts/


Workflows

Edit an existing ODT (NextCloud)

NC=~/.openclaw/skills/nextcloud-aio-oc/scripts
ODT=~/.openclaw/skills/odt-filemgr-oc/scripts

# 1. Download
python3 $NC/files_binary.py download "/Documents/MyDoc.odt" /tmp/MyDoc.odt

# 2. Inspect
python3 $ODT/odt_tool.py inspect /tmp/MyDoc.odt

# 3. Edit
python3 $ODT/odt_tool.py append /tmp/MyDoc.odt --text "New Section" --heading 2
python3 $ODT/odt_tool.py append /tmp/MyDoc.odt --text "Section content here."

# 4. Upload back
python3 $NC/files_binary.py upload /tmp/MyDoc.odt "/Documents/MyDoc.odt"

Create a new ODT and push to NextCloud

# 1. Create locally
python3 $ODT/odt_tool.py create /tmp/NewDoc.odt --title "Q1 Report"

# 2. Add content
python3 $ODT/odt_tool.py append /tmp/NewDoc.odt --text "Summary" --heading 2
python3 $ODT/odt_tool.py append /tmp/NewDoc.odt --text "Results were positive across all metrics."

# 3. Push to NextCloud
python3 $NC/files_binary.py upload /tmp/NewDoc.odt "/Documents/Q1 Report.odt"

Edit a local ODT (no NextCloud)

python3 $ODT/odt_tool.py inspect   myfile.odt
python3 $ODT/odt_tool.py to-text   myfile.odt
python3 $ODT/odt_tool.py append    myfile.odt --text "Added paragraph."
python3 $ODT/odt_tool.py replace   myfile.odt --find "draft" --sub "final"
python3 $ODT/odt_tool.py set-meta  myfile.odt --title "Final Report"

odt_tool.py Commands

CommandDescription
inspect <file>Show metadata + paragraph/heading/table structure
to-text <file>Extract all text content in document order
create <file> [--title T]Create blank ODT (optional H1 title)
append <file> --text T [--heading N] [--style S]Append heading (N=1–6) or paragraph
replace <file> --find F --sub S [--regex]Find and replace text
set-meta <file> [--title T] [--subject S] [--description D]Update metadata
set-font <file> --font F [--size N] [--no-preserve-mono]Set font across all style layers (default + all named/inline overrides)
set-outline <file> --numbered | --plainToggle heading numbering (1.1.1 or none)
merge-styles <file> --template TApply all styles from a template ODT

Custom Python Edits

For table edits, style changes, or multi-step operations, write inline Python:

from odfdo import Document, Header, Paragraph

doc = Document("/tmp/file.odt")
body = doc.body

# Read all content in order
for child in body.children:
    if isinstance(child, Header):
        print(f"H{child.level}: {child.inner_text}")
    elif isinstance(child, Paragraph) and child.inner_text.strip():
        print(f"[{child.style}]: {child.inner_text}")

# Add content
body.append(Header(2, "New Section"))
body.append(Paragraph("Content here."))

# Table edit
table = body.get_table_by_name("MyTable")
table.set_value(0, 0, "Updated cell")

doc.save("/tmp/file.odt", pretty=True)

For the full odfdo API (tables, lists, spans, styles, metadata), see REFERENCE.md.


Key Rules

  1. Always inspect before editing a file you haven't seen.
  2. Temp files: use /tmp/ for working files; clean up after upload.
  3. Styles: for complex style systems (colors, spacing, borders), use merge-styles with a template rather than generating styles from scratch. set-font and set-outline work safely on any document without a template.

Troubleshooting

ErrorFix
ModuleNotFoundError: odfdopip install odfdo
zipfile.BadZipFileFile corrupted or not a real ODT — re-download
Heading doesn't appear as H1Use Header(1, "text"), not Paragraph("text", style="Heading 1")
Font still shows as Liberation in CollaboraODT has 6 font attributes per style rule. Old approach only set 3 (style:font-name-*). Collabora renders from fo:font-family — now all 6 are set. Re-run set-font.
Font name must match exactlyLibreOffice/Collabora font names are case-sensitive: "Noto Sans" not "noto sans"
set-outline changes not visibleSome documents override numbering via paragraph styles — use merge-styles with a clean template instead

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Kafka

Manage Kafka topics and data by producing, consuming, monitoring lag, exporting, and running toolkit commands from the CLI.

Registry SourceRecently Updated
Coding

Builder

Scaffold and configure projects, generate boilerplate code, manage build systems, and export project data in various formats.

Registry SourceRecently Updated
Coding

Wallpaper Claw Skill

Generate stunning AI wallpapers for mobile, desktop, ultrawide, and iPad — sized perfectly for each device in one command.

Registry SourceRecently Updated