Python Docx
Helps with Python, Word documents as part of developing backend services and APIs workflows.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add python-docx npx -- -y @trustedskills/python-docx
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"python-docx": {
"command": "npx",
"args": [
"-y",
"@trustedskills/python-docx"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
python-docx
What it does
The python-docx library enables AI agents to programmatically create, modify, and read Microsoft Word documents (.docx). It allows agents to manipulate document structure, add text, insert images, and handle complex formatting without manual intervention.
When to use it
- Automating the generation of standardized reports, invoices, or legal contracts from templates.
- Processing user-submitted
.docxfiles to extract specific data fields for analysis. - Batch updating hundreds of existing documents with new headers, footers, or metadata.
- Integrating document creation workflows into backend services that require rich text output.
Key capabilities
- Create new
.docxfiles from scratch or load existing ones. - Add and format paragraphs, tables, lists, and images.
- Modify styles, fonts, colors, and alignment dynamically.
- Insert hyperlinks and bookmarks within documents.
- Save changes to local files or return document content as bytes.
Example prompts
- "Create a new Word document with a title 'Project Plan' and a table listing tasks, owners, and deadlines."
- "Read the attached contract.docx file and replace all instances of 'Company X' with 'Acme Corp'."
- "Generate a monthly sales report in .docx format by pulling data from our database and inserting it into a pre-defined template."
Tips & gotchas
Ensure your AI agent has write permissions to the target directory when saving generated documents. While python-docx handles standard formatting well, highly complex layouts with nested tables or advanced graphics may require manual verification after automation.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.