MCPcopy
hub / github.com/python-openxml/python-docx

github.com/python-openxml/python-docx @v1.2.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.2.0 ↗
3,610 symbols 11,793 edges 206 files 1,228 documented · 34%
README

python-docx

python-docx is a Python library for reading, creating, and updating Microsoft Word 2007+ (.docx) files.

Installation

pip install python-docx

Example

>>> from docx import Document

>>> document = Document()
>>> document.add_paragraph("It was a dark and stormy night.")
<docx.text.paragraph.Paragraph object at 0x10f19e760>
>>> document.save("dark-and-stormy.docx")

>>> document = Document("dark-and-stormy.docx")
>>> document.paragraphs[0].text
'It was a dark and stormy night.'

More information is available in the python-docx documentation

Core symbols most depended-on inside this repo

element
called by 328
tests/unitutil/cxml.py
instance_mock
called by 241
tests/unitutil/mock.py
register_element_cls
called by 127
src/docx/oxml/parser.py
Document
called by 121
src/docx/api.py
xml
called by 96
tests/unitutil/cxml.py
class_mock
called by 80
tests/unitutil/mock.py
xpath
called by 61
src/docx/oxml/xmlchemy.py
method_mock
called by 48
tests/unitutil/mock.py

Shape

Method 2,532
Function 579
Class 487
Route 12

Languages

Python100%

Modules by API surface

tests/oxml/test_xmlchemy.py110 symbols
src/docx/oxml/xmlchemy.py95 symbols
tests/image/test_jpeg.py90 symbols
src/docx/oxml/table.py81 symbols
src/docx/oxml/simpletypes.py81 symbols
tests/test_table.py77 symbols
tests/test_section.py71 symbols
features/steps/styles.py71 symbols
features/steps/table.py69 symbols
tests/styles/test_style.py66 symbols
tests/opc/test_part.py66 symbols
tests/image/test_png.py66 symbols

Dependencies from manifests, versioned

Jinja22.11.3 · 1×
MarkupSafe0.23 · 1×
Sphinx1.8.6 · 1×
behave1.2.3 · 1×
lxml3.1.0 · 1×
pyparsing2.0.1 · 1×
pytest2.5 · 1×
setuptools61.0.0 · 1×
typing_extensions4.9.0 · 1×

For agents

$ claude mcp add python-docx \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact