docx package¶
Subpackages¶
- docx.enum package
- Submodules
- docx.enum.ListStyle module
- docx.enum.color module
- docx.enum.font_style module
- docx.enum.schemas module
- docx.enum.underline_style module
UnderlineStyle
UnderlineStyle.DASH
UnderlineStyle.DASH_HEAVY
UnderlineStyle.DASH_LONG
UnderlineStyle.DASH_LONG_HEAVY
UnderlineStyle.DOTTED
UnderlineStyle.DOTTED_HEAVY
UnderlineStyle.DOT_DASH
UnderlineStyle.DOT_DASH_HEAVY
UnderlineStyle.DOT_DOT_DASH
UnderlineStyle.DOT_DOT_DASH_HEAVY
UnderlineStyle.DOUBLE
UnderlineStyle.NONE
UnderlineStyle.SINGLE
UnderlineStyle.THICK
UnderlineStyle.WAVY
UnderlineStyle.WAVY_DOUBLE
UnderlineStyle.WAVY_HEAVY
UnderlineStyle.WORDS
- Module contents
Submodules¶
docx.docx_redactor module¶
docx.xml_redactor module¶
- class docx.xml_redactor.XMLRedactor(path: str)[source]¶
Bases:
object
For correct work this class you should edit xml.etree.ElementTree replace 862 line on : “return qnames, _namespace_map” Else DOCX-file after editing will contain wrong namespace
- add_new_abstract_and_num(list_style: bool = True, levels_count: int = 1, bullet_symbol: str = '•', custom_ilvl_marking: Dict[int, Tuple[int, int]] | None = None) int [source]¶
This function added new abstractNum and num list_style – True: decimal, False: bullet Return id of new Num-object
- delete_comment_by_id(comment_id: int | str)[source]¶
- Parameters:
comment_id – id of comment, that should be deleted
- edit_comment_by_id(comment_id: int | str, comment_text: str, new_author: str | None = None)[source]¶
- Parameters:
comment_id – id of comment, that should be edited
comment_text – new text of comment
new_author – new author of comment
- edit_list_style_by_paraIds(paraIds: List[str] | str, new_num: str | int)[source]¶
Replace the numId to newNum of all specified paragraphs :param paraIds: One or many paraIds, which we replace numId :param new_num: New numId :return: None