Skip to content
Back to skills

Open Docx

ASecurity

Create, read and edit Word (.docx) files with python-docx. Use for any .docx request, for example a report, letter or memo to produce, or an existing document to read or change.

  • 27 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 26, 2026
ai-agentspython

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned November 26, 2026

npx -y skills add pymc-labs/daimon --skill open-docx --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Open Docx?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Open Docx
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pymc-labs-open-docx/badge)](https://www.skillsdirectory.com/skills/pymc-labs-open-docx)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: open-docx
description: Create, read and edit Word (.docx) files with python-docx. Use for any .docx request, for example a report, letter or memo to produce, or an existing document to read or change.
---

# Word documents

Use `python-docx` (`import docx`), installed in the sandbox. If the import fails and
`pip install python-docx` has no network, say the library is missing; don't hand-write the XML.

## Read

```python
from docx import Document
doc = Document("in.docx")
for p in doc.paragraphs: print(p.style.name, "|", p.text)
for t in doc.tables: print([[c.text for c in r.cells] for r in t.rows])
```

## Create

Build from built-in styles, not manual fonts: `doc.add_heading(text, level)`,
`doc.add_paragraph(text, style="List Bullet")`, `doc.add_table(rows, cols)` with
`table.style = "Table Grid"`, `doc.add_picture(path, width=Inches(6))`,
`doc.add_page_break()`. Save with `doc.save("out.docx")`.

## Edit

Open the file, change paragraphs and runs in place, and save under a new name.
Keep a paragraph's formatting by editing `run.text`, not `paragraph.text` (which
drops run styling). Headers and footers are `doc.sections[0].header`/`.footer`.

## Check

Reopen the saved file and print its text. To look at it, convert with
`soffice --headless --convert-to pdf out.docx` when LibreOffice exists. Tracked
changes and comments are not supported by python-docx: say so rather than
dropping them silently.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.