# python-docx-ng > A Python library for creating and updating Microsoft Word (.docx) files. python-docx-ng is a Python library for creating and updating Microsoft Word (.docx) files. It is a downstream superset of python-docx; the importable package is `docx`. ## User guide - [Home](https://toxicphreak.github.io/python-docx-ng/index.md) - [API basics](https://toxicphreak.github.io/python-docx-ng/user/api-concepts/index.md) - [Bookmarks](https://toxicphreak.github.io/python-docx-ng/user/bookmarks/index.md) - [Style usage and cleanup](https://toxicphreak.github.io/python-docx-ng/user/cleanup/index.md) - [Command line](https://toxicphreak.github.io/python-docx-ng/user/cli/index.md) - [Comments](https://toxicphreak.github.io/python-docx-ng/user/comments/index.md) - [Copying content](https://toxicphreak.github.io/python-docx-ng/user/copying/index.md) - [Document properties](https://toxicphreak.github.io/python-docx-ng/user/document-properties/index.md) - [Documents](https://toxicphreak.github.io/python-docx-ng/user/documents/index.md) - [Fields, captions and tables of contents](https://toxicphreak.github.io/python-docx-ng/user/fields/index.md) - [Footnotes and endnotes](https://toxicphreak.github.io/python-docx-ng/user/footnotes/index.md) - [Form fields and content controls](https://toxicphreak.github.io/python-docx-ng/user/form-fields/index.md) - [Headers and footers](https://toxicphreak.github.io/python-docx-ng/user/hdrftr/index.md) - [Images](https://toxicphreak.github.io/python-docx-ng/user/images/index.md) - [Installing](https://toxicphreak.github.io/python-docx-ng/user/install/index.md) - [Migrating from 0.9.x](https://toxicphreak.github.io/python-docx-ng/user/migrating-from-0-9/index.md) - [Numbered and bulleted lists](https://toxicphreak.github.io/python-docx-ng/user/numbering/index.md) - [Quickstart](https://toxicphreak.github.io/python-docx-ng/user/quickstart/index.md) - [Tracked changes](https://toxicphreak.github.io/python-docx-ng/user/revisions/index.md) - [Finding and replacing text](https://toxicphreak.github.io/python-docx-ng/user/search-replace/index.md) - [Sections](https://toxicphreak.github.io/python-docx-ng/user/sections/index.md) - [Understanding pictures and shapes](https://toxicphreak.github.io/python-docx-ng/user/shapes/index.md) - [Understanding styles](https://toxicphreak.github.io/python-docx-ng/user/styles-understanding/index.md) - [Working with styles](https://toxicphreak.github.io/python-docx-ng/user/styles-using/index.md) - [Tables](https://toxicphreak.github.io/python-docx-ng/user/tables/index.md) - [Templates, embedded files and macros](https://toxicphreak.github.io/python-docx-ng/user/templates/index.md) - [Text](https://toxicphreak.github.io/python-docx-ng/user/text/index.md) - [Watermarks](https://toxicphreak.github.io/python-docx-ng/user/watermarks/index.md) ## API reference - [SUMMARY](https://toxicphreak.github.io/python-docx-ng/api/SUMMARY/index.md) - [docx](https://toxicphreak.github.io/python-docx-ng/api/docx/index.md) - [altchunk](https://toxicphreak.github.io/python-docx-ng/api/docx/altchunk/index.md) - [api](https://toxicphreak.github.io/python-docx-ng/api/docx/api/index.md) - [blkcntnr](https://toxicphreak.github.io/python-docx-ng/api/docx/blkcntnr/index.md) - [bookmark](https://toxicphreak.github.io/python-docx-ng/api/docx/bookmark/index.md) - [borders](https://toxicphreak.github.io/python-docx-ng/api/docx/borders/index.md) - [caption](https://toxicphreak.github.io/python-docx-ng/api/docx/caption/index.md) - [cleanup](https://toxicphreak.github.io/python-docx-ng/api/docx/cleanup/index.md) - [cli](https://toxicphreak.github.io/python-docx-ng/api/docx/cli/index.md) - [comments](https://toxicphreak.github.io/python-docx-ng/api/docx/comments/index.md) - [copy](https://toxicphreak.github.io/python-docx-ng/api/docx/copy/index.md) - [document](https://toxicphreak.github.io/python-docx-ng/api/docx/document/index.md) - [exceptions](https://toxicphreak.github.io/python-docx-ng/api/docx/exceptions/index.md) - [fields](https://toxicphreak.github.io/python-docx-ng/api/docx/fields/index.md) - [footnotes](https://toxicphreak.github.io/python-docx-ng/api/docx/footnotes/index.md) - [formfield](https://toxicphreak.github.io/python-docx-ng/api/docx/formfield/index.md) - [math](https://toxicphreak.github.io/python-docx-ng/api/docx/math/index.md) - [numbering](https://toxicphreak.github.io/python-docx-ng/api/docx/numbering/index.md) - [object](https://toxicphreak.github.io/python-docx-ng/api/docx/object/index.md) - [package](https://toxicphreak.github.io/python-docx-ng/api/docx/package/index.md) - [revisions](https://toxicphreak.github.io/python-docx-ng/api/docx/revisions/index.md) - [sdt](https://toxicphreak.github.io/python-docx-ng/api/docx/sdt/index.md) - [section](https://toxicphreak.github.io/python-docx-ng/api/docx/section/index.md) - [settings](https://toxicphreak.github.io/python-docx-ng/api/docx/settings/index.md) - [shape](https://toxicphreak.github.io/python-docx-ng/api/docx/shape/index.md) - [shared](https://toxicphreak.github.io/python-docx-ng/api/docx/shared/index.md) - [table](https://toxicphreak.github.io/python-docx-ng/api/docx/table/index.md) - [theme](https://toxicphreak.github.io/python-docx-ng/api/docx/theme/index.md) - [types](https://toxicphreak.github.io/python-docx-ng/api/docx/types/index.md) - [watermark](https://toxicphreak.github.io/python-docx-ng/api/docx/watermark/index.md) - [dml](https://toxicphreak.github.io/python-docx-ng/api/docx/dml/index.md) - [color](https://toxicphreak.github.io/python-docx-ng/api/docx/dml/color/index.md) - [drawing](https://toxicphreak.github.io/python-docx-ng/api/docx/drawing/index.md) - [enum](https://toxicphreak.github.io/python-docx-ng/api/docx/enum/index.md) - [base](https://toxicphreak.github.io/python-docx-ng/api/docx/enum/base/index.md) - [dml](https://toxicphreak.github.io/python-docx-ng/api/docx/enum/dml/index.md) - [numbering](https://toxicphreak.github.io/python-docx-ng/api/docx/enum/numbering/index.md) - [revision](https://toxicphreak.github.io/python-docx-ng/api/docx/enum/revision/index.md) - [section](https://toxicphreak.github.io/python-docx-ng/api/docx/enum/section/index.md) - [shape](https://toxicphreak.github.io/python-docx-ng/api/docx/enum/shape/index.md) - [style](https://toxicphreak.github.io/python-docx-ng/api/docx/enum/style/index.md) - [table](https://toxicphreak.github.io/python-docx-ng/api/docx/enum/table/index.md) - [text](https://toxicphreak.github.io/python-docx-ng/api/docx/enum/text/index.md) - [image](https://toxicphreak.github.io/python-docx-ng/api/docx/image/index.md) - [bmp](https://toxicphreak.github.io/python-docx-ng/api/docx/image/bmp/index.md) - [constants](https://toxicphreak.github.io/python-docx-ng/api/docx/image/constants/index.md) - [emf](https://toxicphreak.github.io/python-docx-ng/api/docx/image/emf/index.md) - [exceptions](https://toxicphreak.github.io/python-docx-ng/api/docx/image/exceptions/index.md) - [gif](https://toxicphreak.github.io/python-docx-ng/api/docx/image/gif/index.md) - [helpers](https://toxicphreak.github.io/python-docx-ng/api/docx/image/helpers/index.md) - [image](https://toxicphreak.github.io/python-docx-ng/api/docx/image/image/index.md) - [jpeg](https://toxicphreak.github.io/python-docx-ng/api/docx/image/jpeg/index.md) - [png](https://toxicphreak.github.io/python-docx-ng/api/docx/image/png/index.md) - [svg](https://toxicphreak.github.io/python-docx-ng/api/docx/image/svg/index.md) - [tiff](https://toxicphreak.github.io/python-docx-ng/api/docx/image/tiff/index.md) - [webp](https://toxicphreak.github.io/python-docx-ng/api/docx/image/webp/index.md) - [wmf](https://toxicphreak.github.io/python-docx-ng/api/docx/image/wmf/index.md) - [opc](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/index.md) - [constants](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/constants/index.md) - [coreprops](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/coreprops/index.md) - [customprops](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/customprops/index.md) - [exceptions](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/exceptions/index.md) - [extendedprops](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/extendedprops/index.md) - [oxml](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/oxml/index.md) - [package](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/package/index.md) - [packuri](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/packuri/index.md) - [part](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/part/index.md) - [phys_pkg](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/phys_pkg/index.md) - [pkgreader](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/pkgreader/index.md) - [pkgwriter](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/pkgwriter/index.md) - [rel](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/rel/index.md) - [shared](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/shared/index.md) - [spec](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/spec/index.md) - [parts](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/parts/index.md) - [coreprops](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/parts/coreprops/index.md) - [custom_xml](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/parts/custom_xml/index.md) - [customprops](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/parts/customprops/index.md) - [extendedprops](https://toxicphreak.github.io/python-docx-ng/api/docx/opc/parts/extendedprops/index.md) - [oxml](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/index.md) - [bookmark](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/bookmark/index.md) - [comments](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/comments/index.md) - [coreprops](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/coreprops/index.md) - [customprops](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/customprops/index.md) - [customxml](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/customxml/index.md) - [deletion](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/deletion/index.md) - [document](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/document/index.md) - [drawing](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/drawing/index.md) - [exceptions](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/exceptions/index.md) - [extendedprops](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/extendedprops/index.md) - [footnotes](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/footnotes/index.md) - [math](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/math/index.md) - [ns](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/ns/index.md) - [numbering](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/numbering/index.md) - [object](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/object/index.md) - [parser](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/parser/index.md) - [revision](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/revision/index.md) - [sdt](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/sdt/index.md) - [section](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/section/index.md) - [settings](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/settings/index.md) - [shape](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/shape/index.md) - [shared](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/shared/index.md) - [simpletypes](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/simpletypes/index.md) - [styles](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/styles/index.md) - [table](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/table/index.md) - [theme](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/theme/index.md) - [xmlchemy](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/xmlchemy/index.md) - [text](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/text/index.md) - [font](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/text/font/index.md) - [form](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/text/form/index.md) - [hyperlink](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/text/hyperlink/index.md) - [isolate](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/text/isolate/index.md) - [pagebreak](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/text/pagebreak/index.md) - [paragraph](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/text/paragraph/index.md) - [parfmt](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/text/parfmt/index.md) - [run](https://toxicphreak.github.io/python-docx-ng/api/docx/oxml/text/run/index.md) - [parts](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/index.md) - [altchunk](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/altchunk/index.md) - [comments](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/comments/index.md) - [document](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/document/index.md) - [endnotes](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/endnotes/index.md) - [footnotes](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/footnotes/index.md) - [hdrftr](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/hdrftr/index.md) - [image](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/image/index.md) - [numbering](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/numbering/index.md) - [settings](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/settings/index.md) - [story](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/story/index.md) - [styles](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/styles/index.md) - [theme](https://toxicphreak.github.io/python-docx-ng/api/docx/parts/theme/index.md) - [styles](https://toxicphreak.github.io/python-docx-ng/api/docx/styles/index.md) - [copy](https://toxicphreak.github.io/python-docx-ng/api/docx/styles/copy/index.md) - [latent](https://toxicphreak.github.io/python-docx-ng/api/docx/styles/latent/index.md) - [style](https://toxicphreak.github.io/python-docx-ng/api/docx/styles/style/index.md) - [styles](https://toxicphreak.github.io/python-docx-ng/api/docx/styles/styles/index.md) - [transfer](https://toxicphreak.github.io/python-docx-ng/api/docx/styles/transfer/index.md) - [usage](https://toxicphreak.github.io/python-docx-ng/api/docx/styles/usage/index.md) - [text](https://toxicphreak.github.io/python-docx-ng/api/docx/text/index.md) - [font](https://toxicphreak.github.io/python-docx-ng/api/docx/text/font/index.md) - [hyperlink](https://toxicphreak.github.io/python-docx-ng/api/docx/text/hyperlink/index.md) - [pagebreak](https://toxicphreak.github.io/python-docx-ng/api/docx/text/pagebreak/index.md) - [paragraph](https://toxicphreak.github.io/python-docx-ng/api/docx/text/paragraph/index.md) - [parfmt](https://toxicphreak.github.io/python-docx-ng/api/docx/text/parfmt/index.md) - [run](https://toxicphreak.github.io/python-docx-ng/api/docx/text/run/index.md) - [search](https://toxicphreak.github.io/python-docx-ng/api/docx/text/search/index.md) - [tabstops](https://toxicphreak.github.io/python-docx-ng/api/docx/text/tabstops/index.md)