本文由 大侠(AhcaoZhu)原创,转载请声明。
链接: https://blog.csdn.net/Ahcao2008

一图看懂 docx 读取、查询、修改 Ms Word docx 文件, 资料整理+笔记(大全)

  • 摘要
  • 模块
  • 类的关系图
  • 模块全展开
  • 统计
  • 【docx】
  • 常量
  • 模块
    • 1 docx.opc
    • 2 docx.compat
    • 3 docx.shared
    • 4 docx.image
    • 5 docx.exceptions
    • 6 docx.enum
    • 7 docx.oxml
    • 8 docx.parts
    • 9 docx.package
    • 10 docx.api
    • 11 docx.text
    • 12 docx.dml
    • 13 docx.shape
    • 14 docx.blkcntnr
    • 15 docx.section
    • 16 docx.document
    • 17 docx.settings
    • 18 docx.styles
    • 19 docx.table
  • 函数
    • 20 Document(docx=None)
    • 21 docx.opc.constants.RELATIONSHIP_TYPE
      • data
    • 22 docx.parts.image.ImagePart
      • property
      • class method
      • 6 from_image()
      • 7 load()
  • 统计
  • 【docx.opc】
  • 模块
    • 1 docx.opc.constants
    • 2 docx.opc.packuri
    • 3 docx.opc.compat
    • 4 docx.opc.oxml
    • 5 docx.opc.rel
    • 6 docx.opc.shared
    • 7 docx.opc.part
    • 8 docx.opc.parts
    • 9 docx.opc.coreprops
    • 10 docx.opc.exceptions
    • 11 docx.opc.phys_pkg
    • 12 docx.opc.pkgreader
    • 13 docx.opc.spec
    • 14 docx.opc.pkgwriter
    • 15 docx.opc.package
  • 统计
  • 【docx.compat】
  • 模块
    • 1 sys
  • 函数
    • 2 is_string(obj)
    • 3 collections.abc.Sequence
      • method
      • 1 count()
      • 2 index()
    • 4 _io.BytesIO
      • data
      • method
      • 2 close(self, *args, **kwargs)
      • 3 flush(self, *args, **kwargs)
      • 4 getbuffer(self, *args, **kwargs)
      • 5 getvalue(self, *args, **kwargs)
      • 6 isatty(self, *args, **kwargs)
      • 7 read(self, *args, **kwargs)
      • 8 read1(self, *args, **kwargs)
      • 9 readable(self, *args, **kwargs)
      • 10 readinto(self, *args, **kwargs)
      • 11 readline(self, *args, **kwargs)
      • 12 readlines(self, *args, **kwargs)
      • 13 seek(self, *args, **kwargs)
      • 14 seekable(self, *args, **kwargs)
      • 15 tell(self, *args, **kwargs)
      • 16 truncate(self, *args, **kwargs)
      • 17 writable(self, *args, **kwargs)
      • 18 write(self, *args, **kwargs)
      • 19 writelines(self, *args, **kwargs)
    • 5 str
      • method
      • 1 capitalize()
      • 2 casefold()
      • 3 center()
      • 4 count()
      • 5 encode()
      • 6 endswith()
      • 7 expandtabs()
      • 8 find()
      • 9 format()
      • 10 format_map()
      • 11 index()
      • 12 isalnum()
      • 13 isalpha()
      • 14 isascii()
      • 15 isdecimal()
      • 16 isdigit()
      • 17 isidentifier()
      • 18 islower()
      • 19 isnumeric()
      • 20 isprintable()
      • 21 isspace()
      • 22 istitle()
      • 23 isupper()
      • 24 join()
      • 25 ljust()
      • 26 lower()
      • 27 lstrip()
      • 28 partition()
      • 29 replace()
      • 30 rfind()
      • 31 rindex()
      • 32 rjust()
      • 33 rpartition()
      • 34 rsplit()
      • 35 rstrip()
      • 36 split()
      • 37 splitlines()
      • 38 startswith()
      • 39 strip()
      • 40 swapcase()
      • 41 title()
      • 42 translate()
      • 43 upper()
      • 44 zfill()
      • static method
      • 45 maketrans()
  • 剩余
  • 统计
  • 【docx.shared】
  • 函数
    • 1 lazyproperty(f)
    • 2 write_only_property(f)
    • 3 docx.shared.Length
      • property
    • 4 docx.shared.Inches
    • 5 docx.shared.Cm
    • 6 docx.shared.Emu
    • 7 docx.shared.Mm
    • 8 docx.shared.Pt
    • 9 docx.shared.Twips
    • 10 docx.shared.RGBColor
      • class method
      • 1 from_string()
    • 11 docx.shared.ElementProxy
      • property
    • 12 docx.shared.Parented
      • property
  • 剩余
  • 统计
  • 【docx.image】
  • 常量
    • tuple
  • 模块
    • 2 docx.image.constants
    • 3 docx.image.exceptions
    • 4 docx.image.helpers
    • 5 docx.image.image
    • 6 docx.image.bmp
    • 7 docx.image.gif
    • 8 docx.image.tiff
    • 9 docx.image.jpeg
    • 10 docx.image.png
    • 11 docx.image.bmp.Bmp
      • property
      • class method
      • 3 from_stream()
    • 12 docx.image.gif.Gif
      • property
      • class method
      • 3 from_stream()
    • 13 docx.image.jpeg.Exif
      • class method
      • 1 from_stream()
    • 14 docx.image.jpeg.Jfif
      • class method
      • 1 from_stream()
    • 15 docx.image.png.Png
      • property
      • class method
      • 3 from_stream()
    • 16 docx.image.tiff.Tiff
      • property
      • class method
      • 3 from_stream()
  • 剩余
  • 统计
  • 【docx.exceptions】
    • 1 docx.exceptions.PythonDocxError
    • 2 docx.exceptions.InvalidSpanError
    • 3 docx.exceptions.InvalidXmlError
  • 统计
  • 【docx.enum】
  • 模块
    • 1 docx.enum.base
    • 2 docx.enum.section
    • 3 docx.enum.style
    • 4 docx.enum.table
    • 5 docx.enum.dml
    • 6 docx.enum.text
    • 7 docx.enum.shape
    • 8 docx.enum.Enumeration
      • class method
      • 1 from_xml()
      • 2 to_xml()
  • 剩余
  • 统计
  • 【docx.oxml】
  • 常量
    • dict
  • 模块
    • 2 lxml.etree
    • 3 docx.oxml.ns
    • 4 docx.oxml.simpletypes
    • 5 docx.oxml.exceptions
    • 6 docx.oxml.xmlchemy
    • 7 docx.oxml.shared
    • 8 docx.oxml.coreprops
    • 9 docx.oxml.document
    • 10 docx.oxml.numbering
    • 11 docx.oxml.section
    • 12 docx.oxml.settings
    • 13 docx.oxml.shape
    • 14 docx.oxml.styles
    • 15 docx.oxml.table
    • 16 docx.oxml.text
  • 函数
    • 17 parse_xml(xml)
    • 18 register_element_cls(tag, cls)
    • 19 OxmlElement(nsptag_str, attrs=None, nsdecls=None)
    • 20 docx.oxml.ns.NamespacePrefixedTag
      • property
      • class method
      • 6 from_clark_name()
    • 21 docx.oxml.shared.CT_DecimalNumber
      • property
      • class method
      • 2 new()
    • 22 docx.oxml.shared.CT_OnOff
      • property
    • 23 docx.oxml.shared.CT_String
      • property
      • class method
      • 2 new()
    • 24 docx.oxml.coreprops.CT_CoreProperties
      • property
      • method
      • 31 get_or_add_category()
      • 32 get_or_add_contentStatus()
      • 33 get_or_add_created()
      • 34 get_or_add_creator()
      • 35 get_or_add_description()
      • 36 get_or_add_identifier()
      • 37 get_or_add_keywords()
      • 38 get_or_add_language()
      • 39 get_or_add_lastModifiedBy()
      • 40 get_or_add_lastPrinted()
      • 41 get_or_add_modified()
      • 42 get_or_add_revision()
      • 43 get_or_add_subject()
      • 44 get_or_add_title()
      • 45 get_or_add_version()
      • class method
      • 46 new()
    • 25 docx.oxml.document.CT_Body
      • property
      • method
      • 4 add_p()
      • 5 add_section_break()
      • 6 add_tbl()
      • 7 clear_content()
      • 8 get_or_add_sectPr()
    • 26 docx.oxml.document.CT_Document
      • property
      • method
      • 3 get_or_add_body()
    • 27 docx.oxml.numbering.CT_Num
      • property
      • method
      • 4 add_lvlOverride()
      • class method
      • 5 new()
    • 28 docx.oxml.numbering.CT_Numbering
      • property
      • method
      • 2 add_num()
      • 3 num_having_numId()
    • 29 docx.oxml.numbering.CT_NumLvl
      • property
      • method
      • 3 add_startOverride()
      • 4 get_or_add_startOverride()
    • 30 docx.oxml.numbering.CT_NumPr
      • property
      • method
      • 3 get_or_add_ilvl()
      • 4 get_or_add_numId()
    • 31 docx.oxml.section.CT_HdrFtr
      • property
      • method
      • 3 add_p()
      • 4 add_tbl()
    • 32 docx.oxml.section.CT_HdrFtrRef
      • property
    • 33 docx.oxml.section.CT_PageMar
      • property
    • 34 docx.oxml.section.CT_PageSz
      • property
    • 35 docx.oxml.section.CT_SectPr
      • property
      • method
      • 20 add_footerReference()
      • 21 add_headerReference()
      • 22 clone()
      • 23 get_footerReference()
      • 24 get_headerReference()
      • 25 get_or_add_pgMar()
      • 26 get_or_add_pgSz()
      • 27 get_or_add_titlePg()
      • 28 get_or_add_type()
      • 29 remove_footerReference()
      • 30 remove_headerReference()
    • 36 docx.oxml.section.CT_SectType
      • property
    • 37 docx.oxml.settings.CT_Settings
      • property
      • method
      • 3 get_or_add_evenAndOddHeaders()
    • 38 docx.oxml.shape.CT_Blip
      • property
    • 39 docx.oxml.shape.CT_BlipFillProperties
      • property
      • method
      • 2 get_or_add_blip()
    • 40 docx.oxml.shape.CT_GraphicalObject
      • property
    • 41 docx.oxml.shape.CT_GraphicalObjectData
      • property
      • method
      • 3 get_or_add_pic()
    • 42 docx.oxml.shape.CT_Inline
      • property
      • class method
      • 4 new()
      • 5 new_pic_inline()
    • 43 docx.oxml.shape.CT_NonVisualDrawingProps
      • property
    • 44 docx.oxml.shape.CT_Picture
      • property
      • class method
      • 4 new()
    • 45 docx.oxml.shape.CT_PictureNonVisual
      • property
    • 46 docx.oxml.shape.CT_Point2D
      • property
    • 47 docx.oxml.shape.CT_PositiveSize2D
      • property
    • 48 docx.oxml.shape.CT_ShapeProperties
      • property
      • method
      • 4 get_or_add_xfrm()
    • 49 docx.oxml.shape.CT_Transform2D
      • property
      • method
      • 5 get_or_add_ext()
      • 6 get_or_add_off()
    • 50 docx.oxml.styles.CT_LatentStyles
      • property
      • method
      • 8 add_lsdException()
      • 9 bool_prop()
      • 10 get_by_name()
      • 11 set_bool_prop()
    • 51 docx.oxml.styles.CT_LsdException
      • property
      • method
      • 7 delete()
      • 8 on_off_prop()
      • 9 set_on_off_prop()
    • 52 docx.oxml.styles.CT_Style
      • property
      • method
      • 24 delete()
      • 25 get_or_add_basedOn()
      • 26 get_or_add_locked()
      • 27 get_or_add_name()
      • 28 get_or_add_next()
      • 29 get_or_add_pPr()
      • 30 get_or_add_qFormat()
      • 31 get_or_add_rPr()
      • 32 get_or_add_semiHidden()
      • 33 get_or_add_uiPriority()
      • 34 get_or_add_unhideWhenUsed()
    • 53 docx.oxml.styles.CT_Styles
      • property
      • method
      • 3 add_style()
      • 4 add_style_of_type()
      • 5 default_for()
      • 6 get_by_id()
      • 7 get_by_name()
      • 8 get_or_add_latentStyles()
    • 54 docx.oxml.table.CT_Height
      • property
    • 55 docx.oxml.table.CT_Row
      • property
      • method
      • 7 add_tc()
      • 8 get_or_add_tblPrEx()
      • 9 get_or_add_trPr()
      • 10 tc_at_grid_col()
    • 56 docx.oxml.table.CT_Tbl
      • property
      • method
      • 7 add_tr()
      • 8 iter_tcs()
      • class method
      • 9 new_tbl()
    • 57 docx.oxml.table.CT_TblGrid
      • property
      • method
      • 2 add_gridCol()
    • 58 docx.oxml.table.CT_TblGridCol
      • property
    • 59 docx.oxml.table.CT_TblLayoutType
      • property
    • 60 docx.oxml.table.CT_TblPr
      • property
      • method
      • 8 get_or_add_bidiVisual()
      • 9 get_or_add_jc()
      • 10 get_or_add_tblLayout()
      • 11 get_or_add_tblStyle()
    • 61 docx.oxml.table.CT_TblWidth
      • property
    • 62 docx.oxml.table.CT_Tc
      • property
      • method
      • 11 add_p()
      • 12 add_tbl()
      • 13 clear_content()
      • 14 get_or_add_tcPr()
      • 15 iter_block_items()
      • 16 merge()
      • class method
      • 17 new()
    • 63 docx.oxml.table.CT_TcPr
      • property
      • method
      • 9 get_or_add_gridSpan()
      • 10 get_or_add_tcW()
      • 11 get_or_add_vAlign()
      • 12 get_or_add_vMerge()
    • 64 docx.oxml.table.CT_TrPr
      • property
      • method
      • 4 get_or_add_trHeight()
    • 65 docx.oxml.table.CT_VMerge
      • property
    • 66 docx.oxml.table.CT_VerticalJc
      • property
    • 67 docx.oxml.text.font.CT_Color
      • property
    • 68 docx.oxml.text.font.CT_Fonts
      • property
    • 69 docx.oxml.text.font.CT_Highlight
      • property
    • 70 docx.oxml.text.font.CT_HpsMeasure
      • property
    • 71 docx.oxml.text.font.CT_RPr
      • property
      • method
      • 36 get_or_add_b()
      • 37 get_or_add_bCs()
      • 38 get_or_add_caps()
      • 39 get_or_add_color()
      • 40 get_or_add_cs()
      • 41 get_or_add_dstrike()
      • 42 get_or_add_emboss()
      • 43 get_or_add_highlight()
      • 44 get_or_add_i()
      • 45 get_or_add_iCs()
      • 46 get_or_add_imprint()
      • 47 get_or_add_noProof()
      • 48 get_or_add_oMath()
      • 49 get_or_add_outline()
      • 50 get_or_add_rFonts()
      • 51 get_or_add_rStyle()
      • 52 get_or_add_rtl()
      • 53 get_or_add_shadow()
      • 54 get_or_add_smallCaps()
      • 55 get_or_add_snapToGrid()
      • 56 get_or_add_specVanish()
      • 57 get_or_add_strike()
      • 58 get_or_add_sz()
      • 59 get_or_add_u()
      • 60 get_or_add_vanish()
      • 61 get_or_add_vertAlign()
      • 62 get_or_add_webHidden()
    • 72 docx.oxml.text.font.CT_Underline
      • property
    • 73 docx.oxml.text.font.CT_VerticalAlignRun
      • property
    • 74 docx.oxml.text.paragraph.CT_P
      • property
      • method
      • 5 add_p_before()
      • 6 add_r()
      • 7 clear_content()
      • 8 get_or_add_pPr()
      • 9 set_sectPr()
    • 75 docx.oxml.text.parfmt.CT_Ind
      • property
    • 76 docx.oxml.text.parfmt.CT_Jc
      • property
    • 77 docx.oxml.text.parfmt.CT_PPr
      • property
      • method
      • 25 get_or_add_ind()
      • 26 get_or_add_jc()
      • 27 get_or_add_keepLines()
      • 28 get_or_add_keepNext()
      • 29 get_or_add_numPr()
      • 30 get_or_add_pStyle()
      • 31 get_or_add_pageBreakBefore()
      • 32 get_or_add_sectPr()
      • 33 get_or_add_spacing()
      • 34 get_or_add_tabs()
      • 35 get_or_add_widowControl()
    • 78 docx.oxml.text.parfmt.CT_Spacing
      • property
    • 79 docx.oxml.text.parfmt.CT_TabStop
      • property
    • 80 docx.oxml.text.parfmt.CT_TabStops
      • property
      • method
      • 2 add_tab()
      • 3 insert_tab_in_order()
    • 81 docx.oxml.text.run.CT_Br
      • property
    • 82 docx.oxml.text.run.CT_R
      • property
      • method
      • 9 add_br()
      • 10 add_cr()
      • 11 add_drawing()
      • 12 add_t()
      • 13 add_tab()
      • 14 clear_content()
      • 15 get_or_add_rPr()
    • 83 docx.oxml.text.run.CT_Text
  • 剩余
  • 统计
  • 【docx.parts】
  • 常量
  • 模块
    • 1 docx.parts.image
    • 2 docx.parts.story
    • 3 docx.parts.hdrftr
    • 4 docx.parts.numbering
    • 5 docx.parts.settings
    • 6 docx.parts.styles
    • 7 docx.parts.document
  • 统计
  • 【docx.package】
  • 函数
    • 1 lazyproperty(f)
    • 2 docx.image.image.Image
      • property
      • method
      • 12 scaled_dimensions()
      • class method
      • 13 from_blob()
      • 14 from_file()
    • 3 docx.opc.constants.RELATIONSHIP_TYPE
      • data
    • 4 docx.opc.package.OpcPackage
      • property
      • method
      • 5 after_unmarshal()
      • 6 iter_parts()
      • 7 iter_rels()
      • 8 load_rel()
      • 9 next_partname()
      • 10 part_related_by()
      • 11 relate_to()
      • 12 save()
      • class method
      • 13 open()
    • 5 docx.opc.packuri.PackURI
      • property
      • method
      • 7 relative_ref()
      • static method
      • 8 from_rel_ref()
    • 6 docx.parts.image.ImagePart
      • property
      • class method
      • 6 from_image()
      • 7 load()
    • 7 docx.package.Package
      • property
      • method
      • 2 after_unmarshal()
      • 3 get_or_add_image_part()
    • 8 docx.package.ImageParts
      • method
      • 1 append()
      • 2 get_or_add_image_part()
  • 剩余
  • 统计
  • 【docx.api】
  • 模块
    • 1 os
  • 函数
    • 2 Document(docx=None)
    • 3 _default_docx_path()
    • 4 docx.opc.constants.CONTENT_TYPE
      • data
    • 5 docx.package.Package
      • property
      • method
      • 2 after_unmarshal()
      • 3 get_or_add_image_part()
  • 私有或局部
  • 剩余
  • 统计
  • 【docx.text】
  • 模块
    • 1 docx.text.tabstops
    • 2 docx.text.parfmt
    • 3 docx.text.font
    • 4 docx.text.run
    • 5 docx.text.paragraph
  • 统计
  • 【docx.dml】
  • 模块
    • 1 docx.dml.color
  • 统计
  • 【docx.shape】
  • 常量
    • dict
    • 2 docx.enum.shape.WD_INLINE_SHAPE_TYPE
      • data
    • 3 docx.shared.Parented
      • property
    • 4 docx.shape.InlineShapes
    • 5 docx.shape.InlineShape
      • property
  • 剩余
  • 统计
  • 【docx.blkcntnr】
    • 1 docx.oxml.table.CT_Tbl
      • property
      • method
      • 7 add_tr()
      • 8 iter_tcs()
      • class method
      • 9 new_tbl()
    • 2 docx.shared.Parented
      • property
    • 3 docx.text.paragraph.Paragraph
      • property
      • method
      • 6 add_run()
      • 7 clear()
      • 8 insert_paragraph_before()
    • 4 docx.blkcntnr.BlockItemContainer
      • property
      • method
      • 3 add_paragraph()
      • 4 add_table()
  • 剩余
  • 统计
  • 【docx.section】
  • 函数
    • 1 lazyproperty(f)
    • 2 docx.blkcntnr.BlockItemContainer
      • property
      • method
      • 3 add_paragraph()
      • 4 add_table()
    • 3 collections.abc.Sequence
      • method
      • 1 count()
      • 2 index()
    • 4 docx.enum.section.WD_HEADER_FOOTER_INDEX
      • data
    • 5 docx.section.Sections
    • 6 docx.section.Section
      • property
    • 7 docx.section._BaseHeaderFooter
      • property
    • 8 docx.section._Footer
    • 9 docx.section._Header
  • 私有或局部
  • 剩余
  • 统计
  • 【docx.document】
  • 常量
    • 1 docx.blkcntnr.BlockItemContainer
      • property
      • method
      • 3 add_paragraph()
      • 4 add_table()
    • 2 docx.enum.section.WD_SECTION_START
      • data
    • 3 docx.enum.text.WD_BREAK_TYPE
      • data
    • 4 docx.section.Section
      • property
    • 5 docx.section.Sections
    • 6 docx.shared.ElementProxy
      • property
    • 7 docx.shared.Emu
    • 8 docx.document.Document
      • property
      • method
      • 9 add_heading()
      • 10 add_page_break()
      • 11 add_paragraph()
      • 12 add_picture()
      • 13 add_section()
      • 14 add_table()
      • 15 save()
    • 9 docx.document._Body
      • method
      • 1 clear_content()
  • 私有或局部
  • 剩余
  • 统计
  • 【docx.settings】
    • 1 docx.shared.ElementProxy
      • property
    • 2 docx.settings.Settings
      • property
  • 剩余
  • 统计
  • 【docx.styles】
  • 模块
    • 1 docx.styles.latent
    • 2 docx.styles.style
    • 3 docx.styles.styles
    • 4 docx.styles.BabelFish
      • data
      • class method
      • 4 internal2ui()
      • 5 ui2internal()
  • 剩余
  • 统计
  • 【docx.table】
  • 函数
    • 1 lazyproperty(f)
    • 2 docx.blkcntnr.BlockItemContainer
      • property
      • method
      • 3 add_paragraph()
      • 4 add_table()
    • 3 docx.enum.style.WD_STYLE_TYPE
      • data
    • 4 docx.oxml.simpletypes.ST_Merge
      • data
    • 5 docx.shared.Inches
    • 6 docx.shared.Parented
      • property
    • 7 docx.table.Table
      • property
      • method
      • 8 add_column()
      • 9 add_row()
      • 10 cell()
      • 11 column_cells()
      • 12 row_cells()
    • 8 docx.table._Cell
      • property
      • method
      • 6 add_paragraph()
      • 7 add_table()
      • 8 merge()
    • 9 docx.table._Column
      • property
    • 10 docx.table._Columns
      • property
    • 11 docx.table._Row
      • property
    • 12 docx.table._Rows
      • property
  • 私有或局部
  • 剩余

摘要

全文介绍系统内置 python- docx 模块、函数、类及类的方法和属性。
它通过代码抓取并经AI智能翻译和人工校对。
是一部不可多得的权威字典类工具书。它是系列集的一部分。后续陆续发布、敬请关注。【原创:AhcaoZhu大侠】

模块

docxdocx.opc◎docx.compatdocx.shareddocx.image◎docx.exceptionsdocx.enum◎docx.oxml◎docx.parts◎docx.packagedocx.apidocx.text◎docx.dml◎docx.shapedocx.blkcntnrdocx.sectiondocx.documentdocx.settingsdocx.styles◎docx.table??◎--package??--需要单独装载

docx - modules

类的关系图

◆object◆BaseException◆Exceptiondocx.exceptions.PythonDocxErrordocx.exceptions.InvalidSpanErrordocx.exceptions.InvalidXmlError◆collections.abc.Container◆collections.abc.Iterable◆collections.abc.Sized◆collections.abc.Collection◆collections.abc.Reversible◆collections.abc.Sequencedocx.section.Sectionsdocx.enum.Enumerationdocx.enum.base.Enumerationdocx.enum.base.XmlEnumerationdocx.enum.section.WD_HEADER_FOOTER_INDEXdocx.enum.section.WD_SECTION_STARTdocx.enum.style.WD_STYLE_TYPEdocx.enum.shape.WD_INLINE_SHAPE_TYPEdocx.enum.text.WD_BREAK_TYPEdocx.image.image.BaseImageHeaderdocx.image.bmp.Bmpdocx.image.gif.Gifdocx.image.jpeg.Jpegdocx.image.jpeg.Exifdocx.image.jpeg.Jfifdocx.image.png.Pngdocx.image.tiff.Tiffdocx.image.image.Imagedocx.opc.constants.CONTENT_TYPEdocx.opc.constants.RELATIONSHIP_TYPEdocx.opc.package.OpcPackagedocx.package.Packagedocx.opc.part.Partdocx.parts.image.ImagePartdocx.oxml.simpletypes.BaseSimpleTypedocx.oxml.simpletypes.BaseStringTypedocx.oxml.simpletypes.BaseStringEnumerationTypedocx.oxml.simpletypes.XsdStringEnumerationdocx.oxml.simpletypes.ST_Mergedocx.package.ImagePartsdocx.section.Sectiondocx.shape.InlineShapedocx.shared.ElementProxydocx.document.Documentdocx.settings.Settingsdocx.shared.Parenteddocx.blkcntnr.BlockItemContainerdocx.document._Bodydocx.section._BaseHeaderFooterdocx.section._Footerdocx.section._Headerdocx.table._Celldocx.shape.InlineShapesdocx.table.Tabledocx.table._Columndocx.table._Columnsdocx.table._Rowdocx.table._Rowsdocx.text.paragraph.Paragraphdocx.styles.BabelFish◆intdocx.shared.Lengthdocx.shared.Cmdocx.shared.Emudocx.shared.Inchesdocx.shared.Mmdocx.shared.Ptdocx.shared.Twips◆lxml.etree._Element◆lxml.etree.ElementBasedocx.oxml.xmlchemy.BaseOxmlElementdocx.oxml.coreprops.CT_CorePropertiesdocx.oxml.document.CT_Bodydocx.oxml.document.CT_Documentdocx.oxml.numbering.CT_Numdocx.oxml.numbering.CT_NumLvldocx.oxml.numbering.CT_NumPrdocx.oxml.numbering.CT_Numberingdocx.oxml.section.CT_HdrFtrdocx.oxml.section.CT_HdrFtrRefdocx.oxml.section.CT_PageMardocx.oxml.section.CT_PageSzdocx.oxml.section.CT_SectPrdocx.oxml.section.CT_SectTypedocx.oxml.settings.CT_Settingsdocx.oxml.shape.CT_Blipdocx.oxml.shape.CT_BlipFillPropertiesdocx.oxml.shape.CT_GraphicalObjectdocx.oxml.shape.CT_GraphicalObjectDatadocx.oxml.shape.CT_Inlinedocx.oxml.shape.CT_NonVisualDrawingPropsdocx.oxml.shape.CT_Picturedocx.oxml.shape.CT_PictureNonVisualdocx.oxml.shape.CT_Point2Ddocx.oxml.shape.CT_PositiveSize2Ddocx.oxml.shape.CT_ShapePropertiesdocx.oxml.shape.CT_Transform2Ddocx.oxml.shared.CT_DecimalNumberdocx.oxml.shared.CT_OnOffdocx.oxml.shared.CT_Stringdocx.oxml.styles.CT_LatentStylesdocx.oxml.styles.CT_LsdExceptiondocx.oxml.styles.CT_Styledocx.oxml.styles.CT_Stylesdocx.oxml.table.CT_Heightdocx.oxml.table.CT_Rowdocx.oxml.table.CT_Tbldocx.oxml.table.CT_TblGriddocx.oxml.table.CT_TblGridColdocx.oxml.table.CT_TblLayoutTypedocx.oxml.table.CT_TblPrdocx.oxml.table.CT_TblWidthdocx.oxml.table.CT_Tcdocx.oxml.table.CT_TcPrdocx.oxml.table.CT_TrPrdocx.oxml.table.CT_VMergedocx.oxml.table.CT_VerticalJcdocx.oxml.text.font.CT_Colordocx.oxml.text.font.CT_Fontsdocx.oxml.text.font.CT_Highlightdocx.oxml.text.font.CT_HpsMeasuredocx.oxml.text.font.CT_RPrdocx.oxml.text.font.CT_Underlinedocx.oxml.text.font.CT_VerticalAlignRundocx.oxml.text.paragraph.CT_Pdocx.oxml.text.parfmt.CT_Inddocx.oxml.text.parfmt.CT_Jcdocx.oxml.text.parfmt.CT_PPrdocx.oxml.text.parfmt.CT_Spacingdocx.oxml.text.parfmt.CT_TabStopdocx.oxml.text.parfmt.CT_TabStopsdocx.oxml.text.run.CT_Brdocx.oxml.text.run.CT_Rdocx.oxml.text.run.CT_Text◆strdocx.opc.packuri.PackURIdocx.oxml.ns.NamespacePrefixedTag◆tupledocx.shared.RGBColor
◆-- External class, not in docx module

模块全展开

统计

序号 类别 数量
4 str 5
6 list 1
8 dict 1
9 module 19
10 class 2
11 function 1
13 residual 3
14 system 10
16 all 32

【docx】

docx, fullname=docx, file=docx_init_.py

常量

模块

1 docx.opc

opc, fullname=docx.opc, file=docx\opc_init_.py

2 docx.compat

compat, fullname=docx.compat, file=docx\compat.py

提供Python 2/3兼容性对象

3 docx.shared

shared, fullname=docx.shared, file=docx\shared.py

docx模块共享的对象。

4 docx.image

image, fullname=docx.image, file=docx\image_init_.py

提供可以根据内容类型和大小来描述图像流的对象,作为在文档中包含它们的必要步骤。

5 docx.exceptions

exceptions, fullname=docx.exceptions, file=docx\exceptions.py

python-docx使用的异常。基异常类是PythonDocxError。

6 docx.enum

enum, fullname=docx.enum, file=docx\enum_init_.py

python-docx中使用的枚举

7 docx.oxml

oxml, fullname=docx.oxml, file=docx\oxml_init_.py

初始化oxml子包,包括注册对应于Open XML元素的自定义元素类。

8 docx.parts

parts, fullname=docx.parts, file=docx\parts_init_.py

9 docx.package

package, fullname=docx.package, file=docx\package.py

Wordprocessing ML Package 包类和相关对象

10 docx.api

api, fullname=docx.api, file=docx\api.py

直接公开API函数和类:func:`Document`。提供一个语法上更方便的API来与OpcPackage图交互。

11 docx.text

text, fullname=docx.text, file=docx\text_init_.py

12 docx.dml

dml, fullname=docx.dml, file=docx\dml_init_.py

13 docx.shape

shape, fullname=docx.shape, file=docx\shape.py

与形状相关的对象,出现在文档的绘图层上的可视对象。

14 docx.blkcntnr

blkcntnr, fullname=docx.blkcntnr, file=docx\blkcntnr.py

块项目容器,用于主体,单元格,标题等。块级项目包括段落和表格,尽管还有其他一些特殊的项目,如结构化文档标记。

15 docx.section

section, fullname=docx.section, file=docx\section.py

|Section|对象和相关的代理类

16 docx.document

document, fullname=docx.document, file=docx\document.py

|Document|及密切相关的对象

17 docx.settings

settings, fullname=docx.settings, file=docx\settings.py

对象,提供对文档级设置的访问

18 docx.styles

styles, fullname=docx.styles, file=docx\styles_init_.py

docx的子包模块,样式子包docx.styles。

19 docx.table

table, fullname=docx.table, file=docx\table.py

|Table|对象和相关的代理类。

函数

20 Document(docx=None)

Document(docx=None), module=docx.api, line:17 at site-packages\docx\api.py

返回一个从 *docx* 加载的|Document|对象,其中*docx*可以是一个``.docx`` 文件(字符串)的路径或一个类文件对象。
如果*docx*缺失或“None”,则加载内置的默认文档“template”。

21 docx.opc.constants.RELATIONSHIP_TYPE

RELATIONSHIP_TYPE, docx.opc.constants.RELATIONSHIP_TYPE, module=docx.opc.constants

data

1 AUDIO kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
2 A_F_CHUNK kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
3 CALC_CHAIN kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
4 CERTIFICATE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
5 CHART kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
6 CHARTSHEET kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
7 CHART_USER_SHAPES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
8 COMMENTS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
9 COMMENT_AUTHORS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
10 CONNECTIONS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
11 CONTROL kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
12 CORE_PROPERTIES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
13 CUSTOM_PROPERTIES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
14 CUSTOM_PROPERTY kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
15 CUSTOM_XML kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
16 CUSTOM_XML_PROPS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
17 DIAGRAM_COLORS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
18 DIAGRAM_DATA kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
19 DIAGRAM_LAYOUT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
20 DIAGRAM_QUICK_STYLE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
21 DIALOGSHEET kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
22 DRAWING kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
23 ENDNOTES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
24 EXTENDED_PROPERTIES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
25 EXTERNAL_LINK kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
26 FONT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
27 FONT_TABLE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
28 FOOTER kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
29 FOOTNOTES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
30 GLOSSARY_DOCUMENT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
31 HANDOUT_MASTER kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
32 HEADER kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
33 HYPERLINK kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
34 IMAGE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
35 NOTES_MASTER kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
36 NOTES_SLIDE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
37 NUMBERING kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
38 OFFICE_DOCUMENT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
39 OLE_OBJECT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
40 ORIGIN kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
41 PACKAGE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
42 PIVOT_CACHE_DEFINITION kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
43 PIVOT_CACHE_RECORDS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
44 PIVOT_TABLE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
45 PRES_PROPS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
46 PRINTER_SETTINGS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
47 QUERY_TABLE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
48 REVISION_HEADERS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
49 REVISION_LOG kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
50 SETTINGS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
51 SHARED_STRINGS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
52 SHEET_METADATA kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
53 SIGNATURE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
54 SLIDE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
55 SLIDE_LAYOUT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
56 SLIDE_MASTER kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
57 SLIDE_UPDATE_INFO kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
58 STYLES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
59 TABLE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
60 TABLE_SINGLE_CELLS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
61 TABLE_STYLES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
62 TAGS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
63 THEME kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
64 THEME_OVERRIDE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
65 THUMBNAIL kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
66 USERNAMES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
67 VIDEO kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
68 VIEW_PROPS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
69 VML_DRAWING kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
70 VOLATILE_DEPENDENCIES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
71 WEB_SETTINGS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
72 WORKSHEET_SOURCE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
73 XML_MAPS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>

22 docx.parts.image.ImagePart

ImagePart, docx.parts.image.ImagePart, module=docx.parts.image

图像部分。对应关系的目标部分,类型为 RELATIONSHIP_TYPE.IMAGE。

property

1 default_cx=<property object at 0x0000000003B5D1D8> kind:property type:property class:<class ‘docx.parts.image.ImagePart’>
2 default_cy=<property object at 0x0000000003B5D228> kind:property type:property class:<class ‘docx.parts.image.ImagePart’>
3 filename=<property object at 0x0000000003B5D278> kind:property type:property class:<class ‘docx.parts.image.ImagePart’>
4 image=<property object at 0x0000000003B5D2C8> kind:property type:property class:<class ‘docx.parts.image.ImagePart’>
5 sha1=<property object at 0x0000000003B5D318> kind:property type:property class:<class ‘docx.parts.image.ImagePart’>

class method

6 from_image()

kind=class method class=ImagePart objtype=classmethod

classmethod(function) -> method
转换函数为类方法。
类方法接收类作为隐式的第一个参数,就像实例方法接收实例一样。
要声明一个类方法,请使用这个习惯用法:
它可以在类上(例如C.f())或在实例上(例如C().f())被调用。除了它的类,实例将被忽略。
如果为派生类调用类方法,则派生类对象将作为隐含的第一个参数传递。类方法不同于c++或Java的静态方法。
如果你想要这些,请查看内置的staticmethod。

7 load()

kind=class method class=ImagePart objtype=classmethod

统计

序号 类别 数量
4 str 4
6 list 1
8 dict 1
9 module 15
13 residual 3
14 system 9
16 all 24

【docx.opc】

opc, fullname=docx.opc, file=docx\opc_init_.py

模块

1 docx.opc.constants

constants, fullname=docx.opc.constants, file=docx\opc\constants.py

与开放包装公约相关的常量值,特别是内容类型和关系类型。

2 docx.opc.packuri

packuri, fullname=docx.opc.packuri, file=docx\opc\packuri.py

提供PackURI值类型以及一些有用的已知包URI字符串,如 PACKAGE_URI。

3 docx.opc.compat

compat, fullname=docx.opc.compat, file=docx\opc\compat.py

提供Python 2/3兼容性对象

4 docx.opc.oxml

oxml, fullname=docx.opc.oxml, file=docx\opc\oxml.py

PackageReader移植时遇到的主要oxml模块的临时替代品。
可能大部分内容将被来自pptx.oxml.core的对象替换,然后这个模块要么被删除,要么只保存包相关的自定义元素类。

5 docx.opc.rel

rel, fullname=docx.opc.rel, file=docx\opc\rel.py

Relationship-related对象。

6 docx.opc.shared

shared, fullname=docx.opc.shared, file=docx\opc\shared.py

opc模块共享的对象。

7 docx.opc.part

part, fullname=docx.opc.part, file=docx\opc\part.py

与包装部件相关的OPC (Open Packaging Convention)对象。

8 docx.opc.parts

parts, fullname=docx.opc.parts, file=docx\opc\parts_init_.py

9 docx.opc.coreprops

coreprops, fullname=docx.opc.coreprops, file=docx\opc\coreprops.py

:mod:`pptx.packaging` 模块围绕着从.pptx文件中读取和写入演示文稿的关注点。

10 docx.opc.exceptions

exceptions, fullname=docx.opc.exceptions, file=docx\opc\exceptions.py

python-opc特有的异常基异常类是OpcError。

11 docx.opc.phys_pkg

phys_pkg, fullname=docx.opc.phys_pkg, file=docx\opc\phys_pkg.py

提供一个 *physical* OPC包的通用接口,例如zip文件。

12 docx.opc.pkgreader

pkgreader, fullname=docx.opc.pkgreader, file=docx\opc\pkgreader.py

为序列化的开放打包约定(OPC)包提供低级的只读API。
OPC——Open Packaging Convention——开放打包约定

13 docx.opc.spec

spec, fullname=docx.opc.spec, file=docx\opc\spec.py

提供包含开放XML规范ISO/IEC 29500方面的映射。

14 docx.opc.pkgwriter

pkgwriter, fullname=docx.opc.pkgwriter, file=docx\opc\pkgwriter.py

为序列化的开放打包约定(OPC)包提供一个低级的、只写的API,本质上是OpcPackage.save()的实现。

15 docx.opc.package

package, fullname=docx.opc.package, file=docx\opc\package.py

实现读写OPC包的对象。

统计

序号 类别 数量
4 str 5
8 dict 1
9 module 1
10 class 3
11 function 1
13 residual 6
14 system 8
16 all 17

【docx.compat】

compat, fullname=docx.compat, file=docx\compat.py

提供Python 2/3兼容性对象

模块

1 sys

sys, fullname=sys, file=

这个模块提供了对解释器使用或维护的一些对象的访问,以及对与解释器强烈交互的函数的访问。
参见:sys 模块。

函数

2 is_string(obj)

is_string(obj), module=docx.compat, line:20 at site-packages\docx\compat.py

如果*obj*是字符串则返回True,否则返回False。

3 collections.abc.Sequence

Sequence, collections.abc.Sequence, module=collections.abc, line:-1 at collections\abc.py

对只读序列的所有操作。具体的子类必须重写 __new__ 或 __init__, __getitem__, 和 __len__.

method

1 count()

kind=method class=Sequence objtype=function

S.count(value) -> integer -返回值的出现次数

2 index()

kind=method class=Sequence objtype=function

S.index(value, [start, [stop]]) -> integer -返回值的第一个索引。
如果值不存在则引发ValueError。支持start和stop参数是可选的,但推荐使用。

4 _io.BytesIO

BytesIO, _io.BytesIO, module=_io

使用内存字节缓冲区的缓冲I/O实现。

data

1 closed=<attribute ‘closed’ of ‘_io.BytesIO’ objects> kind:data type:getset_descriptor class:<class ‘_io.BytesIO’>

method

2 close(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:772 at …-1026899380_io.py

禁用所有I/O操作。

3 flush(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:776 at …-1026899380_io.py

什么也不做。

4 getbuffer(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:780 at …-1026899380_io.py

获取BytesIO对象内容的读写视图。

5 getvalue(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:784 at …-1026899380_io.py

检索BytesIO对象的全部内容。

6 isatty(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:788 at …-1026899380_io.py

总是返回False。BytesIO对象没有连接到类似tty的设备。

7 read(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:796 at …-1026899380_io.py

读取最多大小字节,作为bytes对象返回。如果size参数为负,则读取直到到达EOF。在EOF处返回一个空字节对象。

8 read1(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:805 at …-1026899380_io.py

读取最多大小字节,作为bytes对象返回。如果size参数为负或省略,则读取直到到达EOF。在EOF处返回一个空字节对象。

9 readable(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:814 at …-1026899380_io.py

如果IO对象可以读取,则返回True。

10 readinto(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:818 at …-1026899380_io.py

将字节读入缓冲区。返回读取的字节数(EOF为0),如果对象设置为不阻塞且没有数据要读取,则返回None。

11 readline(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:827 at …-1026899380_io.py

文件中的下一行,作为一个字节对象。保留换行符。非负的size参数限制要返回的最大字节数(这时可能返回不完整的行)。在EOF处返回一个空字节对象。

12 readlines(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:837 at …-1026899380_io.py

bytes对象列表,每一行从文件开始。反复调用readline()并返回已读取的行列表。如果给出可选的size参数,则是返回行的总字节数的近似边界。

13 seek(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:847 at …-1026899380_io.py

改变流位置。参见 io 模块。

14 seekable(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:859 at …-1026899380_io.py

如果IO对象可以被查找,则返回True。

15 tell(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:863 at …-1026899380_io.py

参见 io 模块。

16 truncate(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:867 at …-1026899380_io.py

将文件截断为最多字节大小。Size默认为当前文件位置,由tell()返回。当前文件位置不变。返回新的大小。

17 writable(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:876 at …-1026899380_io.py

如果IO对象可以写入,则返回True。

18 write(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:880 at …-1026899380_io.py

将字节写入文件。返回写入的字节数。

19 writelines(self, *args, **kwargs)

kind=method class=BytesIO objtype=method_descriptor line:888 at …-1026899380_io.py

向文件中写入行。注意,没有添加换行符。行可以是任何产生字节类对象的可迭代对象。这相当于为每个元素调用write()。

5 str

str, str, module=builtins

str(object=) -> str str(bytes or buffer[, encoding[, errors]]) -> str
从给定对象中创建一个新的字符串对象。参见:str

method

1 capitalize()

kind=method class=str objtype=method_descriptor

返回字符串的大写版本。更具体地说,使第一个字符大写,其余字符小写。

2 casefold()

kind=method class=str objtype=method_descriptor

返回适合于无大小写比较的字符串版本。

3 center()

kind=method class=str objtype=method_descriptor

返回长度为width的居中字符串。填充使用指定的填充字符(默认为空格)。

4 count()

kind=method class=str objtype=method_descriptor

S.count(sub[, start[, end]]) -> int
返回子字符串sub在字符串S[start:end]中不重叠出现的次数。可选参数start和end被解释为片表示法。

5 encode()

kind=method class=str objtype=method_descriptor

使用为编码注册的编解码器对字符串进行编码。encoding对字符串进行编码的编码。
用于编码错误的错误处理方案。默认值是'strict',这意味着编码错误会引发UnicodeEncodeError。
其他可能的值是'ignore', 'replace'和'xmlcharrefreplace'以及任何其他用编解码器注册的名称。寄存器错误,可以处理UnicodeEncodeErrors。

6 endswith()

kind=method class=str objtype=method_descriptor

S.endswith(suffix[, start[, end]]) -> bool
如果S以指定后缀结束则返回True,否则返回False。使用可选启动,测试S从该位置开始。
使用可选结束,在该位置停止比较S。Suffix也可以是字符串的元组来尝试。

7 expandtabs()

kind=method class=str objtype=method_descriptor

返回一个副本,其中所有制表符都使用空格展开。如果没有给出tabsize,则假定制表符大小为8个字符。

8 find()

kind=method class=str objtype=method_descriptor

S.find(sub[, start[, end]]) -> int
返回S中找到子字符串sub的最低索引,使sub包含在S[start:end]中。可选参数start和end被解释为片表示法。失败时返回-1。

9 format()

kind=method class=str objtype=method_descriptor

S.format(*args, **kwargs) -> str
返回S的格式化版本,使用args和kwargs的替换。替换由大括号('{'和'}')标识。

10 format_map()

kind=method class=str objtype=method_descriptor

S.format map(mapping) -> str
返回S的格式化版本,使用mapping中的替换。替换由大括号('{'和'}')标识。

11 index()

kind=method class=str objtype=method_descriptor

S.index(sub[, start[, end]]) -> int
返回S中子串sub所在位置的最低索引,使sub包含在S[start:end]中。可选参数start和end被解释为片表示法。当子字符串未找到时引发ValueError。

12 isalnum()

kind=method class=str objtype=method_descriptor

如果字符串是字母-数字字符串则返回True,否则返回False。如果字符串中的所有字符都是字母-数字,并且字符串中至少有一个字符,则字符串为字母-数字。

13 isalpha()

kind=method class=str objtype=method_descriptor

如果字符串是字母字符串则返回True,否则返回False。如果字符串中的所有字符都是字母,并且字符串中至少有一个字符,则字符串为字母字符串。

14 isascii()

kind=method class=str objtype=method_descriptor

如果字符串中的所有字符都是ASCII,则返回True,否则返回False。ASCII字符的码位范围为U+0000-U+007F。空字符串也是ASCII。

15 isdecimal()

kind=method class=str objtype=method_descriptor

如果字符串是十进制字符串则返回True,否则返回False。如果字符串中的所有字符都是十进制,并且字符串中至少有一个字符,则字符串是十进制字符串。

16 isdigit()

kind=method class=str objtype=method_descriptor

如果字符串是数字字符串则返回True,否则返回False。如果字符串中的所有字符都是数字,并且字符串中至少有一个字符,则字符串是数字字符串。

17 isidentifier()

kind=method class=str objtype=method_descriptor

如果字符串是有效的Python标识符,则返回True,否则返回False。使用keyword.iskeyword()测试保留的标识符,如“def”和“class”。

18 islower()

kind=method class=str objtype=method_descriptor

如果字符串是小写字符串则返回True,否则返回False。如果字符串中所有的分大小写字符都是小写的,并且字符串中至少有一个分大小写字符,则字符串是小写的。

19 isnumeric()

kind=method class=str objtype=method_descriptor

如果字符串是数字字符串则返回True,否则返回False。如果字符串中的所有字符都是数字,并且字符串中至少有一个字符,则字符串为数字。

20 isprintable()

kind=method class=str objtype=method_descriptor

如果字符串是可打印的返回True,否则返回False。如果一个字符串的所有字符在repr()中都被认为是可打印的,或者字符串为空,则该字符串是可打印的。

21 isspace()

kind=method class=str objtype=method_descriptor

如果字符串是空白字符串则返回True,否则返回False。如果字符串中所有字符都是空白,并且字符串中至少有一个字符,则字符串为空白。

22 istitle()

kind=method class=str objtype=method_descriptor

如果字符串是标题大小写字符串,则返回True,否则返回False。在标题大小写字符串中,大写字符和标题大小写字符只能跟在无大小写字符后面,小写字符只能跟在有大小写字符后面。

23 isupper()

kind=method class=str objtype=method_descriptor

如果字符串是大写字串则返回True,否则返回False。如果字符串中所有的大小写字符都是大写字符,并且字符串中至少有一个大小写字符,则字符串为大写字符。

24 join()

kind=method class=str objtype=method_descriptor

Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'

25 ljust()

kind=method class=str objtype=method_descriptor

返回一个长度为width的左对齐字符串。填充使用指定的填充字符(默认为空格)。

26 lower()

kind=method class=str objtype=method_descriptor

返回一个转换成小写字母的字符串副本。

27 lstrip()

kind=method class=str objtype=method_descriptor

返回删除前导空格的字符串副本。如果给出了chars而不是None,则改为删除chars中的字符。

28 partition()

kind=method class=str objtype=method_descriptor

使用给定的分隔符将字符串分成三部分。这将搜索字符串中的分隔符。如果找到分隔符,则返回一个3元组,其中包含分隔符之前的部分、分隔符本身和分隔符之后的部分。如果分隔符未找到,则返回一个包含原始字符串和两个空字符串的3元组。

29 replace()

kind=method class=str objtype=method_descriptor

返回一个副本,将所有出现的子字符串old替换为new。count最大替换次数。-1(默认值)表示替换所有出现的情况。
如果给出了可选参数count,则只替换第一次出现的计数。

30 rfind()

kind=method class=str objtype=method_descriptor

S.rfind(sub[, start[, end]]) -> int
返回S中子字符串sub所在位置的最高索引,使sub包含在S[start:end]中。可选参数start和end被解释为片表示法。失败时返回-1。

31 rindex()

kind=method class=str objtype=method_descriptor

S.rindex(sub[, start[, end]]) -> int
返回S中子串sub所在位置的最高索引,使sub包含在S[start:end]中。可选参数start和end被解释为片表示法。当子字符串未找到时引发ValueError。

32 rjust()

kind=method class=str objtype=method_descriptor

返回一个长度为width的右对齐字符串。填充使用指定的填充字符(默认为空格)。

33 rpartition()

kind=method class=str objtype=method_descriptor

使用给定的分隔符将字符串分成三部分。这将搜索字符串中的分隔符,从末尾开始。
如果找到分隔符,则返回一个3元组,其中包含分隔符之前的部分、分隔符本身和分隔符之后的部分。如果分隔符未找到,则返回包含两个空字符串和原始字符串的3元组。

34 rsplit()

kind=method class=str objtype=method_descriptor

返回字符串中的单词列表,使用sep作为分隔符字符串。sep分隔符,用于分隔字符串。None(默认值)表示根据任何空白进行分割,并丢弃结果中的空字符串。
maxsplit最大拆分次数。-1(默认值)表示没有限制。劈叉是从弦的末端开始,一直到前面。

35 rstrip()

kind=method class=str objtype=method_descriptor

返回一个删除了尾随空格的字符串副本。如果给出了chars而不是None,则改为删除chars中的字符。

36 split()

kind=method class=str objtype=method_descriptor

返回字符串中的单词列表,使用sep作为分隔符字符串。sep分隔符,用于分隔字符串。
None(默认值)表示根据任何空白进行分割,并丢弃结果中的空字符串。maxsplit最大拆分次数。-1(默认值)表示没有限制。

37 splitlines()

kind=method class=str objtype=method_descriptor

返回字符串中的行列表,在行边界处断行。结果列表中不包括换行符,除非给出keepends并为true。

38 startswith()

kind=method class=str objtype=method_descriptor

S.startswith(prefix[, start[, end]]) -> bool
如果S以指定的前缀开始返回True,否则返回False。使用可选启动,测试S从该位置开始。使用可选结束,在该位置停止比较S。前缀也可以是字符串的元组来尝试。

39 strip()

kind=method class=str objtype=method_descriptor

返回删除前导和尾随空格的字符串副本。如果给出了chars而不是None,则改为删除chars中的字符。

40 swapcase()

kind=method class=str objtype=method_descriptor

将大写字符转换为小写字符,将小写字符转换为大写字符。

41 title()

kind=method class=str objtype=method_descriptor

返回字符串的一个版本,其中每个单词都有标题。更具体地说,单词以大写字符开头,其余的大小写字符都是小写字符。

42 translate()

kind=method class=str objtype=method_descriptor

使用给定的转换表替换字符串中的每个字符。table转换表,必须是Unicode序数到Unicode序数、字符串或None的映射。
表必须通过getitem实现查找/索引,例如字典或列表。如果此操作引发LookupError,则该字符将保持不变。映射为None的字符将被删除。

43 upper()

kind=method class=str objtype=method_descriptor

返回一个转换为大写字母的字符串副本。

44 zfill()

kind=method class=str objtype=method_descriptor

填充数字字符串左侧的零,以填充给定宽度的字段。字符串永远不会被截断。

static method

45 maketrans()

kind=static method class=str objtype=staticmethod

剩余

6 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003928708>
7 spec ModuleSpec(name=‘docx.compat’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003928708>, origin=‘…\lib\site-packages\docx\compat.py’)
8 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
9 division _Feature((2, 2, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 8192)
10 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
11 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
8 dict 1
10 class 10
11 function 2
13 residual 5
14 system 8
16 all 23

【docx.shared】

shared, fullname=docx.shared, file=docx\shared.py

docx模块共享的对象。

函数

1 lazyproperty(f)

lazyproperty(f), module=docx.shared, line:158 at site-packages\docx\shared.py

@lazyprop装饰器。
方法将只在第一次访问时调用,以计算缓存的属性值。之后,返回缓存的值。

2 write_only_property(f)

write_only_property(f), module=docx.shared, line:178 at site-packages\docx\shared.py

只写属性装饰器。创建接受赋值的属性(描述符属性),但不接受getattr(在表达式中使用)。

3 docx.shared.Length

Length, docx.shared.Length, module=docx.shared

长度构造函数类Inch、Cm、Mm、Px和Emu的基类。表现为英制公制单位的int计数,英寸为914,400,毫米为36,000。
以只读属性的形式提供方便的单位转换方法。不可变的。

property

1 cm=<property object at 0x000000000392ADB8> kind:property type:property class:<class ‘docx.shared.Length’>
2 emu=<property object at 0x000000000392AE08> kind:property type:property class:<class ‘docx.shared.Length’>
3 inches=<property object at 0x000000000392AE58> kind:property type:property class:<class ‘docx.shared.Length’>
4 mm=<property object at 0x000000000392AEA8> kind:property type:property class:<class ‘docx.shared.Length’>
5 pt=<property object at 0x000000000392AEF8> kind:property type:property class:<class ‘docx.shared.Length’>
6 twips=<property object at 0x000000000392AF48> kind:property type:property class:<class ‘docx.shared.Length’>

4 docx.shared.Inches

Inches, docx.shared.Inches, module=docx.shared

以英寸为单位的长度方便构造函数,例如。``width = Inches(0.5)``。

5 docx.shared.Cm

Cm, docx.shared.Cm, module=docx.shared

以厘米为单位的方便构造函数,例如。``height = Cm(12)``。

6 docx.shared.Emu

Emu, docx.shared.Emu, module=docx.shared

长度的英文公制单位的方便构造函数,例如。``width = Emu(457200)``。

7 docx.shared.Mm

Mm, docx.shared.Mm, module=docx.shared

以毫米为单位的长度方便构造函数,例如。``width = Mm(240.5)``。

8 docx.shared.Pt

Pt, docx.shared.Pt, module=docx.shared

方便值类,用于指定以点为单位的长度

9 docx.shared.Twips

Twips, docx.shared.Twips, module=docx.shared

长度单位为twips的方便构造函数,例如 ``width = Twips(42)``。twip是二十分之一点,635 EMU。

10 docx.shared.RGBColor

RGBColor, docx.shared.RGBColor, module=docx.shared

定义特定RGB颜色的不可变值对象。

class method

1 from_string()

kind=class method class=RGBColor objtype=classmethod

11 docx.shared.ElementProxy

ElementProxy, docx.shared.ElementProxy, module=docx.shared

lxml元素代理类的基类。元素代理类的主要职责是操作XML元素的属性和子元素。它们是python-docx中除了自定义元素(oxml)类之外最常见类的类型。

property

1 element=<property object at 0x00000000039319A8> kind:property type:property class:<class ‘docx.shared.ElementProxy’>
2 part=<property object at 0x00000000039319F8> kind:property type:property class:<class ‘docx.shared.ElementProxy’>

12 docx.shared.Parented

Parented, docx.shared.Parented, module=docx.shared

为部分下面出现的文档元素提供公共服务,但偶尔可能需要一个祖先对象来提供服务,例如添加或删除关系。提供了``self._parent``属性给子类。

property

1 part=<property object at 0x0000000003931B88> kind:property type:property class:<class ‘docx.shared.Parented’>

剩余

13 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003928A08>
14 spec ModuleSpec(name=‘docx.shared’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003928A08>, origin=‘…\lib\site-packages\docx\shared.py’)
15 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
16 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
17 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
5 tuple 1
6 list 1
8 dict 1
9 module 9
10 class 6
13 residual 6
14 system 9
16 all 29

【docx.image】

image, fullname=docx.image, file=docx\image_init_.py

提供可以将图像流描述为内容类型和对象大小,作为在文档中包含它们的必要步骤。

常量

tuple

1 SIGNATURES ((<class ‘docx.image.png.Png’>, 0, b’\x89PNG\r\n\x1a\n’), (<class 'docx.image.jp…

模块

2 docx.image.constants

constants, fullname=docx.image.constants, file=docx\image\constants.py

特定于图像子包的常量

3 docx.image.exceptions

exceptions, fullname=docx.image.exceptions, file=docx\image\exceptions.py

特定于映像子包的异常

4 docx.image.helpers

helpers, fullname=docx.image.helpers, file=docx\image\helpers.py

5 docx.image.image

image, fullname=docx.image.image, file=docx\image\image.py

提供可以根据内容类型和大小来描述图像流的对象,作为在文档中包含它们的必要步骤。

6 docx.image.bmp

bmp, fullname=docx.image.bmp, file=docx\image\bmp.py

7 docx.image.gif

gif, fullname=docx.image.gif, file=docx\image\gif.py

8 docx.image.tiff

tiff, fullname=docx.image.tiff, file=docx\image\tiff.py

9 docx.image.jpeg

jpeg, fullname=docx.image.jpeg, file=docx\image\jpeg.py

与JPEG图像流的解析头相关的对象,包括JFIF和Exif子格式。

10 docx.image.png

png, fullname=docx.image.png, file=docx\image\png.py

11 docx.image.bmp.Bmp

Bmp, docx.image.bmp.Bmp, module=docx.image.bmp

BMP图像的图像头解析器

property

1 content_type=<property object at 0x0000000003923A98> kind:property type:property class:<class ‘docx.image.bmp.Bmp’>
2 default_ext=<property object at 0x0000000003935458> kind:property type:property class:<class ‘docx.image.bmp.Bmp’>

class method

3 from_stream()

kind=class method class=Bmp objtype=classmethod

12 docx.image.gif.Gif

Gif, docx.image.gif.Gif, module=docx.image.gif

GIF图像的图像头解析器。注意,GIF格式不支持分辨率(DPI)信息。水平和垂直DPI默认为72。

property

1 content_type=<property object at 0x0000000003935778> kind:property type:property class:<class ‘docx.image.gif.Gif’>
2 default_ext=<property object at 0x00000000039357C8> kind:property type:property class:<class ‘docx.image.gif.Gif’>

class method

3 from_stream()

kind=class method class=Gif objtype=classmethod

13 docx.image.jpeg.Exif

Exif, docx.image.jpeg.Exif, module=docx.image.jpeg

用于Exif图像格式的图像头解析器

class method

1 from_stream()

kind=class method class=Exif objtype=classmethod

14 docx.image.jpeg.Jfif

Jfif, docx.image.jpeg.Jfif, module=docx.image.jpeg

图像头解析器用于JFIF图像格式

class method

1 from_stream()

kind=class method class=Jfif objtype=classmethod

15 docx.image.png.Png

Png, docx.image.png.Png, module=docx.image.png

PNG图像的图像头解析器

property

1 content_type=<property object at 0x0000000003951CC8> kind:property type:property class:<class ‘docx.image.png.Png’>
2 default_ext=<property object at 0x0000000003951D18> kind:property type:property class:<class ‘docx.image.png.Png’>

class method

3 from_stream()

kind=class method class=Png objtype=classmethod

16 docx.image.tiff.Tiff

Tiff, docx.image.tiff.Tiff, module=docx.image.tiff

TIFF图像的图像头解析器。处理大端和小端字节排序。

property

1 content_type=<property object at 0x0000000003943AE8> kind:property type:property class:<class ‘docx.image.tiff.Tiff’>
2 default_ext=<property object at 0x0000000003943B38> kind:property type:property class:<class ‘docx.image.tiff.Tiff’>

class method

3 from_stream()

kind=class method class=Tiff objtype=classmethod

剩余

17 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003914FC8>
18 spec ModuleSpec(name=‘docx.image’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003914FC8>, origin=‘…\lib\site-packages\docx\image\init.py’, submodule_search_locations=[‘…\lib\site-packages\docx\image’])
19 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
20 division _Feature((2, 2, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 8192)
21 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
22 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
8 dict 1
10 class 3
13 residual 2
14 system 8
16 all 11

【docx.exceptions】

exceptions, fullname=docx.exceptions, file=docx\exceptions.py

python-docx使用的异常。基异常类是PythonDocxError。

1 docx.exceptions.PythonDocxError

PythonDocxError, docx.exceptions.PythonDocxError, module=docx.exceptions

泛型错误类。

2 docx.exceptions.InvalidSpanError

InvalidSpanError, docx.exceptions.InvalidSpanError, module=docx.exceptions

在合并表单元格的请求中指定无效的合并区域时将被引发。

3 docx.exceptions.InvalidXmlError

InvalidXmlError, docx.exceptions.InvalidXmlError, module=docx.exceptions

当遇到无效的XML时将被引发,例如试图访问缺少的必需子元素

统计

序号 类别 数量
4 str 5
6 list 1
8 dict 1
9 module 7
10 class 1
13 residual 5
14 system 9
16 all 20

【docx.enum】

enum, fullname=docx.enum, file=docx\enum_init_.py

python-docx中使用的枚举

模块

1 docx.enum.base

base, fullname=docx.enum.base, file=docx\enum\base.py

枚举使用的基类和其他对象

2 docx.enum.section

section, fullname=docx.enum.section, file=docx\enum\section.py

在WordprocessingML文件中与主文档相关的枚举

3 docx.enum.style

style, fullname=docx.enum.style, file=docx\enum\style.py

与样式相关的枚举

4 docx.enum.table

table, fullname=docx.enum.table, file=docx\enum\table.py

与WordprocessingML文件中的表相关的枚举

5 docx.enum.dml

dml, fullname=docx.enum.dml, file=docx\enum\dml.py

DrawingML对象使用的枚举

6 docx.enum.text

text, fullname=docx.enum.text, file=docx\enum\text.py

与WordprocessingML文件中的文本相关的枚举

7 docx.enum.shape

shape, fullname=docx.enum.shape, file=docx\enum\shape.py

在WordprocessingML文件中与DrawingML形状相关的枚举

8 docx.enum.Enumeration

Enumeration, docx.enum.Enumeration, module=docx.enum

class method

1 from_xml()

kind=class method class=Enumeration objtype=classmethod

2 to_xml()

kind=class method class=Enumeration objtype=classmethod

剩余

9 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003A5D5C8>
10 spec ModuleSpec(name=‘docx.enum’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003A5D5C8>, origin=‘…\lib\site-packages\docx\enum\init.py’, submodule_search_locations=[‘…\lib\site-packages\docx\enum’])
11 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
12 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
13 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
6 list 1
8 dict 2
9 module 15
10 class 64
11 function 3
13 residual 5
14 system 9
16 all 95

【docx.oxml】

oxml, fullname=docx.oxml, file=docx\oxml_init_.py

初始化oxml子包,包括注册对应于Open XML元素的自定义元素类。

常量

dict

1 nsmap {‘a’: ‘http://schemas.openxmlformats.org/drawingml/2006/main’, ‘c’: 'http://sche…

模块

2 lxml.etree

etree, fullname=lxml.etree, file=lxml\etree.cp37-win_amd64.pyd

“lxml。模块为XML实现了扩展的ElementTree API。

3 docx.oxml.ns

ns, fullname=docx.oxml.ns, file=docx\oxml\ns.py

Namespace-related对象。

4 docx.oxml.simpletypes

simpletypes, fullname=docx.oxml.simpletypes, file=docx\oxml\simpletypes.py

简单类型类,为存储在XML元素属性中的值提供验证和格式转换。命名通常对应于相关XML模式中的简单类型。

5 docx.oxml.exceptions

exceptions, fullname=docx.oxml.exceptions, file=docx\oxml\exceptions.py

oxml子包的异常

6 docx.oxml.xmlchemy

xmlchemy, fullname=docx.oxml.xmlchemy, file=docx\oxml\xmlchemy.py

提供lxml的包装器,支持自定义元素类的声明性定义。

7 docx.oxml.shared

shared, fullname=docx.oxml.shared, file=docx\oxml\shared.py

docx中模块共享的对象。oxml分包。

8 docx.oxml.coreprops

coreprops, fullname=docx.oxml.coreprops, file=docx\oxml\coreprops.py

与核心属性相关的XML元素的自定义元素类

9 docx.oxml.document

document, fullname=docx.oxml.document, file=docx\oxml\document.py

对应于文档部分的自定义元素类,例如<w:document>。

10 docx.oxml.numbering

numbering, fullname=docx.oxml.numbering, file=docx\oxml\numbering.py

与编号部分相关的自定义元素类

11 docx.oxml.section

section, fullname=docx.oxml.section, file=docx\oxml\section.py

与节相关的自定义元素类

12 docx.oxml.settings

settings, fullname=docx.oxml.settings, file=docx\oxml\settings.py

与文档设置相关的自定义元素类

13 docx.oxml.shape

shape, fullname=docx.oxml.shape, file=docx\oxml\shape.py

形状相关元素的自定义元素类,如``<w:inline>``

14 docx.oxml.styles

styles, fullname=docx.oxml.styles, file=docx\oxml\styles.py

与样式部分相关的自定义元素类

15 docx.oxml.table

table, fullname=docx.oxml.table, file=docx\oxml\table.py

表的自定义元素类

16 docx.oxml.text

text, fullname=docx.oxml.text, file=docx\oxml\text_init_.py

函数

17 parse_xml(xml)

parse_xml(xml), module=docx.oxml, line:21 at site-packages\docx\oxml_init_.py

返回通过解析* XML *中的XML字符串获得的根lxml元素,该元素可以是Python 2.X字符串或unicode。
使用自定义解析器,因此为*xml*中含有自定义元素的元素生成自定义元素类。

18 register_element_cls(tag, cls)

register_element_cls(tag, cls), module=docx.oxml, line:32 at site-packages\docx\oxml_init_.py

当oxml解析器遇到具有匹配*标记*的元素时,要构造注册*cls*。
*tag*是一个形式为``nspfx:tagroot``,例如:``'w:document'``。

19 OxmlElement(nsptag_str, attrs=None, nsdecls=None)

OxmlElement(nsptag_str, attrs=None, nsdecls=None), module=docx.oxml, line:43 at site-packages\docx\oxml_init_.py

返回一个“松散的”lxml元素,其标签由*nsptag_str*指定。*nsptag_str*必须包含标准的命名空间前缀,例如:'a:tbl'。
结果元素是此标记名的自定义元素类的实例(如果定义了一个)。属性值的字典可以提供为*attrs*;如果存在,则设置它们。
dict *nsdecls*中定义的所有名称空间都在元素中声明,使用键作为前缀,值作为名称空间名称。
如果没有提供*nsdecls*,则根据*nsptag_str*上的前缀添加单个命名空间声明。

20 docx.oxml.ns.NamespacePrefixedTag

NamespacePrefixedTag, docx.oxml.ns.NamespacePrefixedTag, module=docx.oxml.ns

值对象,该对象知道具有名称空间前缀的XML标记的语义。

property

1 clark_name=<property object at 0x00000000039FFEF8> kind:property type:property class:<class ‘docx.oxml.ns.NamespacePrefixedTag’>
2 local_part=<property object at 0x00000000039FFF48> kind:property type:property class:<class ‘docx.oxml.ns.NamespacePrefixedTag’>
3 nsmap=<property object at 0x00000000039FFF98> kind:property type:property class:<class ‘docx.oxml.ns.NamespacePrefixedTag’>
4 nspfx=<property object at 0x0000000003A04048> kind:property type:property class:<class ‘docx.oxml.ns.NamespacePrefixedTag’>
5 nsuri=<property object at 0x0000000003A04098> kind:property type:property class:<class ‘docx.oxml.ns.NamespacePrefixedTag’>

class method

6 from_clark_name()

kind=class method class=NamespacePrefixedTag objtype=classmethod

21 docx.oxml.shared.CT_DecimalNumber

CT_DecimalNumber, docx.oxml.shared.CT_DecimalNumber, module=docx.oxml.shared

用于``<w:numId>``, ``<w:ilvl>``, ``<w:abstractNumId>``和其他几个,在其“val”属性中包含十进制数的文本表示形式(例如42)。

property

1 val=<property object at 0x0000000003A24688> kind:property type:property class:<class ‘docx.oxml.shared.CT_DecimalNumber’>

class method

2 new()

kind=class method class=CT_DecimalNumber objtype=classmethod

22 docx.oxml.shared.CT_OnOff

CT_OnOff, docx.oxml.shared.CT_OnOff, module=docx.oxml.shared

用于``<w:b>``, ``<w:i>``元素和其他元素,在其``val``属性中包含一个bool-ish字符串,xsd:boolean加上'on'和'off'。

property

1 val=<property object at 0x0000000003A308B8> kind:property type:property class:<class ‘docx.oxml.shared.CT_OnOff’>

23 docx.oxml.shared.CT_String

CT_String, docx.oxml.shared.CT_String, module=docx.oxml.shared

用于``<w:pStyle>``和``<w:tblStyle>``元素和其他元素,在其``val``属性中包含样式名称。

property

1 val=<property object at 0x0000000003A309F8> kind:property type:property class:<class ‘docx.oxml.shared.CT_String’>

class method

2 new()

kind=class method class=CT_String objtype=classmethod

24 docx.oxml.coreprops.CT_CoreProperties

CT_CoreProperties, docx.oxml.coreprops.CT_CoreProperties, module=docx.oxml.coreprops

``<cp:coreProperties>``元素,核心属性部分的根元素,存储为``/docProps/core.xml``。
实现许多Dublin Core文档元数据元素。如果元素不在XML中,则字符串元素解析为空字符串('')。字符串元素的长度限制为255个unicode字符。

property

1 author_text=<property object at 0x0000000003A38DB8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
2 category=<property object at 0x0000000003A3B688> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
3 category_text=<property object at 0x0000000003A38E08> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
4 comments_text=<property object at 0x0000000003A38E58> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
5 contentStatus=<property object at 0x0000000003A3B7C8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
6 contentStatus_text=<property object at 0x0000000003A38EA8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
7 created=<property object at 0x0000000003A3B9A8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
8 created_datetime=<property object at 0x0000000003A38EF8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
9 creator=<property object at 0x0000000003A3BA48> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
10 description=<property object at 0x0000000003A3BAE8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
11 identifier=<property object at 0x0000000003A3BCC8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
12 identifier_text=<property object at 0x0000000003A38F48> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
13 keywords=<property object at 0x0000000003A3BE08> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
14 keywords_text=<property object at 0x0000000003A38F98> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
15 language=<property object at 0x0000000003A3BF48> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
16 language_text=<property object at 0x0000000003A3B048> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
17 lastModifiedBy=<property object at 0x0000000003A440E8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
18 lastModifiedBy_text=<property object at 0x0000000003A3B098> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
19 lastPrinted=<property object at 0x0000000003A442C8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
20 lastPrinted_datetime=<property object at 0x0000000003A3B0E8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
21 modified=<property object at 0x0000000003A444A8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
22 modified_datetime=<property object at 0x0000000003A3B138> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
23 revision=<property object at 0x0000000003A445E8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
24 revision_number=<property object at 0x0000000003A3B188> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
25 subject=<property object at 0x0000000003A44728> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
26 subject_text=<property object at 0x0000000003A3B1D8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
27 title=<property object at 0x0000000003A447C8> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
28 title_text=<property object at 0x0000000003A3B228> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
29 version=<property object at 0x0000000003A44868> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>
30 version_text=<property object at 0x0000000003A3B278> kind:property type:property class:<class ‘docx.oxml.coreprops.CT_CoreProperties’>

method

31 get_or_add_category()

kind=method class=CT_CoreProperties objtype=function

返回``<cp:category>``子元素,如果不存在则为新添加的子元素。

32 get_or_add_contentStatus()

kind=method class=CT_CoreProperties objtype=function

返回``<cp:contentStatus>``子元素,如果不存在则新添加。

33 get_or_add_created()

kind=method class=CT_CoreProperties objtype=function

返回``<dcterms:created>``子元素,如果不存在则为新添加的子元素。

34 get_or_add_creator()

kind=method class=CT_CoreProperties objtype=function

返回``<dc:creator>``子元素,如果不存在则为新添加的子元素。

35 get_or_add_description()

kind=method class=CT_CoreProperties objtype=function

返回``<dc:description>``子元素,如果不存在则是新添加的子元素。

36 get_or_add_identifier()

kind=method class=CT_CoreProperties objtype=function

返回``<dc:identifier>``子元素,如果不存在则是新添加的子元素。

37 get_or_add_keywords()

kind=method class=CT_CoreProperties objtype=function

返回``<cp:keywords>``子元素,如果不存在则新添加。

38 get_or_add_language()

kind=method class=CT_CoreProperties objtype=function

返回``<dc:language>``子元素,如果不存在则新添加。

39 get_or_add_lastModifiedBy()

kind=method class=CT_CoreProperties objtype=function

返回``<cp:lastModifiedBy>``子元素,如果不存在则新添加。

40 get_or_add_lastPrinted()

kind=method class=CT_CoreProperties objtype=function

返回``<cp: lastprinting >``子元素,如果不存在则是新添加的子元素。

41 get_or_add_modified()

kind=method class=CT_CoreProperties objtype=function

返回``<dcterms:modified>``子元素,如果不存在则为新添加的子元素。

42 get_or_add_revision()

kind=method class=CT_CoreProperties objtype=function

返回``<cp:revision>``子元素,如果不存在则为新添加的子元素。

43 get_or_add_subject()

kind=method class=CT_CoreProperties objtype=function

返回``<dc:subject>``子元素,如果不存在则新添加。

44 get_or_add_title()

kind=method class=CT_CoreProperties objtype=function

返回``<dc:title>``子元素,如果不存在则是新添加的子元素。

45 get_or_add_version()

kind=method class=CT_CoreProperties objtype=function

返回``<cp:version>``子元素,如果不存在则为新添加的子元素。

class method

46 new()

kind=class method class=CT_CoreProperties objtype=classmethod

25 docx.oxml.document.CT_Body

CT_Body, docx.oxml.document.CT_Body, module=docx.oxml.document

``<w:body>``, ``document.xml``中主文档故事的容器元素。

property

1 p_lst=<property object at 0x0000000003A4F048> kind:property type:property class:<class ‘docx.oxml.document.CT_Body’>
2 sectPr=<property object at 0x0000000003A4F098> kind:property type:property class:<class ‘docx.oxml.document.CT_Body’>
3 tbl_lst=<property object at 0x0000000001EF7EF8> kind:property type:property class:<class ‘docx.oxml.document.CT_Body’>

method

4 add_p()

kind=method class=CT_Body objtype=function

无条件地添加一个新的``<w:p>``子元素,按正确的顺序插入。

5 add_section_break()

kind=method class=CT_Body objtype=function

返回' w:sectPr '元素用于在文档末尾添加的新节。
最后一个`w:sectPr`变成倒数第二个,新的`w:sectPr`是前一个的完全克隆,除了所有的页眉和页脚引用都被删除了(因此现在是从前一个节“继承”的)。
上一个`w:sectPr`的副本现在将出现在文档末尾的新`w:p`中。返回的`w:sectPr`是文档的哨兵`w:sectPr`(并且在实现时,*是*先前的哨兵`w:sectPr`,删除了页眉和页脚)。

6 add_tbl()

kind=method class=CT_Body objtype=function

无条件地添加一个新的``<w:tbl>``子元素,按正确的顺序插入。

7 clear_content()

kind=method class=CT_Body objtype=function

从<w:body>元素中移除所有内容子元素。如果存在<w:sectPr>元素,则保留它。

8 get_or_add_sectPr()

kind=method class=CT_Body objtype=function

返回``<w:sectPr>``子元素,如果不存在则新添加。

26 docx.oxml.document.CT_Document

CT_Document, docx.oxml.document.CT_Document, module=docx.oxml.document

``<w:document>``元素,document.xml文件的根元素。

property

1 body=<property object at 0x0000000003A44E08> kind:property type:property class:<class ‘docx.oxml.document.CT_Document’>
2 sectPr_lst=<property object at 0x0000000003A44C28> kind:property type:property class:<class ‘docx.oxml.document.CT_Document’>

method

3 get_or_add_body()

kind=method class=CT_Document objtype=function

返回``<w:body>``子元素,如果不存在则为新添加的子元素。

27 docx.oxml.numbering.CT_Num

CT_Num, docx.oxml.numbering.CT_Num, module=docx.oxml.numbering

元素,它表示一个具体的列表定义实例,具有一个必需的子元素<w:abstractNumId>,该子元素引用一个抽象编号定义,该抽象编号定义定义了大多数格式化细节。

property

1 abstractNumId=<property object at 0x0000000003A4FAE8> kind:property type:property class:<class ‘docx.oxml.numbering.CT_Num’>
2 lvlOverride_lst=<property object at 0x0000000003A4FB38> kind:property type:property class:<class ‘docx.oxml.numbering.CT_Num’>
3 numId=<property object at 0x0000000003A4FC78> kind:property type:property class:<class ‘docx.oxml.numbering.CT_Num’>

method

4 add_lvlOverride()

kind=method class=CT_Num objtype=function

返回一个新添加的 CT_NumLvl (<w:lvlOverride>)元素,其``ilvl``属性设置为*ilvl*。

class method

5 new()

kind=class method class=CT_Num objtype=classmethod

28 docx.oxml.numbering.CT_Numbering

CT_Numbering, docx.oxml.numbering.CT_Numbering, module=docx.oxml.numbering

``<w:numbering>``元素,编号部分的根元素,即numbering.xml

property

1 num_lst=<property object at 0x0000000003A54408> kind:property type:property class:<class ‘docx.oxml.numbering.CT_Numbering’>

method

2 add_num()

kind=method class=CT_Numbering objtype=function

返回一个新添加的 CT_Num (<w:num>)元素,引用由*abstractNum_id*标识的抽象编号定义。

3 num_having_numId()

kind=method class=CT_Numbering objtype=function

返回具有``numId``属性的``<w:num>``子元素
匹配*numId*。

29 docx.oxml.numbering.CT_NumLvl

CT_NumLvl, docx.oxml.numbering.CT_NumLvl, module=docx.oxml.numbering

``<w:lvlOverride>``元素,用于标识列表定义中要用其包含的设置覆盖的关卡。

property

1 ilvl=<property object at 0x0000000003A54048> kind:property type:property class:<class ‘docx.oxml.numbering.CT_NumLvl’>
2 startOverride=<property object at 0x0000000003A4FE08> kind:property type:property class:<class ‘docx.oxml.numbering.CT_NumLvl’>

method

3 add_startOverride()

kind=method class=CT_NumLvl objtype=function

返回一个新添加的CT_DecimalNumber元素,其中tagname``w:startOverride``和``val``属性设置为*val*。

4 get_or_add_startOverride()

kind=method class=CT_NumLvl objtype=function

返回``<w:startOverride>``子元素,如果不存在则新添加。

30 docx.oxml.numbering.CT_NumPr

CT_NumPr, docx.oxml.numbering.CT_NumPr, module=docx.oxml.numbering

``<w:numPr>``元素,用于存放应用于段落的编号属性。

property

1 ilvl=<property object at 0x0000000003A541D8> kind:property type:property class:<class ‘docx.oxml.numbering.CT_NumPr’>
2 numId=<property object at 0x0000000003A54228> kind:property type:property class:<class ‘docx.oxml.numbering.CT_NumPr’>

method

3 get_or_add_ilvl()

kind=method class=CT_NumPr objtype=function

返回``<w:ilvl>``子元素,如果不存在则是新添加的子元素。

4 get_or_add_numId()

kind=method class=CT_NumPr objtype=function

返回``<w:numId>``子元素,如果不存在则新添加。

31 docx.oxml.section.CT_HdrFtr

CT_HdrFtr, docx.oxml.section.CT_HdrFtr, module=docx.oxml.section

`w:hdr`和`w:ftr`,分别是页眉部分和页脚部分的根元素

property

1 p_lst=<property object at 0x0000000003A76868> kind:property type:property class:<class ‘docx.oxml.section.CT_HdrFtr’>
2 tbl_lst=<property object at 0x0000000003A768B8> kind:property type:property class:<class ‘docx.oxml.section.CT_HdrFtr’>

method

3 add_p()

kind=method class=CT_HdrFtr objtype=function

无条件地添加一个新的``<w:p>``子元素,按正确的顺序插入。

4 add_tbl()

kind=method class=CT_HdrFtr objtype=function

无条件地添加一个新的``<w:tbl>``子元素,按正确的顺序插入。

32 docx.oxml.section.CT_HdrFtrRef

CT_HdrFtrRef, docx.oxml.section.CT_HdrFtrRef, module=docx.oxml.section

`w:headerReference` 和 `w:footerReference` 元素

property

1 rId=<property object at 0x0000000003A769A8> kind:property type:property class:<class ‘docx.oxml.section.CT_HdrFtrRef’>
2 type_=<property object at 0x0000000003A76958> kind:property type:property class:<class ‘docx.oxml.section.CT_HdrFtrRef’>

33 docx.oxml.section.CT_PageMar

CT_PageMar, docx.oxml.section.CT_PageMar, module=docx.oxml.section

``<w:pgMar>``元素,定义页边距。

property

1 bottom=<property object at 0x0000000003A76BD8> kind:property type:property class:<class ‘docx.oxml.section.CT_PageMar’>
2 footer=<property object at 0x0000000003A76CC8> kind:property type:property class:<class ‘docx.oxml.section.CT_PageMar’>
3 gutter=<property object at 0x0000000003A76D18> kind:property type:property class:<class ‘docx.oxml.section.CT_PageMar’>
4 header=<property object at 0x0000000003A76C78> kind:property type:property class:<class ‘docx.oxml.section.CT_PageMar’>
5 left=<property object at 0x0000000003A76C28> kind:property type:property class:<class ‘docx.oxml.section.CT_PageMar’>
6 right=<property object at 0x0000000003A76B88> kind:property type:property class:<class ‘docx.oxml.section.CT_PageMar’>
7 top=<property object at 0x0000000003A76B38> kind:property type:property class:<class ‘docx.oxml.section.CT_PageMar’>

34 docx.oxml.section.CT_PageSz

CT_PageSz, docx.oxml.section.CT_PageSz, module=docx.oxml.section

``<w:pgSz>``元素,定义页面尺寸和方向。

property

1 h=<property object at 0x0000000003A76F98> kind:property type:property class:<class ‘docx.oxml.section.CT_PageSz’>
2 orient=<property object at 0x0000000003A7E048> kind:property type:property class:<class ‘docx.oxml.section.CT_PageSz’>
3 w=<property object at 0x0000000003A76F48> kind:property type:property class:<class ‘docx.oxml.section.CT_PageSz’>

35 docx.oxml.section.CT_SectPr

CT_SectPr, docx.oxml.section.CT_SectPr, module=docx.oxml.section

`w:sectPr`元素,section属性的容器元素

property

1 bottom_margin=<property object at 0x0000000003A7E228> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
2 footer=<property object at 0x0000000003A7E278> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
3 footerReference_lst=<property object at 0x0000000003A7E958> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
4 gutter=<property object at 0x0000000003A7E2C8> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
5 header=<property object at 0x0000000003A7E318> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
6 headerReference_lst=<property object at 0x0000000003A7E778> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
7 left_margin=<property object at 0x0000000003A7E368> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
8 orientation=<property object at 0x0000000003A7E3B8> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
9 page_height=<property object at 0x0000000003A7E408> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
10 page_width=<property object at 0x0000000003A7E458> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
11 pgMar=<property object at 0x0000000003A7EB88> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
12 pgSz=<property object at 0x0000000003A7EB38> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
13 preceding_sectPr=<property object at 0x0000000003A7E1D8> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
14 right_margin=<property object at 0x0000000003A7E4F8> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
15 start_type=<property object at 0x0000000003A7E548> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
16 titlePg=<property object at 0x0000000003A7EC28> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
17 titlePg_val=<property object at 0x0000000003A7E598> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
18 top_margin=<property object at 0x0000000003A7E5E8> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>
19 type=<property object at 0x0000000003A7EAE8> kind:property type:property class:<class ‘docx.oxml.section.CT_SectPr’>

method

20 add_footerReference()

kind=method class=CT_SectPr objtype=function

返回新添加的带有*rId*的*type_*的CT_HdrFtrRef元素。元素标签是`w:footerReference`。

21 add_headerReference()

kind=method class=CT_SectPr objtype=function

返回新添加的带有*rId*的*type_*的CT_HdrFtrRef元素。元素标签是`w:headerReference`。

22 clone()

kind=method class=CT_SectPr objtype=function

返回此``<w:sectPr>``元素树的精确副本,适合用于添加节断点。从根元素``<w:sectPr>``中删除所有rsid*属性。

23 get_footerReference()

kind=method class=CT_SectPr objtype=function

返回*type_*的footerReference元素,如果不存在则返回None。

24 get_headerReference()

kind=method class=CT_SectPr objtype=function

返回*type_*的headerReference元素,如果不存在则返回None。

25 get_or_add_pgMar()

kind=method class=CT_SectPr objtype=function

返回``<w:pgMar>``子元素,如果不存在则新添加。

26 get_or_add_pgSz()

kind=method class=CT_SectPr objtype=function

返回``<w:pgSz>``子元素,如果不存在则是新添加的子元素。

27 get_or_add_titlePg()

kind=method class=CT_SectPr objtype=function

返回``<w:titlePg>``子元素,如果不存在则是新添加的子元素。

28 get_or_add_type()

kind=method class=CT_SectPr objtype=function

返回``<w:type>``子元素,如果不存在则新添加。

29 remove_footerReference()

kind=method class=CT_SectPr objtype=function

删除w:footerReference子元素*type_*后返回rId。

30 remove_headerReference()

kind=method class=CT_SectPr objtype=function

删除w:headerReference子元素*type_*后返回rId。

36 docx.oxml.section.CT_SectType

CT_SectType, docx.oxml.section.CT_SectType, module=docx.oxml.section

``<w:sectType>``元素,定义节开始类型。

property

1 val=<property object at 0x0000000003A7EE08> kind:property type:property class:<class ‘docx.oxml.section.CT_SectType’>

37 docx.oxml.settings.CT_Settings

CT_Settings, docx.oxml.settings.CT_Settings, module=docx.oxml.settings

`w:settings` 元素,设置部分的根元素

property

1 evenAndOddHeaders=<property object at 0x0000000003A867C8> kind:property type:property class:<class ‘docx.oxml.settings.CT_Settings’>
2 evenAndOddHeaders_val=<property object at 0x0000000003A866D8> kind:property type:property class:<class ‘docx.oxml.settings.CT_Settings’>

method

3 get_or_add_evenAndOddHeaders()

kind=method class=CT_Settings objtype=function

返回``<w:evenAndOddHeaders>``子元素,如果不存在则新添加。

38 docx.oxml.shape.CT_Blip

CT_Blip, docx.oxml.shape.CT_Blip, module=docx.oxml.shape

``<a:blip>``元素,指定图像源和调整,如alpha和色调tint。

property

1 embed=<property object at 0x0000000003A869A8> kind:property type:property class:<class ‘docx.oxml.shape.CT_Blip’>
2 link=<property object at 0x0000000003A869F8> kind:property type:property class:<class ‘docx.oxml.shape.CT_Blip’>

39 docx.oxml.shape.CT_BlipFillProperties

CT_BlipFillProperties, docx.oxml.shape.CT_BlipFillProperties, module=docx.oxml.shape

``<pic:blipFill>``元素,指定图片属性

property

1 blip=<property object at 0x0000000003A86B88> kind:property type:property class:<class ‘docx.oxml.shape.CT_BlipFillProperties’>

method

2 get_or_add_blip()

kind=method class=CT_BlipFillProperties objtype=function

返回``<a:blip>``子元素,如果不存在则新添加。

40 docx.oxml.shape.CT_GraphicalObject

CT_GraphicalObject, docx.oxml.shape.CT_GraphicalObject, module=docx.oxml.shape

``<a:graphic>``元素,DrawingML对象的容器

property

1 graphicData=<property object at 0x0000000003A86D18> kind:property type:property class:<class ‘docx.oxml.shape.CT_GraphicalObject’>

41 docx.oxml.shape.CT_GraphicalObjectData

CT_GraphicalObjectData, docx.oxml.shape.CT_GraphicalObjectData, module=docx.oxml.shape

``<a:graphicData>``元素,DrawingML对象的XML容器

property

1 pic=<property object at 0x0000000003A86EA8> kind:property type:property class:<class ‘docx.oxml.shape.CT_GraphicalObjectData’>
2 uri=<property object at 0x0000000003A86EF8> kind:property type:property class:<class ‘docx.oxml.shape.CT_GraphicalObjectData’>

method

3 get_or_add_pic()

kind=method class=CT_GraphicalObjectData objtype=function

返回``<pic:pic>``子元素,如果不存在则新添加。

42 docx.oxml.shape.CT_Inline

CT_Inline, docx.oxml.shape.CT_Inline, module=docx.oxml.shape

``<w:inline>``元素,inline形状的容器。

property

1 docPr=<property object at 0x0000000003A8F1D8> kind:property type:property class:<class ‘docx.oxml.shape.CT_Inline’>
2 extent=<property object at 0x0000000003A8F188> kind:property type:property class:<class ‘docx.oxml.shape.CT_Inline’>
3 graphic=<property object at 0x0000000003A8F228> kind:property type:property class:<class ‘docx.oxml.shape.CT_Inline’>

class method

4 new()

kind=class method class=CT_Inline objtype=classmethod

5 new_pic_inline()

kind=class method class=CT_Inline objtype=classmethod

43 docx.oxml.shape.CT_NonVisualDrawingProps

CT_NonVisualDrawingProps, docx.oxml.shape.CT_NonVisualDrawingProps, module=docx.oxml.shape

用于``<wp:docPr>``元素,也可能用于其他元素。指定DrawingML绘图的id和名称。

property

1 id=<property object at 0x0000000003A8F3B8> kind:property type:property class:<class ‘docx.oxml.shape.CT_NonVisualDrawingProps’>
2 name=<property object at 0x0000000003A8F408> kind:property type:property class:<class ‘docx.oxml.shape.CT_NonVisualDrawingProps’>

44 docx.oxml.shape.CT_Picture

CT_Picture, docx.oxml.shape.CT_Picture, module=docx.oxml.shape

``<pic:pic>``元素,一个DrawingML图片

property

1 blipFill=<property object at 0x0000000003A8F6D8> kind:property type:property class:<class ‘docx.oxml.shape.CT_Picture’>
2 nvPicPr=<property object at 0x0000000003A8F688> kind:property type:property class:<class ‘docx.oxml.shape.CT_Picture’>
3 spPr=<property object at 0x0000000003A8F728> kind:property type:property class:<class ‘docx.oxml.shape.CT_Picture’>

class method

4 new()

kind=class method class=CT_Picture objtype=classmethod

45 docx.oxml.shape.CT_PictureNonVisual

CT_PictureNonVisual, docx.oxml.shape.CT_PictureNonVisual, module=docx.oxml.shape

``<pic:nvPicPr>``元素,非可视图片属性

property

1 cNvPr=<property object at 0x0000000003A8F8B8> kind:property type:property class:<class ‘docx.oxml.shape.CT_PictureNonVisual’>

46 docx.oxml.shape.CT_Point2D

CT_Point2D, docx.oxml.shape.CT_Point2D, module=docx.oxml.shape

用于``<a:off>``元素,也可以用于其他元素。指定x, y坐标(点)。

property

1 x=<property object at 0x0000000003A8FA48> kind:property type:property class:<class ‘docx.oxml.shape.CT_Point2D’>
2 y=<property object at 0x0000000003A8FA98> kind:property type:property class:<class ‘docx.oxml.shape.CT_Point2D’>

47 docx.oxml.shape.CT_PositiveSize2D

CT_PositiveSize2D, docx.oxml.shape.CT_PositiveSize2D, module=docx.oxml.shape

用于``<wp:extent>``元素,也可能稍后用于其他元素。指定DrawingML绘图的大小。

property

1 cx=<property object at 0x0000000003A8FC28> kind:property type:property class:<class ‘docx.oxml.shape.CT_PositiveSize2D’>
2 cy=<property object at 0x0000000003A8FC78> kind:property type:property class:<class ‘docx.oxml.shape.CT_PositiveSize2D’>

48 docx.oxml.shape.CT_ShapeProperties

CT_ShapeProperties, docx.oxml.shape.CT_ShapeProperties, module=docx.oxml.shape

``<pic:spPr>``元素,指定图片容器的大小和形状。

property

1 cx=<property object at 0x0000000003A8FEA8> kind:property type:property class:<class ‘docx.oxml.shape.CT_ShapeProperties’>
2 cy=<property object at 0x0000000003A8FEF8> kind:property type:property class:<class ‘docx.oxml.shape.CT_ShapeProperties’>
3 xfrm=<property object at 0x0000000003A95048> kind:property type:property class:<class ‘docx.oxml.shape.CT_ShapeProperties’>

method

4 get_or_add_xfrm()

kind=method class=CT_ShapeProperties objtype=function

返回``<a:xfrm>``子元素,如果不存在则新添加。

49 docx.oxml.shape.CT_Transform2D

CT_Transform2D, docx.oxml.shape.CT_Transform2D, module=docx.oxml.shape

``<a:xfrm>``元素,指定图片容器的大小和形状。

property

1 cx=<property object at 0x0000000003A951D8> kind:property type:property class:<class ‘docx.oxml.shape.CT_Transform2D’>
2 cy=<property object at 0x0000000003A95228> kind:property type:property class:<class ‘docx.oxml.shape.CT_Transform2D’>
3 ext=<property object at 0x0000000003A953B8> kind:property type:property class:<class ‘docx.oxml.shape.CT_Transform2D’>
4 off=<property object at 0x0000000003A95368> kind:property type:property class:<class ‘docx.oxml.shape.CT_Transform2D’>

method

5 get_or_add_ext()

kind=method class=CT_Transform2D objtype=function

返回``<a:ext>``子元素,如果不存在则新添加。

6 get_or_add_off()

kind=method class=CT_Transform2D objtype=function

返回``<a:off>``子元素,如果不存在则新添加

50 docx.oxml.styles.CT_LatentStyles

CT_LatentStyles, docx.oxml.styles.CT_LatentStyles, module=docx.oxml.styles

`w:latentStyles`元素,定义了潜在样式的默认行为,并包含`w:lsdException`子元素,每个子元素覆盖了命名潜在样式的默认行为。

property

1 count=<property object at 0x0000000003AB35E8> kind:property type:property class:<class ‘docx.oxml.styles.CT_LatentStyles’>
2 defLockedState=<property object at 0x0000000003AB3638> kind:property type:property class:<class ‘docx.oxml.styles.CT_LatentStyles’>
3 defQFormat=<property object at 0x0000000003AB3598> kind:property type:property class:<class ‘docx.oxml.styles.CT_LatentStyles’>
4 defSemiHidden=<property object at 0x0000000003AB3688> kind:property type:property class:<class ‘docx.oxml.styles.CT_LatentStyles’>
5 defUIPriority=<property object at 0x0000000003AB3728> kind:property type:property class:<class ‘docx.oxml.styles.CT_LatentStyles’>
6 defUnhideWhenUsed=<property object at 0x0000000003AB36D8> kind:property type:property class:<class ‘docx.oxml.styles.CT_LatentStyles’>
7 lsdException_lst=<property object at 0x0000000003AB3458> kind:property type:property class:<class ‘docx.oxml.styles.CT_LatentStyles’>

method

8 add_lsdException()

kind=method class=CT_LatentStyles objtype=function

无条件地添加一个新的``<w:lsdException>``子元素,按正确的顺序插入。

9 bool_prop()

kind=method class=CT_LatentStyles objtype=function

返回具有*attr_name*的属性的布尔值,如果不存在则返回|False|。

10 get_by_name()

kind=method class=CT_LatentStyles objtype=function

返回具有*name*的`w:lsdException`子节点,如果没有则返回|None|。

11 set_bool_prop()

kind=method class=CT_LatentStyles objtype=function

将具有*attr_name*的on/off属性设置为*value*。

51 docx.oxml.styles.CT_LsdException

CT_LsdException, docx.oxml.styles.CT_LsdException, module=docx.oxml.styles

    ``<w:lsdException>`` 元素,定义重写可见性行为一种命名的潜式.

property

1 locked=<property object at 0x0000000003AB39F8> kind:property type:property class:<class ‘docx.oxml.styles.CT_LsdException’>
2 name=<property object at 0x0000000003AB3A98> kind:property type:property class:<class ‘docx.oxml.styles.CT_LsdException’>
3 qFormat=<property object at 0x0000000003AB3A48> kind:property type:property class:<class ‘docx.oxml.styles.CT_LsdException’>
4 semiHidden=<property object at 0x0000000003AB3AE8> kind:property type:property class:<class ‘docx.oxml.styles.CT_LsdException’>
5 uiPriority=<property object at 0x0000000003AB3B38> kind:property type:property class:<class ‘docx.oxml.styles.CT_LsdException’>
6 unhideWhenUsed=<property object at 0x0000000003AB3B88> kind:property type:property class:<class ‘docx.oxml.styles.CT_LsdException’>

method

7 delete()

kind=method class=CT_LsdException objtype=function

从XML文档中删除`w:lsdException`元素。

8 on_off_prop()

kind=method class=CT_LsdException objtype=function

返回具有*attr_name*的属性的布尔值,如果不存在则返回|None| 。

9 set_on_off_prop()

kind=method class=CT_LsdException objtype=function

将具有*attr_name*的on/off属性设置为*value*。

52 docx.oxml.styles.CT_Style

CT_Style, docx.oxml.styles.CT_Style, module=docx.oxml.styles

``<w:style>``元素,表示样式定义

property

1 base_style=<property object at 0x0000000003AB3F98> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
2 basedOn=<property object at 0x0000000003AB64A8> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
3 basedOn_val=<property object at 0x0000000003AB6048> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
4 customStyle=<property object at 0x0000000003AB6CC8> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
5 default=<property object at 0x0000000003AB6C78> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
6 locked=<property object at 0x0000000003AB6A98> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
7 locked_val=<property object at 0x0000000003AB60E8> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
8 name=<property object at 0x0000000003AB6458> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
9 name_val=<property object at 0x0000000003AB6138> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
10 next=<property object at 0x0000000003AB6548> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
11 next_style=<property object at 0x0000000003AB6098> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
12 pPr=<property object at 0x0000000003AB6B38> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
13 qFormat=<property object at 0x0000000003AB69F8> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
14 qFormat_val=<property object at 0x0000000003AB61D8> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
15 rPr=<property object at 0x0000000003AB6B88> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
16 semiHidden=<property object at 0x0000000003AB66D8> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
17 semiHidden_val=<property object at 0x0000000003AB6228> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
18 styleId=<property object at 0x0000000003AB6C28> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
19 type=<property object at 0x0000000003AB6BD8> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
20 uiPriority=<property object at 0x0000000003AB6598> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
21 uiPriority_val=<property object at 0x0000000003AB6278> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
22 unhideWhenUsed=<property object at 0x0000000003AB6818> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>
23 unhideWhenUsed_val=<property object at 0x0000000003AB62C8> kind:property type:property class:<class ‘docx.oxml.styles.CT_Style’>

method

24 delete()

kind=method class=CT_Style objtype=function

从它的父元素`w:styles`中删除这个`w:style`元素。

25 get_or_add_basedOn()

kind=method class=CT_Style objtype=function

返回``<w:basedOn>``子元素,如果不存在则新添加

26 get_or_add_locked()

kind=method class=CT_Style objtype=function

返回``<w:locked>``子元素,如果不存在则新添加。

27 get_or_add_name()

kind=method class=CT_Style objtype=function

返回``<w:name>``子元素,如果不存在则是新添加的子元素。

28 get_or_add_next()

kind=method class=CT_Style objtype=function

返回``<w:next>``子元素,如果不存在则新添加。

29 get_or_add_pPr()

kind=method class=CT_Style objtype=function

返回``<w:pPr>``子元素,如果不存在则是新添加的子元素。

30 get_or_add_qFormat()

kind=method class=CT_Style objtype=function

返回``<w:qFormat>``子元素,如果不存在则新添加。

31 get_or_add_rPr()

kind=method class=CT_Style objtype=function

返回``<w:rPr>``子元素,如果不存在则新添加。

32 get_or_add_semiHidden()

kind=method class=CT_Style objtype=function

返回``<w:semiHidden>``子元素,如果不存在则是新添加的子元素。

33 get_or_add_uiPriority()

kind=method class=CT_Style objtype=function

返回``<w:uiPriority>``子元素,如果不存在则新添加。

34 get_or_add_unhideWhenUsed()

kind=method class=CT_Style objtype=function

返回``<w:unhideWhenUsed>``子元素,如果不存在则新添加。

53 docx.oxml.styles.CT_Styles

CT_Styles, docx.oxml.styles.CT_Styles, module=docx.oxml.styles

``<w:styles>``元素,样式部分的根元素,即styles.xml

property

1 latentStyles=<property object at 0x0000000003AB6E58> kind:property type:property class:<class ‘docx.oxml.styles.CT_Styles’>
2 style_lst=<property object at 0x0000000003AC1098> kind:property type:property class:<class ‘docx.oxml.styles.CT_Styles’>

method

3 add_style()

kind=method class=CT_Styles objtype=function

无条件地添加一个新的``<w:style>`` 子元素,按正确的顺序插入。

4 add_style_of_type()

kind=method class=CT_Styles objtype=function

返回一个新添加的`w:style`元素,具有*name*和*style_type*。`w:style/@customStyle`是基于*builtin*的值设置的。

5 default_for()

kind=method class=CT_Styles objtype=function

如果没有,返回`w:style[@w:type="*{style_type}*][-1]`或|None|。

6 get_by_id()

kind=method class=CT_Styles objtype=function

返回具有styleId属性的``<w:style>`` 子元素,匹配*styleId*,或如果没有找到|None|。

7 get_by_name()

kind=method class=CT_Styles objtype=function

返回具有值为*name*的``<w:name>``的子元素的``<w:style>``,如果没有则返回 |None|。

8 get_or_add_latentStyles()

kind=method class=CT_Styles objtype=function

返回``<w:latentStyles>``子元素,如果不存在则新添加。

54 docx.oxml.table.CT_Height

CT_Height, docx.oxml.table.CT_Height, module=docx.oxml.table

用于``<w:trHeight>``指定行高和行高规则。

property

1 hRule=<property object at 0x0000000003AD6908> kind:property type:property class:<class ‘docx.oxml.table.CT_Height’>
2 val=<property object at 0x0000000003AD68B8> kind:property type:property class:<class ‘docx.oxml.table.CT_Height’>

55 docx.oxml.table.CT_Row

CT_Row, docx.oxml.table.CT_Row, module=docx.oxml.table

``<w:tr>`` 的元素

property

1 tblPrEx=<property object at 0x0000000003AD6AE8> kind:property type:property class:<class ‘docx.oxml.table.CT_Row’>
2 tc_lst=<property object at 0x0000000003AD6BD8> kind:property type:property class:<class ‘docx.oxml.table.CT_Row’>
3 trHeight_hRule=<property object at 0x0000000003AD69A8> kind:property type:property class:<class ‘docx.oxml.table.CT_Row’>
4 trHeight_val=<property object at 0x0000000003AD69F8> kind:property type:property class:<class ‘docx.oxml.table.CT_Row’>
5 trPr=<property object at 0x0000000003AD6B88> kind:property type:property class:<class ‘docx.oxml.table.CT_Row’>
6 tr_idx=<property object at 0x0000000003AD13B8> kind:property type:property class:<class ‘docx.oxml.table.CT_Row’>

method

7 add_tc()

kind=method class=CT_Row objtype=function

无条件地添加一个新的``<w:tc>``子元素,按正确的顺序插入。

8 get_or_add_tblPrEx()

kind=method class=CT_Row objtype=function

返回``<w:tblPrEx>``子元素,如果不存在则新添加。

9 get_or_add_trPr()

kind=method class=CT_Row objtype=function

返回``<w:trPr>``子元素,如果不存在则新添加。

10 tc_at_grid_col()

kind=method class=CT_Row objtype=function

``<w:tc>``元素出现在网格列*idx*。如果没有从该网格列开始的``w:tc``元素,则引发|ValueError|。

56 docx.oxml.table.CT_Tbl

CT_Tbl, docx.oxml.table.CT_Tbl, module=docx.oxml.table

``<w:tbl>``的元素

property

1 bidiVisual_val=<property object at 0x0000000003AD6CC8> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>
2 col_count=<property object at 0x0000000003AD6C78> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>
3 tblGrid=<property object at 0x0000000003AD6EF8> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>
4 tblPr=<property object at 0x0000000003AD6EA8> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>
5 tblStyle_val=<property object at 0x0000000003AD6D68> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>
6 tr_lst=<property object at 0x0000000003AD6F48> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>

method

7 add_tr()

kind=method class=CT_Tbl objtype=function

无条件地添加一个新的``<w:tr>``子元素,按正确的顺序插入。

8 iter_tcs()

kind=method class=CT_Tbl objtype=function

生成这个表中的每个`w:tc`元素,从左到右,从上到下。生成第一行中的每个单元格,然后生成第二行中的每个单元格,等等。

class method

9 new_tbl()

kind=class method class=CT_Tbl objtype=classmethod

57 docx.oxml.table.CT_TblGrid

CT_TblGrid, docx.oxml.table.CT_TblGrid, module=docx.oxml.table

元素``<w:tblGrid>``是``<w:tbl>``的子元素,包含``<w:gridCol>`` '元素,用于定义列数、宽度等。

property

1 gridCol_lst=<property object at 0x0000000003ADD0E8> kind:property type:property class:<class ‘docx.oxml.table.CT_TblGrid’>

method

2 add_gridCol()

kind=method class=CT_TblGrid objtype=function

无条件地添加一个新的``<w:gridCol>``子元素,按正确的顺序插入。

58 docx.oxml.table.CT_TblGridCol

CT_TblGridCol, docx.oxml.table.CT_TblGridCol, module=docx.oxml.table

元素``<w:gridCol>``是``<w:tblGrid>``的子元素,定义了一个表
列。

property

1 gridCol_idx=<property object at 0x0000000003ADD098> kind:property type:property class:<class ‘docx.oxml.table.CT_TblGridCol’>
2 w=<property object at 0x0000000003ADD278> kind:property type:property class:<class ‘docx.oxml.table.CT_TblGridCol’>

59 docx.oxml.table.CT_TblLayoutType

CT_TblLayoutType, docx.oxml.table.CT_TblLayoutType, module=docx.oxml.table

``<w:tblLayout>`` 元素,指定列宽度是固定的还是可以根据内容自动调整。

property

1 type=<property object at 0x0000000003ADD3B8> kind:property type:property class:<class ‘docx.oxml.table.CT_TblLayoutType’>

60 docx.oxml.table.CT_TblPr

CT_TblPr, docx.oxml.table.CT_TblPr, module=docx.oxml.table

元素``<w:tblPr>``, ``<w:tbl>``的子元素,保存定义表属性(如样式和边框)的子元素。

property

1 alignment=<property object at 0x0000000003ADD548> kind:property type:property class:<class ‘docx.oxml.table.CT_TblPr’>
2 autofit=<property object at 0x0000000003ADD598> kind:property type:property class:<class ‘docx.oxml.table.CT_TblPr’>
3 bidiVisual=<property object at 0x0000000003ADD818> kind:property type:property class:<class ‘docx.oxml.table.CT_TblPr’>
4 jc=<property object at 0x0000000003ADD958> kind:property type:property class:<class ‘docx.oxml.table.CT_TblPr’>
5 style=<property object at 0x0000000003ADD5E8> kind:property type:property class:<class ‘docx.oxml.table.CT_TblPr’>
6 tblLayout=<property object at 0x0000000003ADD9A8> kind:property type:property class:<class ‘docx.oxml.table.CT_TblPr’>
7 tblStyle=<property object at 0x0000000003ADD6D8> kind:property type:property class:<class ‘docx.oxml.table.CT_TblPr’>

method

8 get_or_add_bidiVisual()

kind=method class=CT_TblPr objtype=function

返回``<w:bidiVisual>``子元素,如果不存在则新添加。

9 get_or_add_jc()

kind=method class=CT_TblPr objtype=function

返回``<w:jc>``子元素,如果不存在则是新添加的子元素。

10 get_or_add_tblLayout()

kind=method class=CT_TblPr objtype=function

返回``<w:tblLayout>``子元素,如果不存在则新添加。

11 get_or_add_tblStyle()

kind=method class=CT_TblPr objtype=function

返回``<w:tblStyle>``子元素,如果不存在则新添加。

61 docx.oxml.table.CT_TblWidth

CT_TblWidth, docx.oxml.table.CT_TblWidth, module=docx.oxml.table

用于``<w:tblW>``和``<w:tcW>``元素和许多其他元素,以指定与表相关的宽度。

property

1 type=<property object at 0x0000000003ADDCC8> kind:property type:property class:<class ‘docx.oxml.table.CT_TblWidth’>
2 w=<property object at 0x0000000003ADDC78> kind:property type:property class:<class ‘docx.oxml.table.CT_TblWidth’>
3 width=<property object at 0x0000000003ADDB38> kind:property type:property class:<class ‘docx.oxml.table.CT_TblWidth’>

62 docx.oxml.table.CT_Tc

CT_Tc, docx.oxml.table.CT_Tc, module=docx.oxml.table

`w:tc`表单元格元素

property

1 bottom=<property object at 0x0000000003ADDD68> kind:property type:property class:<class ‘docx.oxml.table.CT_Tc’>
2 grid_span=<property object at 0x0000000003ADDE08> kind:property type:property class:<class ‘docx.oxml.table.CT_Tc’>
3 left=<property object at 0x0000000003ADDDB8> kind:property type:property class:<class ‘docx.oxml.table.CT_Tc’>
4 p_lst=<property object at 0x0000000003AE44A8> kind:property type:property class:<class ‘docx.oxml.table.CT_Tc’>
5 right=<property object at 0x0000000003ADDE58> kind:property type:property class:<class ‘docx.oxml.table.CT_Tc’>
6 tbl_lst=<property object at 0x0000000003AE44F8> kind:property type:property class:<class ‘docx.oxml.table.CT_Tc’>
7 tcPr=<property object at 0x0000000003AE4458> kind:property type:property class:<class ‘docx.oxml.table.CT_Tc’>
8 top=<property object at 0x0000000003ADDEA8> kind:property type:property class:<class ‘docx.oxml.table.CT_Tc’>
9 vMerge=<property object at 0x0000000003ADDF48> kind:property type:property class:<class ‘docx.oxml.table.CT_Tc’>
10 width=<property object at 0x0000000003ADDF98> kind:property type:property class:<class ‘docx.oxml.table.CT_Tc’>

method

11 add_p()

kind=method class=CT_Tc objtype=function

无条件地添加一个新的``<w:p>``子元素,按正确的顺序插入。

12 add_tbl()

kind=method class=CT_Tc objtype=function

无条件地添加一个新的``<w:tbl>``子元素,按正确的顺序插入。

13 clear_content()

kind=method class=CT_Tc objtype=function

删除所有内容子元素,保留``<w:tcPr>``元素(如果存在)。
注意,这将使``<w:tc>``元素处于无效状态,因为它至少不包含一个块级元素。由调用者来添加一个``<w:p>``子元素作为最后一个内容元素。

14 get_or_add_tcPr()

kind=method class=CT_Tc objtype=function

返回``<w:tcPr>``子元素,如果不存在则新添加。

15 iter_block_items()

kind=method class=CT_Tc objtype=function

生成对该单元格中每个块级内容元素的引用,按照它们出现的顺序。

16 merge()

kind=method class=CT_Tc objtype=function

返回一个新span的左上角``<w:tc>``元素,该新span由使用此tc元素和*other_tc*作为对角角定义的矩形区域合并而成。

class method

17 new()

kind=class method class=CT_Tc objtype=classmethod

63 docx.oxml.table.CT_TcPr

CT_TcPr, docx.oxml.table.CT_TcPr, module=docx.oxml.table

``<w:tcPr>``元素,定义表单元格属性

property

1 gridSpan=<property object at 0x0000000003AE48B8> kind:property type:property class:<class ‘docx.oxml.table.CT_TcPr’>
2 grid_span=<property object at 0x0000000003AE4688> kind:property type:property class:<class ‘docx.oxml.table.CT_TcPr’>
3 tcW=<property object at 0x0000000003AE4868> kind:property type:property class:<class ‘docx.oxml.table.CT_TcPr’>
4 vAlign=<property object at 0x0000000003AE4A98> kind:property type:property class:<class ‘docx.oxml.table.CT_TcPr’>
5 vAlign_val=<property object at 0x0000000003AE46D8> kind:property type:property class:<class ‘docx.oxml.table.CT_TcPr’>
6 vMerge=<property object at 0x0000000003AE49F8> kind:property type:property class:<class ‘docx.oxml.table.CT_TcPr’>
7 vMerge_val=<property object at 0x0000000003AE4728> kind:property type:property class:<class ‘docx.oxml.table.CT_TcPr’>
8 width=<property object at 0x0000000003AE4778> kind:property type:property class:<class ‘docx.oxml.table.CT_TcPr’>

method

9 get_or_add_gridSpan()

kind=method class=CT_TcPr objtype=function

返回``<w:gridSpan>``子元素,如果不存在则新添加。

10 get_or_add_tcW()

kind=method class=CT_TcPr objtype=function

返回``<w:tcW>``子元素,如果不存在则是新添加的子元素。

11 get_or_add_vAlign()

kind=method class=CT_TcPr objtype=function

返回``<w:vAlign>``子元素,如果不存在则新添加。

12 get_or_add_vMerge()

kind=method class=CT_TcPr objtype=function

返回``<w:vMerge>``子元素,如果不存在则新添加。

64 docx.oxml.table.CT_TrPr

CT_TrPr, docx.oxml.table.CT_TrPr, module=docx.oxml.table

``<w:trPr>``元素,定义表行属性

property

1 trHeight=<property object at 0x0000000003AE4CC8> kind:property type:property class:<class ‘docx.oxml.table.CT_TrPr’>
2 trHeight_hRule=<property object at 0x0000000003AE4B88> kind:property type:property class:<class ‘docx.oxml.table.CT_TrPr’>
3 trHeight_val=<property object at 0x0000000003AE4BD8> kind:property type:property class:<class ‘docx.oxml.table.CT_TrPr’>

method

4 get_or_add_trHeight()

kind=method class=CT_TrPr objtype=function

返回``<w:trHeight>``子元素,如果不存在则新添加。

65 docx.oxml.table.CT_VMerge

CT_VMerge, docx.oxml.table.CT_VMerge, module=docx.oxml.table

``<w:vMerge>``元素,指定单元格的垂直合并行为。

property

1 val=<property object at 0x0000000003AEC048> kind:property type:property class:<class ‘docx.oxml.table.CT_VMerge’>

66 docx.oxml.table.CT_VerticalJc

CT_VerticalJc, docx.oxml.table.CT_VerticalJc, module=docx.oxml.table

`w:vAlign`元素,指定单元格的垂直对齐。

property

1 val=<property object at 0x0000000003AE4EA8> kind:property type:property class:<class ‘docx.oxml.table.CT_VerticalJc’>

67 docx.oxml.text.font.CT_Color

CT_Color, docx.oxml.text.font.CT_Color, module=docx.oxml.text.font

`w:color`元素,指定字体和其他对象的颜色。

property

1 themeColor=<property object at 0x0000000003AFA048> kind:property type:property class:<class ‘docx.oxml.text.font.CT_Color’>
2 val=<property object at 0x0000000003AF69A8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_Color’>

68 docx.oxml.text.font.CT_Fonts

CT_Fonts, docx.oxml.text.font.CT_Fonts, module=docx.oxml.text.font

``<w:rFonts>``元素,指定各种语言类型的字体名称。

property

1 ascii=<property object at 0x0000000003B06B38> kind:property type:property class:<class ‘docx.oxml.text.font.CT_Fonts’>
2 hAnsi=<property object at 0x0000000003B06B88> kind:property type:property class:<class ‘docx.oxml.text.font.CT_Fonts’>

69 docx.oxml.text.font.CT_Highlight

CT_Highlight, docx.oxml.text.font.CT_Highlight, module=docx.oxml.text.font

`w:highlight` 元素,指定字体高亮/背景色。

property

1 val=<property object at 0x0000000003B06D18> kind:property type:property class:<class ‘docx.oxml.text.font.CT_Highlight’>

70 docx.oxml.text.font.CT_HpsMeasure

CT_HpsMeasure, docx.oxml.text.font.CT_HpsMeasure, module=docx.oxml.text.font

用于``<w:sz>`` '元素和其他元素,以半号half-points为单位指定字体大小。

property

1 val=<property object at 0x0000000003B06E58> kind:property type:property class:<class ‘docx.oxml.text.font.CT_HpsMeasure’>

71 docx.oxml.text.font.CT_RPr

CT_RPr, docx.oxml.text.font.CT_RPr, module=docx.oxml.text.font

``<w:rPr>``元素,包含一次运行的属性。

property

1 b=<property object at 0x0000000003AF7C28> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
2 bCs=<property object at 0x0000000003AF7C78> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
3 caps=<property object at 0x0000000003AF7D68> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
4 color=<property object at 0x0000000003B106D8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
5 cs=<property object at 0x0000000003B10A98> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
6 dstrike=<property object at 0x0000000003AF7F98> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
7 emboss=<property object at 0x0000000003B101D8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
8 highlight=<property object at 0x0000000003B107C8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
9 highlight_val=<property object at 0x0000000003AF7778> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
10 i=<property object at 0x0000000003AF7CC8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
11 iCs=<property object at 0x0000000003AF7D18> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
12 imprint=<property object at 0x0000000003B10278> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
13 noProof=<property object at 0x0000000003B10318> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
14 oMath=<property object at 0x0000000003B10C28> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
15 outline=<property object at 0x0000000003B10098> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
16 rFonts=<property object at 0x0000000003AF7B88> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
17 rFonts_ascii=<property object at 0x0000000003AF77C8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
18 rFonts_hAnsi=<property object at 0x0000000003AF7818> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
19 rStyle=<property object at 0x0000000003AF7AE8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
20 rtl=<property object at 0x0000000003B10A48> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
21 shadow=<property object at 0x0000000003B10138> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
22 smallCaps=<property object at 0x0000000003AF7DB8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
23 snapToGrid=<property object at 0x0000000003B103B8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
24 specVanish=<property object at 0x0000000003B10AE8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
25 strike=<property object at 0x0000000003AF7EF8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
26 style=<property object at 0x0000000003AF7868> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
27 subscript=<property object at 0x0000000003AF78B8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
28 superscript=<property object at 0x0000000003AF7908> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
29 sz=<property object at 0x0000000003B10778> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
30 sz_val=<property object at 0x0000000003AF7958> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
31 u=<property object at 0x0000000003B108B8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
32 u_val=<property object at 0x0000000003AF79A8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
33 vanish=<property object at 0x0000000003B104F8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
34 vertAlign=<property object at 0x0000000003B10908> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>
35 webHidden=<property object at 0x0000000003B10598> kind:property type:property class:<class ‘docx.oxml.text.font.CT_RPr’>

method

36 get_or_add_b()

kind=method class=CT_RPr objtype=function

返回``<w:b>``子元素,如果不存在则新添加。

37 get_or_add_bCs()

kind=method class=CT_RPr objtype=function

返回``<w:bCs>``子元素,如果不存在则为新添加的子元素。

38 get_or_add_caps()

kind=method class=CT_RPr objtype=function

返回``<w:caps>``子元素,如果不存在则是新添加的子元素。

39 get_or_add_color()

kind=method class=CT_RPr objtype=function

返回``<w:color>``子元素,如果不存在则为新添加的子元素。

40 get_or_add_cs()

kind=method class=CT_RPr objtype=function

返回``<w:cs>``子元素,如果不存在则是新添加的子元素。

41 get_or_add_dstrike()

kind=method class=CT_RPr objtype=function

返回``<w:dstrike>``子元素,如果不存在则新添加。

42 get_or_add_emboss()

kind=method class=CT_RPr objtype=function

返回``<w:emboss>``子元素,如果不存在则新添加。

43 get_or_add_highlight()

kind=method class=CT_RPr objtype=function

返回``<w:highlight>``子元素,如果不存在则新添加。

44 get_or_add_i()

kind=method class=CT_RPr objtype=function

返回``<w:i>``子元素,如果不存在则新添加。

45 get_or_add_iCs()

kind=method class=CT_RPr objtype=function

返回``<w:iCs>``子元素,如果不存在则是新添加的子元素。

46 get_or_add_imprint()

kind=method class=CT_RPr objtype=function

返回``<w:imprint>``子元素,如果不存在则新添加子元素。

47 get_or_add_noProof()

kind=method class=CT_RPr objtype=function

返回``<w:noProof>``子元素,如果不存在则新添加。

48 get_or_add_oMath()

kind=method class=CT_RPr objtype=function

返回``<w:oMath>``子元素,如果不存在则新添加。

49 get_or_add_outline()

kind=method class=CT_RPr objtype=function

返回``<w:outline>``子元素,如果不存在则新添加。

50 get_or_add_rFonts()

kind=method class=CT_RPr objtype=function

返回``<w:rFonts>``子元素,如果不存在则新添加。

51 get_or_add_rStyle()

kind=method class=CT_RPr objtype=function

返回``<w:rStyle>``子元素,如果不存在则新添加。

52 get_or_add_rtl()

kind=method class=CT_RPr objtype=function

返回``<w:rtl>``子元素,如果不存在则是新添加的子元素。

53 get_or_add_shadow()

kind=method class=CT_RPr objtype=function

返回``<w:shadow>``子元素,如果不存在则新添加。

54 get_or_add_smallCaps()

kind=method class=CT_RPr objtype=function

返回``<w:smallCaps>``子元素,如果不存在则新添加。

55 get_or_add_snapToGrid()

kind=method class=CT_RPr objtype=function

返回``<w:snapToGrid>``子元素,如果不存在则新添加。

56 get_or_add_specVanish()

kind=method class=CT_RPr objtype=function

返回``<w:specVanish>``子元素,如果不存在则新添加。

57 get_or_add_strike()

kind=method class=CT_RPr objtype=function

返回``<w:strike>``子元素,如果不存在则是新添加的子元素。

58 get_or_add_sz()

kind=method class=CT_RPr objtype=function

返回``<w:sz>``子元素,如果不存在则是新添加的子元素。

59 get_or_add_u()

kind=method class=CT_RPr objtype=function

返回``<w:u>``子元素,如果不存在则新添加。

60 get_or_add_vanish()

kind=method class=CT_RPr objtype=function

返回``<w:vanish>``子元素,如果不存在则新添加。

61 get_or_add_vertAlign()

kind=method class=CT_RPr objtype=function

返回``<w:vertAlign>``子元素,如果不存在则新添加。

62 get_or_add_webHidden()

kind=method class=CT_RPr objtype=function

返回``<w:webHidden>``子元素,如果不存在则新添加。

72 docx.oxml.text.font.CT_Underline

CT_Underline, docx.oxml.text.font.CT_Underline, module=docx.oxml.text.font

``<w:u>``元素,指定运行的下划线样式。

property

1 val=<property object at 0x0000000003B10CC8> kind:property type:property class:<class ‘docx.oxml.text.font.CT_Underline’>

73 docx.oxml.text.font.CT_VerticalAlignRun

CT_VerticalAlignRun, docx.oxml.text.font.CT_VerticalAlignRun, module=docx.oxml.text.font

``<w:vertAlign>``元素,指定下标或上标。

property

1 val=<property object at 0x0000000003B10F48> kind:property type:property class:<class ‘docx.oxml.text.font.CT_VerticalAlignRun’>

74 docx.oxml.text.paragraph.CT_P

CT_P, docx.oxml.text.paragraph.CT_P, module=docx.oxml.text.paragraph

``<w:p>``元素,包含段落的属性和文本。

property

1 alignment=<property object at 0x0000000003B1D368> kind:property type:property class:<class ‘docx.oxml.text.paragraph.CT_P’>
2 pPr=<property object at 0x0000000003B1D548> kind:property type:property class:<class ‘docx.oxml.text.paragraph.CT_P’>
3 r_lst=<property object at 0x0000000003B1D598> kind:property type:property class:<class ‘docx.oxml.text.paragraph.CT_P’>
4 style=<property object at 0x0000000003B1D3B8> kind:property type:property class:<class ‘docx.oxml.text.paragraph.CT_P’>

method

5 add_p_before()

kind=method class=CT_P objtype=function

返回一个新的``<w:p>``元素,直接插入到这个元素之前。

6 add_r()

kind=method class=CT_P objtype=function

无条件地添加一个新的``<w:r>``子元素,按正确的顺序插入。

7 clear_content()

kind=method class=CT_P objtype=function

删除所有子元素,除非存在``<w:pPr>``元素。

8 get_or_add_pPr()

kind=method class=CT_P objtype=function

返回``<w:pPr>``子元素,如果不存在则是新添加的子元素。

9 set_sectPr()

kind=method class=CT_P objtype=function

无条件地替换或添加*sectPr*作为孙子在正确的顺序。

75 docx.oxml.text.parfmt.CT_Ind

CT_Ind, docx.oxml.text.parfmt.CT_Ind, module=docx.oxml.text.parfmt

``<w:ind>``元素,指定段落缩进。

property

1 firstLine=<property object at 0x0000000003B25EF8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_Ind’>
2 hanging=<property object at 0x0000000003B25F48> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_Ind’>
3 left=<property object at 0x0000000003B25E58> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_Ind’>
4 right=<property object at 0x0000000003B25EA8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_Ind’>

76 docx.oxml.text.parfmt.CT_Jc

CT_Jc, docx.oxml.text.parfmt.CT_Jc, module=docx.oxml.text.parfmt

``<w:jc>``元素,指定段落对齐。

property

1 val=<property object at 0x0000000003B2A138> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_Jc’>

77 docx.oxml.text.parfmt.CT_PPr

CT_PPr, docx.oxml.text.parfmt.CT_PPr, module=docx.oxml.text.parfmt

``<w:pPr>``元素,包含段落属性。

property

1 first_line_indent=<property object at 0x0000000003B2A4F8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
2 ind=<property object at 0x0000000003B2E2C8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
3 ind_left=<property object at 0x0000000003B2A548> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
4 ind_right=<property object at 0x0000000003B2A598> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
5 jc=<property object at 0x0000000003B2E318> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
6 jc_val=<property object at 0x0000000003B2A5E8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
7 keepLines=<property object at 0x0000000003B2ABD8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
8 keepLines_val=<property object at 0x0000000003B2A638> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
9 keepNext=<property object at 0x0000000003B2AA98> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
10 keepNext_val=<property object at 0x0000000003B2A688> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
11 numPr=<property object at 0x0000000003B2E138> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
12 pStyle=<property object at 0x0000000003B2A9F8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
13 pageBreakBefore=<property object at 0x0000000003B2AD18> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
14 pageBreakBefore_val=<property object at 0x0000000003B2A6D8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
15 sectPr=<property object at 0x0000000003B2E368> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
16 spacing=<property object at 0x0000000003B2E228> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
17 spacing_after=<property object at 0x0000000003B2A728> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
18 spacing_before=<property object at 0x0000000003B2A778> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
19 spacing_line=<property object at 0x0000000003B2A7C8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
20 spacing_lineRule=<property object at 0x0000000003B2A818> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
21 style=<property object at 0x0000000003B2A868> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
22 tabs=<property object at 0x0000000003B2E1D8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
23 widowControl=<property object at 0x0000000003B2AEF8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>
24 widowControl_val=<property object at 0x0000000003B2A8B8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_PPr’>

method

25 get_or_add_ind()

kind=method class=CT_PPr objtype=function

返回``<w:ind>``子元素,如果不存在则新添加。

26 get_or_add_jc()

kind=method class=CT_PPr objtype=function

返回``<w:jc>``子元素,如果不存在则是新添加的子元素。

27 get_or_add_keepLines()

kind=method class=CT_PPr objtype=function

返回``<w: keepplines >``子元素,如果不存在则新添加。

28 get_or_add_keepNext()

kind=method class=CT_PPr objtype=function

返回``<w:keepNext>``子元素,如果不存在则新添加。

29 get_or_add_numPr()

kind=method class=CT_PPr objtype=function

返回``<w:numPr>``子元素,如果不存在则新添加。

30 get_or_add_pStyle()

kind=method class=CT_PPr objtype=function

返回``<w:pStyle>``子元素,如果不存在则新添加。

31 get_or_add_pageBreakBefore()

kind=method class=CT_PPr objtype=function

返回``<w:pageBreakBefore>``子元素,如果不存在则新添加。

32 get_or_add_sectPr()

kind=method class=CT_PPr objtype=function

返回``<w:sectPr>``子元素,如果不存在则新添加。

33 get_or_add_spacing()

kind=method class=CT_PPr objtype=function

返回``<w:spacing>``子元素,如果不存在则新添加。

34 get_or_add_tabs()

kind=method class=CT_PPr objtype=function

返回``<w:tabs>``子元素,如果不存在则新添加。

35 get_or_add_widowControl()

kind=method class=CT_PPr objtype=function

返回``<w:widowControl>``子元素,如果不存在则新添加。

78 docx.oxml.text.parfmt.CT_Spacing

CT_Spacing, docx.oxml.text.parfmt.CT_Spacing, module=docx.oxml.text.parfmt

``<w:spacing>``元素,指定段落间距属性,例如空格和行间距。

property

1 after=<property object at 0x0000000003B2E5E8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_Spacing’>
2 before=<property object at 0x0000000003B2E638> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_Spacing’>
3 line=<property object at 0x0000000003B2E688> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_Spacing’>
4 lineRule=<property object at 0x0000000003B2E6D8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_Spacing’>

79 docx.oxml.text.parfmt.CT_TabStop

CT_TabStop, docx.oxml.text.parfmt.CT_TabStop, module=docx.oxml.text.parfmt

``<w:tab>``元素,表示单个制表位。

property

1 leader=<property object at 0x0000000003B2E958> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_TabStop’>
2 pos=<property object at 0x0000000003B2E9A8> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_TabStop’>
3 val=<property object at 0x0000000003B2E908> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_TabStop’>

80 docx.oxml.text.parfmt.CT_TabStops

CT_TabStops, docx.oxml.text.parfmt.CT_TabStops, module=docx.oxml.text.parfmt

``<w:tabs>``元素,为已排序的制表符序列的容器。

property

1 tab_lst=<property object at 0x0000000003B2EB38> kind:property type:property class:<class ‘docx.oxml.text.parfmt.CT_TabStops’>

method

2 add_tab()

kind=method class=CT_TabStops objtype=function

无条件地添加一个新的``<w:tab>``子元素,按正确的顺序插入。

3 insert_tab_in_order()

kind=method class=CT_TabStops objtype=function

按*pos*顺序插入新创建的`w:tab`子元素。

81 docx.oxml.text.run.CT_Br

CT_Br, docx.oxml.text.run.CT_Br, module=docx.oxml.text.run

``<w:br>``元素,表示运行中的行、页或列换行。

property

1 clear=<property object at 0x0000000003B38728> kind:property type:property class:<class ‘docx.oxml.text.run.CT_Br’>
2 type=<property object at 0x0000000003B386D8> kind:property type:property class:<class ‘docx.oxml.text.run.CT_Br’>

82 docx.oxml.text.run.CT_R

CT_R, docx.oxml.text.run.CT_R, module=docx.oxml.text.run

``<w:r>``元素,包含运行的属性和文本。

property

1 br_lst=<property object at 0x0000000003B38BD8> kind:property type:property class:<class ‘docx.oxml.text.run.CT_R’>
2 cr_lst=<property object at 0x0000000003B38C28> kind:property type:property class:<class ‘docx.oxml.text.run.CT_R’>
3 drawing_lst=<property object at 0x0000000003B38CC8> kind:property type:property class:<class ‘docx.oxml.text.run.CT_R’>
4 rPr=<property object at 0x0000000003B38B38> kind:property type:property class:<class ‘docx.oxml.text.run.CT_R’>
5 style=<property object at 0x0000000003B38958> kind:property type:property class:<class ‘docx.oxml.text.run.CT_R’>
6 t_lst=<property object at 0x0000000003B38B88> kind:property type:property class:<class ‘docx.oxml.text.run.CT_R’>
7 tab_lst=<property object at 0x0000000003B38C78> kind:property type:property class:<class ‘docx.oxml.text.run.CT_R’>
8 text=<property object at 0x0000000003B389A8> kind:property type:property class:<class ‘docx.oxml.text.run.CT_R’>

method

9 add_br()

kind=method class=CT_R objtype=function

无条件地添加一个新的``<w:br>``子元素,按正确的顺序插入。

10 add_cr()

kind=method class=CT_R objtype=function

无条件地添加一个新的``<w:cr>``子元素,按正确的顺序插入。

11 add_drawing()

kind=method class=CT_R objtype=function

返回新添加的``CT_Drawing`` (``<w: Drawing >``)子元素,其子元素为*inline_or_anchor*。

12 add_t()

kind=method class=CT_R objtype=function

返回新添加的包含*text*的 ``<w:t>`` 元素。

13 add_tab()

kind=method class=CT_R objtype=function

无条件地添加一个新的``<w:tab>``子元素,按正确的顺序插入。

14 clear_content()

kind=method class=CT_R objtype=function

删除除``<w:rPr>``元素之外的所有子元素(如果存在)。

15 get_or_add_rPr()

kind=method class=CT_R objtype=function

返回``<w:rPr>``子元素,如果不存在则新添加。

83 docx.oxml.text.run.CT_Text

CT_Text, docx.oxml.text.run.CT_Text, module=docx.oxml.text.run

``<w:t>``元素,包含一次运行中的字符序列。

剩余

84 loader <_frozen_importlib_external.SourceFileLoader object at 0x00000000039F1A08>
85 spec ModuleSpec(name=‘docx.oxml’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x00000000039F1A08>, origin=‘…\lib\site-packages\docx\oxml\init.py’, submodule_search_locations=[‘…\lib\site-packages\docx\oxml’])
86 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
87 element_class_lookup <lxml.etree.ElementNamespaceClassLookup object at 0x00000000039FF368>
88 oxml_parser <lxml.etree.XMLParser object at 0x00000000039FB228>

统计

序号 类别 数量
4 str 4
6 list 1
8 dict 1
9 module 7
13 residual 3
14 system 9
16 all 16

【docx.parts】

parts, fullname=docx.parts, file=docx\parts_init_.py

常量

模块

1 docx.parts.image

image, fullname=docx.parts.image, file=docx\parts\image.py

映像部分的代理类,以及相关对象。

2 docx.parts.story

story, fullname=docx.parts.story, file=docx\parts\story.py

|BaseStoryPart|及相关对象

3 docx.parts.hdrftr

hdrftr, fullname=docx.parts.hdrftr, file=docx\parts\hdrftr.py

页眉和页脚部分对象

4 docx.parts.numbering

numbering, fullname=docx.parts.numbering, file=docx\parts\numbering.py

|NumberingPart|和密切相关的对象

5 docx.parts.settings

settings, fullname=docx.parts.settings, file=docx\parts\settings.py

|SettingsPart|和密切相关的对象

6 docx.parts.styles

styles, fullname=docx.parts.styles, file=docx\parts\styles.py

提供StylesPart和相关对象

7 docx.parts.document

document, fullname=docx.parts.document, file=docx\parts\document.py

|DocumentPart|和密切相关的对象

统计

序号 类别 数量
4 str 5
8 dict 1
10 class 7
11 function 1
13 residual 6
14 system 8
16 all 20

【docx.package】

package, fullname=docx.package, file=docx\package.py

包类和相关对象

函数

1 lazyproperty(f)

lazyproperty(f), module=docx.shared, line:158 at site-packages\docx\shared.py

@lazyprop装饰。方法将只在第一次访问时调用,以计算缓存的属性值。之后,返回缓存的值。

2 docx.image.image.Image

Image, docx.image.image.Image, module=docx.image.image

图形图像流,如JPEG、PNG或GIF,具有ImagePart所需的属性和方法。

property

1 blob=<property object at 0x0000000003923EA8> kind:property type:property class:<class ‘docx.image.image.Image’>
2 content_type=<property object at 0x0000000003923EF8> kind:property type:property class:<class ‘docx.image.image.Image’>
3 ext=<property object at 0x0000000003931D18> kind:property type:property class:<class ‘docx.image.image.Image’>
4 filename=<property object at 0x0000000003931D68> kind:property type:property class:<class ‘docx.image.image.Image’>
5 height=<property object at 0x0000000003931F48> kind:property type:property class:<class ‘docx.image.image.Image’>
6 horz_dpi=<property object at 0x0000000003931E58> kind:property type:property class:<class ‘docx.image.image.Image’>
7 px_height=<property object at 0x0000000003931E08> kind:property type:property class:<class ‘docx.image.image.Image’>
8 px_width=<property object at 0x0000000003931DB8> kind:property type:property class:<class ‘docx.image.image.Image’>
9 sha1=<property object at 0x0000000003931F98> kind:property type:property class:<class ‘docx.image.image.Image’>
10 vert_dpi=<property object at 0x0000000003931EA8> kind:property type:property class:<class ‘docx.image.image.Image’>
11 width=<property object at 0x0000000003931EF8> kind:property type:property class:<class ‘docx.image.image.Image’>

method

12 scaled_dimensions()

kind=method class=Image objtype=function

返回一个(cx, cy) 2元组,表示通过对*width*和*height*应用以下规则缩放的图像的原始尺寸。
如果同时指定了*width*和*height*,则返回值为(*width*, *height*);不进行伸缩。
如果只指定了一个,它将用于计算缩放因子,然后应用于未指定的维度,保留图像的纵横比。如果*width*和*height*都为|None|,返回原始维度。
本机尺寸是使用嵌入在图像中的点/英寸(dpi)值计算的,默认值为72Dpi,如果没有指定值,这是通常的情况。返回值都是|Length|对象。

class method

13 from_blob()

kind=class method class=Image objtype=classmethod

14 from_file()

kind=class method class=Image objtype=classmethod

3 docx.opc.constants.RELATIONSHIP_TYPE

RELATIONSHIP_TYPE, docx.opc.constants.RELATIONSHIP_TYPE, module=docx.opc.constants

data

1 AUDIO kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
2 A_F_CHUNK kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
3 CALC_CHAIN kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
4 CERTIFICATE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
5 CHART kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
6 CHARTSHEET kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
7 CHART_USER_SHAPES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
8 COMMENTS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
9 COMMENT_AUTHORS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
10 CONNECTIONS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
11 CONTROL kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
12 CORE_PROPERTIES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
13 CUSTOM_PROPERTIES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
14 CUSTOM_PROPERTY kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
15 CUSTOM_XML kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
16 CUSTOM_XML_PROPS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
17 DIAGRAM_COLORS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
18 DIAGRAM_DATA kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
19 DIAGRAM_LAYOUT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
20 DIAGRAM_QUICK_STYLE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
21 DIALOGSHEET kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
22 DRAWING kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
23 ENDNOTES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
24 EXTENDED_PROPERTIES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
25 EXTERNAL_LINK kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
26 FONT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
27 FONT_TABLE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
28 FOOTER kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
29 FOOTNOTES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
30 GLOSSARY_DOCUMENT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
31 HANDOUT_MASTER kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
32 HEADER kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
33 HYPERLINK kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
34 IMAGE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
35 NOTES_MASTER kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
36 NOTES_SLIDE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
37 NUMBERING kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
38 OFFICE_DOCUMENT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
39 OLE_OBJECT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
40 ORIGIN kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
41 PACKAGE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
42 PIVOT_CACHE_DEFINITION kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
43 PIVOT_CACHE_RECORDS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
44 PIVOT_TABLE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
45 PRES_PROPS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
46 PRINTER_SETTINGS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
47 QUERY_TABLE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
48 REVISION_HEADERS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
49 REVISION_LOG kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
50 SETTINGS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
51 SHARED_STRINGS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
52 SHEET_METADATA kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
53 SIGNATURE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
54 SLIDE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
55 SLIDE_LAYOUT kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
56 SLIDE_MASTER kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
57 SLIDE_UPDATE_INFO kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
58 STYLES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
59 TABLE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
60 TABLE_SINGLE_CELLS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
61 TABLE_STYLES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
62 TAGS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
63 THEME kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
64 THEME_OVERRIDE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
65 THUMBNAIL kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
66 USERNAMES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
67 VIDEO kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
68 VIEW_PROPS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
69 VML_DRAWING kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
70 VOLATILE_DEPENDENCIES kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
71 WEB_SETTINGS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
72 WORKSHEET_SOURCE kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>
73 XML_MAPS kind:data type:str class:<class ‘docx.opc.constants.RELATIONSHIP_TYPE’>

4 docx.opc.package.OpcPackage

OpcPackage, docx.opc.package.OpcPackage, module=docx.opc.package

主要API类, 关于|python-opc|。通过调用:meth:`open`类方法构造一个新实例,该方法带有一个包文件或包含包文件的类文件对象的路径。

property

1 core_properties=<property object at 0x00000000039567C8> kind:property type:property class:<class ‘docx.opc.package.OpcPackage’>
2 main_document_part=<property object at 0x0000000003956818> kind:property type:property class:<class ‘docx.opc.package.OpcPackage’>
3 parts=<property object at 0x0000000003B587C8> kind:property type:property class:<class ‘docx.opc.package.OpcPackage’>
4 rels=<property object at 0x0000000003B58818> kind:property type:property class:<class ‘docx.opc.package.OpcPackage’>

method

5 after_unmarshal()

kind=method class=OpcPackage objtype=function

任何解组后处理的入口点。可能会被覆盖, 通过子类不转发调用到super。

6 iter_parts()

kind=method class=OpcPackage objtype=function

通过对rels图执行深度优先遍历,生成对包中每个部分的精确引用。

7 iter_rels()

kind=method class=OpcPackage objtype=function

通过对rels图执行深度优先遍历,生成对包中每个关系的精确引用。

8 load_rel()

kind=method class=OpcPackage objtype=function

返回新添加的|_Relationship|此部分与*target*之间的*reltype*关系实例,键为*rId*。
目标模式设置为``RTM.EXTERNAL`` ,如果 *is_external* 为 |True|。
用于从序列化包加载期间使用,其中rId是众所周知的。还有其他方法用于在处理期间向包添加新的关系。

9 next_partname()

kind=method class=OpcPackage objtype=function

返回一个|PackURI|实例,表示partname匹配*template*。
返回的部件名称具有下一个可用的数字后缀,以将其与该类型的其他部件区分开来。
*template*是一个printf(%)样式的模板字符串,包含一个替换项,'%d'用于插入partname的整数部分。示例:"/word/header%d.xml"

10 part_related_by()

kind=method class=OpcPackage objtype=function

返回该包与之具有*reltype*关系的部分。如果没有找到这样的关系,则引发|KeyError|;如果找到多个这样的关系,则引发|ValueError|。

11 relate_to()

kind=method class=OpcPackage objtype=function

返回关系的rId键到*part*,如果有,则从现有关系返回,否则为新创建的关系。

12 save()

kind=method class=OpcPackage objtype=function

将此包保存到*pkg_file*,其中*file*可以是文件(字符串)的路径或类文件对象。

class method

13 open()

kind=class method class=OpcPackage objtype=classmethod

5 docx.opc.packuri.PackURI

PackURI, docx.opc.packuri.PackURI, module=docx.opc.packuri

提供对包URI组件(如baseURI和文件名切片)的访问。否则表现为|str|。

property

1 baseURI=<property object at 0x00000000039606D8> kind:property type:property class:<class ‘docx.opc.packuri.PackURI’>
2 ext=<property object at 0x0000000003960728> kind:property type:property class:<class ‘docx.opc.packuri.PackURI’>
3 filename=<property object at 0x0000000003960778> kind:property type:property class:<class ‘docx.opc.packuri.PackURI’>
4 idx=<property object at 0x00000000039607C8> kind:property type:property class:<class ‘docx.opc.packuri.PackURI’>
5 membername=<property object at 0x0000000003960818> kind:property type:property class:<class ‘docx.opc.packuri.PackURI’>
6 rels_uri=<property object at 0x0000000003960868> kind:property type:property class:<class ‘docx.opc.packuri.PackURI’>

method

7 relative_ref()

kind=method class=PackURI objtype=function

从*baseURI*返回包含包项的相对引用的字符串。
例如,PackURI('/ppt/slideLayouts/slideLayout1.xml')将为baseURI '/ppt/slides'返回'../slideLayouts/slideLayout1.xml'。

static method

8 from_rel_ref()

kind=static method class=PackURI objtype=staticmethod

6 docx.parts.image.ImagePart

ImagePart, docx.parts.image.ImagePart, module=docx.parts.image

图像部分。对应关系的目标部分,类型为RELATIONSHIP_TYPE.IMAGE。

property

1 default_cx=<property object at 0x0000000003B5D1D8> kind:property type:property class:<class ‘docx.parts.image.ImagePart’>
2 default_cy=<property object at 0x0000000003B5D228> kind:property type:property class:<class ‘docx.parts.image.ImagePart’>
3 filename=<property object at 0x0000000003B5D278> kind:property type:property class:<class ‘docx.parts.image.ImagePart’>
4 image=<property object at 0x0000000003B5D2C8> kind:property type:property class:<class ‘docx.parts.image.ImagePart’>
5 sha1=<property object at 0x0000000003B5D318> kind:property type:property class:<class ‘docx.parts.image.ImagePart’>

class method

6 from_image()

kind=class method class=ImagePart objtype=classmethod

7 load()

kind=class method class=ImagePart objtype=classmethod

7 docx.package.Package

Package, docx.package.Package, module=docx.package

特定于WordprocessingML包的定制

property

1 image_parts=<property object at 0x0000000003915598> kind:property type:property class:<class ‘docx.package.Package’>

method

2 after_unmarshal()

kind=method class=Package objtype=function

在加载所有部件和关系后通过加载代码调用。这种方法为任何所需的后处理提供了机会。

3 get_or_add_image_part()

kind=method class=Package objtype=function

返回|ImagePart|,包含*image_descriptor*指定的图像。如果集合中还没有匹配的图像部分,则新创建图像部分。

8 docx.package.ImageParts

ImageParts, docx.package.ImageParts, module=docx.package

|ImagePart|对象的集合,对应于包中的图像

method

1 append()

kind=method class=ImageParts objtype=function

2 get_or_add_image_part()

kind=method class=ImageParts objtype=function

返回|ImagePart|对象,包含由 *image_descriptor* 标识的图像。如果集合中不存在匹配的图像部分,则新创建图像部分。

剩余

9 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003913FC8>
10 spec ModuleSpec(name=‘docx.package’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003913FC8>, origin=‘…\lib\site-packages\docx\package.py’)
11 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
12 division _Feature((2, 2, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 8192)
13 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
14 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
8 dict 1
9 module 1
10 class 2
11 function 2
13 residual 5
14 system 8
15 private 1
16 all 16

【docx.api】

api, fullname=docx.api, file=docx\api.py

直接公开API函数和类:func:`Document`。提供一个语法上更方便的API来与OpcPackage图交互。

模块

1 os

os, fullname=os, file=os.py

参见:os 模块

函数

2 Document(docx=None)

Document(docx=None), module=docx.api, line:17 at site-packages\docx\api.py

返回一个从*docx*加载的|Document|对象,其中*docx*可以是一个``.docx``文件(字符串)的路径或一个类文件对象。如果*docx*缺失或“None”,则加载内置的默认文档“template”。

3 _default_docx_path()

_default_docx_path(), module=docx.api, line:32 at site-packages\docx\api.py

返回内置默认.docx包的路径。

4 docx.opc.constants.CONTENT_TYPE

CONTENT_TYPE, docx.opc.constants.CONTENT_TYPE, module=docx.opc.constants

内容类型URIs(如mime类型)指定部件的格式

data

1 BMP=image/bmp kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
2 DML_CHART=application/vnd.openxmlformats-officedocument.drawingml.chart+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
3 DML_CHARTSHAPES=application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
4 DML_DIAGRAM_COLORS=application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
5 DML_DIAGRAM_DATA=application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
6 DML_DIAGRAM_LAYOUT=application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
7 DML_DIAGRAM_STYLE=application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
8 GIF=image/gif kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
9 JPEG=image/jpeg kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
10 MS_PHOTO=image/vnd.ms-photo kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
11 OFC_CUSTOM_PROPERTIES=application/vnd.openxmlformats-officedocument.custom-properties+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
12 OFC_CUSTOM_XML_PROPERTIES=application/vnd.openxmlformats-officedocument.customXmlProperties+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
13 OFC_DRAWING=application/vnd.openxmlformats-officedocument.drawing+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
14 OFC_EXTENDED_PROPERTIES=application/vnd.openxmlformats-officedocument.extended-properties+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
15 OFC_OLE_OBJECT=application/vnd.openxmlformats-officedocument.oleObject kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
16 OFC_PACKAGE=application/vnd.openxmlformats-officedocument.package kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
17 OFC_THEME=application/vnd.openxmlformats-officedocument.theme+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
18 OFC_THEME_OVERRIDE=application/vnd.openxmlformats-officedocument.themeOverride+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
19 OFC_VML_DRAWING=application/vnd.openxmlformats-officedocument.vmlDrawing kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
20 OPC_CORE_PROPERTIES=application/vnd.openxmlformats-package.core-properties+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
21 OPC_DIGITAL_SIGNATURE_CERTIFICATE=application/vnd.openxmlformats-package.digital-signature-certificate kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
22 OPC_DIGITAL_SIGNATURE_ORIGIN=application/vnd.openxmlformats-package.digital-signature-origin kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
23 OPC_DIGITAL_SIGNATURE_XMLSIGNATURE=application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
24 OPC_RELATIONSHIPS=application/vnd.openxmlformats-package.relationships+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
25 PML_COMMENTS=application/vnd.openxmlformats-officedocument.presentationml.comments+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
26 PML_COMMENT_AUTHORS=application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
27 PML_HANDOUT_MASTER=application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
28 PML_NOTES_MASTER=application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
29 PML_NOTES_SLIDE=application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
30 PML_PRESENTATION_MAIN=application/vnd.openxmlformats-officedocument.presentationml.presentation.main+x… kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
31 PML_PRES_PROPS=application/vnd.openxmlformats-officedocument.presentationml.presProps+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
32 PML_PRINTER_SETTINGS=application/vnd.openxmlformats-officedocument.presentationml.printerSettings kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
33 PML_SLIDE=application/vnd.openxmlformats-officedocument.presentationml.slide+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
34 PML_SLIDESHOW_MAIN=application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
35 PML_SLIDE_LAYOUT=application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
36 PML_SLIDE_MASTER=application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
37 PML_SLIDE_UPDATE_INFO=application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
38 PML_TABLE_STYLES=application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
39 PML_TAGS=application/vnd.openxmlformats-officedocument.presentationml.tags+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
40 PML_TEMPLATE_MAIN=application/vnd.openxmlformats-officedocument.presentationml.template.main+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
41 PML_VIEW_PROPS=application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
42 PNG=image/png kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
43 SML_CALC_CHAIN=application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
44 SML_CHARTSHEET=application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
45 SML_COMMENTS=application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
46 SML_CONNECTIONS=application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
47 SML_CUSTOM_PROPERTY=application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
48 SML_DIALOGSHEET=application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
49 SML_EXTERNAL_LINK=application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
50 SML_PIVOT_CACHE_DEFINITION=application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition… kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
51 SML_PIVOT_CACHE_RECORDS=application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xm… kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
52 SML_PIVOT_TABLE=application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
53 SML_PRINTER_SETTINGS=application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
54 SML_QUERY_TABLE=application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
55 SML_REVISION_HEADERS=application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
56 SML_REVISION_LOG=application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
57 SML_SHARED_STRINGS=application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
58 SML_SHEET=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
59 SML_SHEET_MAIN=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
60 SML_SHEET_METADATA=application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
61 SML_STYLES=application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
62 SML_TABLE=application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
63 SML_TABLE_SINGLE_CELLS=application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
64 SML_TEMPLATE_MAIN=application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
65 SML_USER_NAMES=application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
66 SML_VOLATILE_DEPENDENCIES=application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies… kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
67 SML_WORKSHEET=application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
68 TIFF=image/tiff kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
69 WML_COMMENTS=application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
70 WML_DOCUMENT=application/vnd.openxmlformats-officedocument.wordprocessingml.document kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
71 WML_DOCUMENT_GLOSSARY=application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary… kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
72 WML_DOCUMENT_MAIN=application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
73 WML_ENDNOTES=application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
74 WML_FONT_TABLE=application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
75 WML_FOOTER=application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
76 WML_FOOTNOTES=application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
77 WML_HEADER=application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
78 WML_NUMBERING=application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
79 WML_PRINTER_SETTINGS=application/vnd.openxmlformats-officedocument.wordprocessingml.printerSettings kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
80 WML_SETTINGS=application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
81 WML_STYLES=application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
82 WML_WEB_SETTINGS=application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
83 XML=application/xml kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
84 X_EMF=image/x-emf kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
85 X_FONTDATA=application/x-fontdata kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
86 X_FONT_TTF=application/x-font-ttf kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>
87 X_WMF=image/x-wmf kind:data type:str class:<class ‘docx.opc.constants.CONTENT_TYPE’>

5 docx.package.Package

Package, docx.package.Package, module=docx.package

特定于WordprocessingML包的定制

property

1 image_parts=<property object at 0x0000000003915598> kind:property type:property class:<class ‘docx.package.Package’>

method

2 after_unmarshal()

kind=method class=Package objtype=function

在加载所有部件和关系后通过加载代码调用。这种方法为任何所需的后处理提供了机会。

3 get_or_add_image_part()

kind=method class=Package objtype=function

返回|ImagePart|,包含*image_descriptor*指定的图像。如果集合中还没有匹配的图像部分,则新创建图像部分。

私有或局部

6 _default_docx_path <function _default_docx_path at 0x0000000003911B88>

剩余

7 loader <_frozen_importlib_external.SourceFileLoader object at 0x00000000038EE8C8>
8 spec ModuleSpec(name=‘docx.api’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x00000000038EE8C8>, origin=‘…\lib\site-packages\docx\api.py’)
9 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
10 division _Feature((2, 2, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 8192)
11 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)

统计

序号 类别 数量
4 str 4
6 list 1
8 dict 1
9 module 5
13 residual 3
14 system 9
16 all 14

【docx.text】

text, fullname=docx.text, file=docx\text_init_.py

模块

1 docx.text.tabstops

tabstops, fullname=docx.text.tabstops, file=docx\text\tabstops.py

选项卡相关的代理类型。

2 docx.text.parfmt

parfmt, fullname=docx.text.parfmt, file=docx\text\parfmt.py

与段落相关的代理类型。

3 docx.text.font

font, fullname=docx.text.font, file=docx\text\font.py

与字体相关的代理对象。

4 docx.text.run

run, fullname=docx.text.run, file=docx\text\run.py

运行python-docx的相关代理对象,特别是Run。

5 docx.text.paragraph

paragraph, fullname=docx.text.paragraph, file=docx\text\paragraph.py

与段落相关的代理类型。

统计

序号 类别 数量
4 str 4
6 list 1
8 dict 1
9 module 1
13 residual 3
14 system 9
16 all 10

【docx.dml】

dml, fullname=docx.dml, file=docx\dml_init_.py

模块

1 docx.dml.color

color, fullname=docx.dml.color, file=docx\dml\color.py

DrawingML对象与颜色相关,ColorFormat是最突出的。

统计

序号 类别 数量
4 str 5
8 dict 2
10 class 4
13 residual 6
14 system 8
16 all 17

【docx.shape】

shape, fullname=docx.shape, file=docx\shape.py

与形状相关的对象,出现在文档的绘图层上的可视对象。

常量

dict

1 nsmap {‘a’: main, ‘c’: 'http://sche…

2 docx.enum.shape.WD_INLINE_SHAPE_TYPE

WD_INLINE_SHAPE_TYPE, docx.enum.shape.WD_INLINE_SHAPE_TYPE, module=docx.enum.shape

对应于 [WdInlineShapeType枚举](http://msdn.microsoft.com/en-us/library/office/ff192587.aspx)

data

1 CHART=12 kind:data type:int class:<class ‘docx.enum.shape.WD_INLINE_SHAPE_TYPE’>
2 LINKED_PICTURE=4 kind:data type:int class:<class ‘docx.enum.shape.WD_INLINE_SHAPE_TYPE’>
3 NOT_IMPLEMENTED=-6 kind:data type:int class:<class ‘docx.enum.shape.WD_INLINE_SHAPE_TYPE’>
4 PICTURE=3 kind:data type:int class:<class ‘docx.enum.shape.WD_INLINE_SHAPE_TYPE’>
5 SMART_ART=15 kind:data type:int class:<class ‘docx.enum.shape.WD_INLINE_SHAPE_TYPE’>

3 docx.shared.Parented

Parented, docx.shared.Parented, module=docx.shared

为部分下面出现的文档元素提供公共服务,但偶尔可能需要一个祖先对象来提供服务,例如添加或删除关系。提供了``self._parent``属性给子类。

property

1 part=<property object at 0x0000000003931B88> kind:property type:property class:<class ‘docx.shared.Parented’>

4 docx.shape.InlineShapes

InlineShapes, docx.shape.InlineShapes, module=docx.shape

|InlineShape|实例序列,支持len(),迭代和索引访问。

5 docx.shape.InlineShape

InlineShape, docx.shape.InlineShape, module=docx.shape

``<wp:inline>``元素的代理,表示内联图形对象的容器。

property

1 height=<property object at 0x0000000003B879A8> kind:property type:property class:<class ‘docx.shape.InlineShape’>
2 type=<property object at 0x0000000003B87908> kind:property type:property class:<class ‘docx.shape.InlineShape’>
3 width=<property object at 0x0000000003B87A48> kind:property type:property class:<class ‘docx.shape.InlineShape’>

剩余

6 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003B82B48>
7 spec ModuleSpec(name=‘docx.shape’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003B82B48>, origin=‘…\lib\site-packages\docx\shape.py’)
8 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
9 division _Feature((2, 2, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 8192)
10 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
11 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
8 dict 1
10 class 4
13 residual 6
14 system 8
16 all 16

【docx.blkcntnr】

blkcntnr, fullname=docx.blkcntnr, file=docx\blkcntnr.py

块项目容器,用于主体,单元格,标题等。块级项目包括段落和表格,尽管还有其他一些特殊的项目,如结构化文档标记。

1 docx.oxml.table.CT_Tbl

CT_Tbl, docx.oxml.table.CT_Tbl, module=docx.oxml.table

``<w:tbl>``元素

property

1 bidiVisual_val=<property object at 0x0000000003AD6CC8> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>
2 col_count=<property object at 0x0000000003AD6C78> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>
3 tblGrid=<property object at 0x0000000003AD6EF8> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>
4 tblPr=<property object at 0x0000000003AD6EA8> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>
5 tblStyle_val=<property object at 0x0000000003AD6D68> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>
6 tr_lst=<property object at 0x0000000003AD6F48> kind:property type:property class:<class ‘docx.oxml.table.CT_Tbl’>

method

7 add_tr()

kind=method class=CT_Tbl objtype=function

无条件地添加一个新的``<w:tr>``子元素,按正确的顺序插入。

8 iter_tcs()

kind=method class=CT_Tbl objtype=function

生成这个表中的每个`w:tc`元素,从左到右,从上到下。生成第一行中的每个单元格,然后生成第二行中的每个单元格,等等。

class method

9 new_tbl()

kind=class method class=CT_Tbl objtype=classmethod

2 docx.shared.Parented

Parented, docx.shared.Parented, module=docx.shared

为部分下面出现的文档元素提供公共服务,但偶尔可能需要一个祖先对象来提供服务,例如添加或删除关系。提供了``self._parent``子类的父属性。

property

1 part=<property object at 0x0000000003931B88> kind:property type:property class:<class ‘docx.shared.Parented’>

3 docx.text.paragraph.Paragraph

Paragraph, docx.text.paragraph.Paragraph, module=docx.text.paragraph

代理对象包装``<w:p>``元素。

property

1 alignment=<property object at 0x0000000003B68F48> kind:property type:property class:<class ‘docx.text.paragraph.Paragraph’>
2 paragraph_format=<property object at 0x0000000003B68EA8> kind:property type:property class:<class ‘docx.text.paragraph.Paragraph’>
3 runs=<property object at 0x0000000003B78A48> kind:property type:property class:<class ‘docx.text.paragraph.Paragraph’>
4 style=<property object at 0x0000000003B87E08> kind:property type:property class:<class ‘docx.text.paragraph.Paragraph’>
5 text=<property object at 0x0000000003B87E58> kind:property type:property class:<class ‘docx.text.paragraph.Paragraph’>

method

6 add_run()

kind=method class=Paragraph objtype=function

附加一个运行到包含*text*的段落,并具有由样式ID *style*标识的字符样式。
*text*可以包含制表符(``\t``)字符,这些字符被转换为制表符的适当XML形式。
*text*也可以包含换行符(``\n``)或回车符(``\r``)字符,每个字符都转换为换行符。

7 clear()

kind=method class=Paragraph objtype=function

删除该段的所有内容后返回该段。保留段落级格式,如样式。

8 insert_paragraph_before()

kind=method class=Paragraph objtype=function

返回一个新创建的段落,直接插入到此段落之前。如果提供了*text*,新段落将在一次运行中包含该文本。如果提供了*style*,则将该样式分配给新段落。

4 docx.blkcntnr.BlockItemContainer

BlockItemContainer, docx.blkcntnr.BlockItemContainer, module=docx.blkcntnr

可包含块项的代理对象的基类。这些容器包括Body、Cell、页眉、页脚、脚注、尾注、注释和文本框对象。提供用于添加块项(如段落或表)的共享功能。

property

1 paragraphs=<property object at 0x0000000002C6B3B8> kind:property type:property class:<class ‘docx.blkcntnr.BlockItemContainer’>
2 tables=<property object at 0x0000000003B68368> kind:property type:property class:<class ‘docx.blkcntnr.BlockItemContainer’>

method

3 add_paragraph()

kind=method class=BlockItemContainer objtype=function

返回新添加到此内容末尾的段落容器,如果存在,则在一次运行中具有*text*段落风格*风格*。
如果*style*为|None|,则没有段落样式应用,这与应用“Normal”样式有相同的效果。

4 add_table()

kind=method class=BlockItemContainer objtype=function

返回一个*width*的表,包含*rows* rows和*cols*列,新添加到容器的内容中。*width*均匀分布在表列之间。

剩余

5 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003B63EC8>
6 spec ModuleSpec(name=‘docx.blkcntnr’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003B63EC8>, origin=‘…\lib\site-packages\docx\blkcntnr.py’)
7 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
8 division _Feature((2, 2, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 8192)
9 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
10 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
8 dict 1
10 class 8
11 function 1
13 residual 6
14 system 8
15 private 3
16 all 21

【docx.section】

section, fullname=docx.section, file=docx\section.py

|Section|对象和相关的代理类The |Section| object and related proxy classes

函数

1 lazyproperty(f)

lazyproperty(f), module=docx.shared, line:158 at site-packages\docx\shared.py

@lazyprop装饰。方法将只在第一次访问时调用,以计算缓存的属性值。之后,返回缓存的值。

2 docx.blkcntnr.BlockItemContainer

BlockItemContainer, docx.blkcntnr.BlockItemContainer, module=docx.blkcntnr

可包含块项的代理对象的基类。这些容器包括Body、Cell、页眉、页脚、脚注、尾注、注释和文本框对象。提供用于添加块项(如段落或表)的共享功能。

property

1 paragraphs=<property object at 0x0000000002C6B3B8> kind:property type:property class:<class ‘docx.blkcntnr.BlockItemContainer’>
2 tables=<property object at 0x0000000003B68368> kind:property type:property class:<class ‘docx.blkcntnr.BlockItemContainer’>

method

3 add_paragraph()

kind=method class=BlockItemContainer objtype=function

返回一个新添加到此容器内容末尾的段落,如果存在,则在一次运行中具有*text*,并且具有段落样式*style*。
如果*style*为|None|,则不应用任何段落样式,其效果与应用'Normal'样式相同。

4 add_table()

kind=method class=BlockItemContainer objtype=function

返回一个*width*的表,包含*rows* rows和*cols*列,新添加到容器的内容中。*width*均匀分布在表列之间。

3 collections.abc.Sequence

Sequence, collections.abc.Sequence, module=collections.abc, line:-1 at collections\abc.py

对只读序列的所有操作。具体的子类必须重写__new__ 或 __init__, __getitem__, 和 __len__。

method

1 count()

kind=method class=Sequence objtype=function

S.count(value) -> integer -返回值的出现次数

2 index()

kind=method class=Sequence objtype=function

S.index(value, [start, [stop]]) -> integer
-返回值的第一个索引。如果值不存在则引发ValueError。支持start和stop参数是可选的,但推荐使用。

4 docx.enum.section.WD_HEADER_FOOTER_INDEX

WD_HEADER_FOOTER_INDEX, docx.enum.section.WD_HEADER_FOOTER_INDEX, module=docx.enum.section

别名: **WD_HEADER_FOOTER**指定一个section的三个可能的页眉/页脚定义之一。
只供内部使用;不是python-docx API的一部分。

data

1 EVEN_PAGE=EVEN_PAGE (3) kind:data type:EnumValue class:<class ‘docx.enum.section.WD_HEADER_FOOTER_INDEX’>
2 FIRST_PAGE=FIRST_PAGE (2) kind:data type:EnumValue class:<class ‘docx.enum.section.WD_HEADER_FOOTER_INDEX’>
3 PRIMARY=PRIMARY (1) kind:data type:EnumValue class:<class ‘docx.enum.section.WD_HEADER_FOOTER_INDEX’>

5 docx.section.Sections

Sections, docx.section.Sections, module=docx.section

|Section|对象的顺序,对应文档中的Section。支持``len()``,迭代和索引访问。

6 docx.section.Section

Section, docx.section.Section, module=docx.section

文档部分,提供对部分和页面设置的访问。还提供对页眉和页脚的访问。

property

1 bottom_margin=<property object at 0x0000000003B96778> kind:property type:property class:<class ‘docx.section.Section’>
2 different_first_page_header_footer=<property object at 0x0000000003B967C8> kind:property type:property class:<class ‘docx.section.Section’>
3 even_page_footer=<property object at 0x0000000003B96728> kind:property type:property class:<class ‘docx.section.Section’>
4 even_page_header=<property object at 0x0000000003B96818> kind:property type:property class:<class ‘docx.section.Section’>
5 first_page_footer=<property object at 0x0000000003B96868> kind:property type:property class:<class ‘docx.section.Section’>
6 first_page_header=<property object at 0x0000000003B968B8> kind:property type:property class:<class ‘docx.section.Section’>
7 footer=<property object at 0x0000000003B96908> kind:property type:property class:<class ‘docx.section.Section’>
8 footer_distance=<property object at 0x0000000003B969A8> kind:property type:property class:<class ‘docx.section.Section’>
9 gutter=<property object at 0x0000000003B969F8> kind:property type:property class:<class ‘docx.section.Section’>
10 header=<property object at 0x0000000003B96958> kind:property type:property class:<class ‘docx.section.Section’>
11 header_distance=<property object at 0x0000000003B96A98> kind:property type:property class:<class ‘docx.section.Section’>
12 left_margin=<property object at 0x0000000003B96AE8> kind:property type:property class:<class ‘docx.section.Section’>
13 orientation=<property object at 0x0000000003B96B38> kind:property type:property class:<class ‘docx.section.Section’>
14 page_height=<property object at 0x0000000003B96B88> kind:property type:property class:<class ‘docx.section.Section’>
15 page_width=<property object at 0x0000000003B96BD8> kind:property type:property class:<class ‘docx.section.Section’>
16 right_margin=<property object at 0x0000000003B96C28> kind:property type:property class:<class ‘docx.section.Section’>
17 start_type=<property object at 0x0000000003B96C78> kind:property type:property class:<class ‘docx.section.Section’>
18 top_margin=<property object at 0x0000000003B96CC8> kind:property type:property class:<class ‘docx.section.Section’>

7 docx.section._BaseHeaderFooter

_BaseHeaderFooter, docx.section._BaseHeaderFooter, module=docx.section

页眉和页脚类的基类

property

1 is_linked_to_previous=<property object at 0x0000000003B96E08> kind:property type:property class:<class ‘docx.section._BaseHeaderFooter’>
2 part=<property object at 0x0000000003B96DB8> kind:property type:property class:<class ‘docx.section._BaseHeaderFooter’>

8 docx.section._Footer

_Footer, docx.section._Footer, module=docx.section

页脚,用于所有三种类型(默认、偶数页和第一页)。
注意,与文档或表格单元格一样,页脚必须包含至少一个段落,而新的或其他“空”页脚只包含一个空段落。

9 docx.section._Header

_Header, docx.section._Header, module=docx.section

页头,用于所有三种类型(默认、偶数页和第一页)。注意,像文档或表格单元格一样,标题必须包含至少一个段落,新的或其他“空”标题包含一个空段落。
第一段可以作为`header.paragraphs[0]`用于向其添加内容。单独使用:meth:`add_paragraph()`来添加内容会在新添加的段落上方留下一个空段落。

私有或局部

10 _BaseHeaderFooter <class ‘docx.section._BaseHeaderFooter’>
11 _Footer <class ‘docx.section._Footer’>
12 _Header <class ‘docx.section._Header’>

剩余

13 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003B6C4C8>
14 spec ModuleSpec(name=‘docx.section’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003B6C4C8>, origin=‘…\lib\site-packages\docx\section.py’)
15 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
16 division _Feature((2, 2, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 8192)
17 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
18 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
8 dict 1
10 class 9
13 residual 6
14 system 8
15 private 1
16 all 21

【docx.document】

document, fullname=docx.document, file=docx\document.py

|Document| 及密切相关的对象

常量

1 docx.blkcntnr.BlockItemContainer

BlockItemContainer, docx.blkcntnr.BlockItemContainer, module=docx.blkcntnr

可包含块项的代理对象的基类。这些容器包括Body、Cell、页眉、页脚、脚注、尾注、注释和文本框对象。提供用于添加块项(如段落或表)的共享功能。

property

1 paragraphs=<property object at 0x0000000002C6B3B8> kind:property type:property class:<class ‘docx.blkcntnr.BlockItemContainer’>
2 tables=<property object at 0x0000000003B68368> kind:property type:property class:<class ‘docx.blkcntnr.BlockItemContainer’>

method

3 add_paragraph()

kind=method class=BlockItemContainer objtype=function

返回一个新添加到此容器内容末尾的段落,如果存在,则在一次运行中具有*text*,并且具有段落样式*style*。
如果*style*为|None|,则不应用任何段落样式,其效果与应用'Normal'样式相同。

4 add_table()

kind=method class=BlockItemContainer objtype=function

返回一个*width*的表,包含*rows* rows和*cols*列,新添加到容器的内容中。*width*均匀分布在表列之间。

2 docx.enum.section.WD_SECTION_START

WD_SECTION_START, docx.enum.section.WD_SECTION_START, module=docx.enum.section

alias: **WD SECTION**
指定分段符的开始类型。
示例:from docx.enum.section import WD_SECTIONsection = document.sections[0]section.start_type = WD_SECTION.NEW_PAGE

data

1 CONTINUOUS=CONTINUOUS (0) kind:data type:EnumValue class:<class ‘docx.enum.section.WD_SECTION_START’>
2 EVEN_PAGE=EVEN_PAGE (3) kind:data type:EnumValue class:<class ‘docx.enum.section.WD_SECTION_START’>
3 NEW_COLUMN=NEW_COLUMN (1) kind:data type:EnumValue class:<class ‘docx.enum.section.WD_SECTION_START’>
4 NEW_PAGE=NEW_PAGE (2) kind:data type:EnumValue class:<class ‘docx.enum.section.WD_SECTION_START’>
5 ODD_PAGE=ODD_PAGE (4) kind:data type:EnumValue class:<class ‘docx.enum.section.WD_SECTION_START’>

3 docx.enum.text.WD_BREAK_TYPE

WD_BREAK_TYPE, docx.enum.text.WD_BREAK_TYPE, module=docx.enum.text

对应于WdBreakType枚举

data

1 COLUMN=8 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>
2 LINE=6 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>
3 LINE_CLEAR_ALL=11 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>
4 LINE_CLEAR_LEFT=9 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>
5 LINE_CLEAR_RIGHT=10 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>
6 PAGE=7 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>
7 SECTION_CONTINUOUS=3 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>
8 SECTION_EVEN_PAGE=4 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>
9 SECTION_NEXT_PAGE=2 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>
10 SECTION_ODD_PAGE=5 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>
11 TEXT_WRAPPING=11 kind:data type:int class:<class ‘docx.enum.text.WD_BREAK_TYPE’>

4 docx.section.Section

Section, docx.section.Section, module=docx.section

文档部分,提供对部分和页面设置的访问。还提供对页眉和页脚的访问。

property

1 bottom_margin=<property object at 0x0000000003B96778> kind:property type:property class:<class ‘docx.section.Section’>
2 different_first_page_header_footer=<property object at 0x0000000003B967C8> kind:property type:property class:<class ‘docx.section.Section’>
3 even_page_footer=<property object at 0x0000000003B96728> kind:property type:property class:<class ‘docx.section.Section’>
4 even_page_header=<property object at 0x0000000003B96818> kind:property type:property class:<class ‘docx.section.Section’>
5 first_page_footer=<property object at 0x0000000003B96868> kind:property type:property class:<class ‘docx.section.Section’>
6 first_page_header=<property object at 0x0000000003B968B8> kind:property type:property class:<class ‘docx.section.Section’>
7 footer=<property object at 0x0000000003B96908> kind:property type:property class:<class ‘docx.section.Section’>
8 footer_distance=<property object at 0x0000000003B969A8> kind:property type:property class:<class ‘docx.section.Section’>
9 gutter=<property object at 0x0000000003B969F8> kind:property type:property class:<class ‘docx.section.Section’>
10 header=<property object at 0x0000000003B96958> kind:property type:property class:<class ‘docx.section.Section’>
11 header_distance=<property object at 0x0000000003B96A98> kind:property type:property class:<class ‘docx.section.Section’>
12 left_margin=<property object at 0x0000000003B96AE8> kind:property type:property class:<class ‘docx.section.Section’>
13 orientation=<property object at 0x0000000003B96B38> kind:property type:property class:<class ‘docx.section.Section’>
14 page_height=<property object at 0x0000000003B96B88> kind:property type:property class:<class ‘docx.section.Section’>
15 page_width=<property object at 0x0000000003B96BD8> kind:property type:property class:<class ‘docx.section.Section’>
16 right_margin=<property object at 0x0000000003B96C28> kind:property type:property class:<class ‘docx.section.Section’>
17 start_type=<property object at 0x0000000003B96C78> kind:property type:property class:<class ‘docx.section.Section’>
18 top_margin=<property object at 0x0000000003B96CC8> kind:property type:property class:<class ‘docx.section.Section’>

5 docx.section.Sections

Sections, docx.section.Sections, module=docx.section

|Section|对象的顺序,对应文档中的Section。支持``len()``,迭代和索引访问。

6 docx.shared.ElementProxy

ElementProxy, docx.shared.ElementProxy, module=docx.shared

lxml元素代理类的基类。元素代理类的主要职责是操作XML元素的属性和子元素。它们是python-docx中除了自定义元素(oxml)类之外最常见的类类型。

property

1 element=<property object at 0x00000000039319A8> kind:property type:property class:<class ‘docx.shared.ElementProxy’>
2 part=<property object at 0x00000000039319F8> kind:property type:property class:<class ‘docx.shared.ElementProxy’>

7 docx.shared.Emu

Emu, docx.shared.Emu, module=docx.shared

长度的英文公制单位的方便构造函数,例如``width = Emu(457200)``。

8 docx.document.Document

Document, docx.document.Document, module=docx.document

WordprocessingML (WML)文档。不打算直接构造。用途 :func:`docx.Document` 以打开或创建文档。

property

1 core_properties=<property object at 0x0000000003B62A48> kind:property type:property class:<class ‘docx.document.Document’>
2 inline_shapes=<property object at 0x0000000003B62AE8> kind:property type:property class:<class ‘docx.document.Document’>
3 paragraphs=<property object at 0x0000000003B9B368> kind:property type:property class:<class ‘docx.document.Document’>
4 part=<property object at 0x0000000003B9B3B8> kind:property type:property class:<class ‘docx.document.Document’>
5 sections=<property object at 0x0000000003B9B408> kind:property type:property class:<class ‘docx.document.Document’>
6 settings=<property object at 0x0000000003B9B458> kind:property type:property class:<class ‘docx.document.Document’>
7 styles=<property object at 0x0000000003B9B4A8> kind:property type:property class:<class ‘docx.document.Document’>
8 tables=<property object at 0x0000000003B9B4F8> kind:property type:property class:<class ‘docx.document.Document’>

method

9 add_heading()

kind=method class=Document objtype=function

返回新添加到文档末尾的标题段。标题段落将包含*text*,其段落样式由*level*决定。
如果*level*为0,则样式设置为`Title`。
如果*level*为1(或省略),则使用`Heading 1`。
否则样式设置为`Heading {level}`。如果*level*在0-9范围之外,则引发|ValueError|。

10 add_page_break()

kind=method class=Document objtype=function

只包含一个换行符的段落对象|Paragraph|。

11 add_paragraph()

kind=method class=Document objtype=function

返回一个新添加到文档末尾的段落,填充为*text*,并具有段落样式*style*。
*text*可以包含制表符(``\t``)字符,这些字符被转换为制表符的适当XML形式。
*text*也可以包含换行符(``\n``)或回车符(``\r``)字符,每个字符都转换为换行符。

12 add_picture()

kind=method class=Document objtype=function

返回在文档末尾自己的段落中添加的新图片形状。这张图片包含在*image_path_or_stream* *图像路径或流*,
根据*width*和*height*缩放。如果既没有指定宽度也没有指定高度,则图片显示为其原始大小。
如果只指定了一个,它将用于计算缩放因子,然后应用于未指定的维度,保留图像的纵横比。
图片的原始大小是使用图像文件中指定的点/英寸(dpi)值来计算的,如果没有指定值,通常情况下默认为72 dpi。

13 add_section()

kind=method class=Document objtype=function

返回一个|Section|对象,表示在文档末尾添加的新节。
可选的*start type*参数必须是:ref:`WdSectionStart`枚举的成员,默认为``WD_SECTION.NEW_PAGE``,如果没有提供。

14 add_table()

kind=method class=Document objtype=function

添加一个行数为*rows*和列数为*cols*的表,表样式为*style*。
*style*可以是段落样式对象,也可以是段落样式名称。如果*style*为|None|,表将继承文档的默认表样式。

15 save()

kind=method class=Document objtype=function

将该文档保存到*path或stream*,可以是文件系统位置的路径(字符串)或类文件对象。

9 docx.document._Body

_Body, docx.document._Body, module=docx.document

本文档中``<w:body>``元素的代理,主要具有容器角色。

method

1 clear_content()

kind=method class=_Body objtype=function

清除所有内容后返回|_Body|实例。主文档故事的节属性(如果存在)将被保留。

私有或局部

10 _Body <class ‘docx.document._Body’>

剩余

11 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003B5FAC8>
12 spec ModuleSpec(name=‘docx.document’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003B5FAC8>, origin=‘…\lib\site-packages\docx\document.py’)
13 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
14 division _Feature((2, 2, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 8192)
15 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
16 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
8 dict 1
10 class 2
13 residual 6
14 system 8
16 all 14

【docx.settings】

settings, fullname=docx.settings, file=docx\settings.py

对象,提供对文档级设置的访问

1 docx.shared.ElementProxy

ElementProxy, docx.shared.ElementProxy, module=docx.shared

lxml元素代理类的基类。元素代理类的主要职责是操作XML元素的属性和子元素。
它们是python-docx中除了自定义元素(oxml)类之外最常见的类类型。

property

1 element=<property object at 0x00000000039319A8> kind:property type:property class:<class ‘docx.shared.ElementProxy’>
2 part=<property object at 0x00000000039319F8> kind:property type:property class:<class ‘docx.shared.ElementProxy’>

2 docx.settings.Settings

Settings, docx.settings.Settings, module=docx.settings

提供对文档的文档级设置的访问。访问使用:attr:`.Document.settings`属性。

property

1 odd_and_even_pages_header_footer=<property object at 0x0000000003BA14F8> kind:property type:property class:<class ‘docx.settings.Settings’>

剩余

3 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003BA2148>
4 spec ModuleSpec(name=‘docx.settings’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003BA2148>, origin=‘…\lib\site-packages\docx\settings.py’)
5 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
6 division _Feature((2, 2, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 8192)
7 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
8 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
6 list 1
8 dict 1
9 module 3
10 class 1
13 residual 6
14 system 9
16 all 17

【docx.styles】

styles, fullname=docx.styles, file=docx\styles_init_.py

docx的子包模块,样式子包。

模块

1 docx.styles.latent

latent, fullname=docx.styles.latent, file=docx\styles\latent.py

潜在的样式相关对象。

2 docx.styles.style

style, fullname=docx.styles.style, file=docx\styles\style.py

样式对象层次结构。

3 docx.styles.styles

styles, fullname=docx.styles.styles, file=docx\styles\styles.py

样式对象,是样式部分中所有对象的容器

4 docx.styles.BabelFish

BabelFish, docx.styles.BabelFish, module=docx.styles

将特殊情况下的样式名称从UI名称(例如Heading 1标题1)转换为internal/styles.xml名称(例如heading 1)。

data

1 internal_style_names={‘Caption’: ‘caption’, ‘Footer’: ‘footer’, ‘Header’: ‘header’, ‘Heading 1’: 'hea… kind:data type:dict class:<class ‘docx.styles.BabelFish’>
2 style_aliases=((‘Caption’, ‘caption’), (‘Footer’, ‘footer’), (‘Header’, ‘header’), ('Heading 1… kind:data type:tuple class:<class ‘docx.styles.BabelFish’>
3 ui_style_names={‘caption’: ‘Caption’, ‘footer’: ‘Footer’, ‘header’: ‘Header’, ‘heading 1’: 'Hea… kind:data type:dict class:<class ‘docx.styles.BabelFish’>

class method

4 internal2ui()

kind=class method class=BabelFish objtype=classmethod

5 ui2internal()

kind=class method class=BabelFish objtype=classmethod

剩余

5 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003BA2708>
6 spec ModuleSpec(name=‘docx.styles’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003BA2708>, origin=‘…\lib\site-packages\docx\styles\init.py’, submodule_search_locations=[‘…\lib\site-packages\docx\styles’])
7 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
8 division _Feature((2, 2, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 8192)
9 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
10 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

统计

序号 类别 数量
4 str 5
8 dict 1
10 class 11
11 function 1
13 residual 5
14 system 8
15 private 5
16 all 23

【docx.table】

table, fullname=docx.table, file=docx\table.py

|表|对象和相关的代理类。

函数

1 lazyproperty(f)

lazyproperty(f), module=docx.shared, line:158 at site-packages\docx\shared.py

@lazyprop装饰。方法将只在第一次访问时调用,以计算缓存的属性值。之后,返回缓存的值。

2 docx.blkcntnr.BlockItemContainer

BlockItemContainer, docx.blkcntnr.BlockItemContainer, module=docx.blkcntnr

可包含块项的代理对象的基类。这些容器包括Body、Cell、页眉、页脚、脚注、尾注、注释和文本框对象。提供用于添加块项(如段落或表)的共享功能。

property

1 paragraphs=<property object at 0x0000000002C6B3B8> kind:property type:property class:<class ‘docx.blkcntnr.BlockItemContainer’>
2 tables=<property object at 0x0000000003B68368> kind:property type:property class:<class ‘docx.blkcntnr.BlockItemContainer’>

method

3 add_paragraph()

kind=method class=BlockItemContainer objtype=function

返回一个新添加到此容器内容末尾的段落,如果存在,则在一次运行中具有*text*,并且具有段落样式*style*。
如果*style*为|None|,则不应用任何段落样式,其效果与应用'Normal'样式相同。

4 add_table()

kind=method class=BlockItemContainer objtype=function

返回一个*width*的表,包含*rows* rows和*cols*列,新添加到容器的内容中。*width*均匀分布在表列之间。

3 docx.enum.style.WD_STYLE_TYPE

WD_STYLE_TYPE, docx.enum.style.WD_STYLE_TYPE, module=docx.enum.style

指定四种样式类型之一:段落、字符、列表或表格。
示例from docx import Documentfrom docx.enum.style import WD_STYLE_TYPEstyles = Document().stylesassert styles[0].type == WD_STYLE_TYPE.PARAGRAPH

data

1 CHARACTER=CHARACTER (2) kind:data type:EnumValue class:<class ‘docx.enum.style.WD_STYLE_TYPE’>
2 LIST=LIST (4) kind:data type:EnumValue class:<class ‘docx.enum.style.WD_STYLE_TYPE’>
3 PARAGRAPH=PARAGRAPH (1) kind:data type:EnumValue class:<class ‘docx.enum.style.WD_STYLE_TYPE’>
4 TABLE=TABLE (3) kind:data type:EnumValue class:<class ‘docx.enum.style.WD_STYLE_TYPE’>

4 docx.oxml.simpletypes.ST_Merge

ST_Merge, docx.oxml.simpletypes.ST_Merge, module=docx.oxml.simpletypes

<w:xMerge val="">属性的有效值

data

1 CONTINUE=continue kind:data type:str class:<class ‘docx.oxml.simpletypes.ST_Merge’>
2 RESTART=restart kind:data type:str class:<class ‘docx.oxml.simpletypes.ST_Merge’>

5 docx.shared.Inches

Inches, docx.shared.Inches, module=docx.shared

以英寸为单位的长度方便构造函数,例如。``width = Inches(0.5)``。

6 docx.shared.Parented

Parented, docx.shared.Parented, module=docx.shared

为部分下面出现的文档元素提供公共服务,但偶尔可能需要一个祖先对象来提供服务,例如添加或删除关系。提供了``self._parent``属性给子类。

property

1 part=<property object at 0x0000000003931B88> kind:property type:property class:<class ‘docx.shared.Parented’>

7 docx.table.Table

Table, docx.table.Table, module=docx.table

WordprocessingML ``<w:tbl>``元素的代理类。

property

1 alignment=<property object at 0x0000000003BBE728> kind:property type:property class:<class ‘docx.table.Table’>
2 autofit=<property object at 0x0000000003BBE778> kind:property type:property class:<class ‘docx.table.Table’>
3 columns=<property object at 0x0000000003BBE688> kind:property type:property class:<class ‘docx.table.Table’>
4 rows=<property object at 0x0000000003BBE7C8> kind:property type:property class:<class ‘docx.table.Table’>
5 style=<property object at 0x0000000003BBE868> kind:property type:property class:<class ‘docx.table.Table’>
6 table=<property object at 0x0000000003BBE818> kind:property type:property class:<class ‘docx.table.Table’>
7 table_direction=<property object at 0x0000000003BBE908> kind:property type:property class:<class ‘docx.table.Table’>

method

8 add_column()

kind=method class=Table objtype=function

返回一个*width*的|_Column|对象,新添加到表的最右边。

9 add_row()

kind=method class=Table objtype=function

返回一个|_Row|实例,新添加到表的最底部。

10 cell()

kind=method class=Table objtype=function

返回|_Cell|实例,对应于表Cell在*row_idx*, *col_idx*的交集,其中(0,0)是最左边的单元格。

11 column_cells()

kind=method class=Table objtype=function

本表中*column_idx*处的单元格序列。

12 row_cells()

kind=method class=Table objtype=function

本表中*row_idx*所在行的单元格序列。

8 docx.table._Cell

_Cell, docx.table._Cell, module=docx.table

表的单元格

property

1 paragraphs=<property object at 0x0000000003BBEAE8> kind:property type:property class:<class ‘docx.table._Cell’>
2 tables=<property object at 0x0000000003BBEB38> kind:property type:property class:<class ‘docx.table._Cell’>
3 text=<property object at 0x0000000003BBEBD8> kind:property type:property class:<class ‘docx.table._Cell’>
4 vertical_alignment=<property object at 0x0000000003BBEC28> kind:property type:property class:<class ‘docx.table._Cell’>
5 width=<property object at 0x0000000003BBEC78> kind:property type:property class:<class ‘docx.table._Cell’>

method

6 add_paragraph()

kind=method class=_Cell objtype=function

返回新添加到此单元格内容末尾的段落。如果存在,*text*将在一次运行中添加到段落中。
如果指定,则应用段落样式*style*。如果*style*未指定或为|None|,结果就好像应用了'Normal'样式。
请注意,单元格中文本的格式可能受到表格样式的影响。*text*可以包含制表符(``\t``)字符,这些字符被转换为制表符的适当XML形式。
*text*也可以包含换行符(``\n``)或回车符(``\r``)字符,每个字符都转换为换行符。

7 add_table()

kind=method class=_Cell objtype=function

返回一个新添加到此单元格的表,位于任何现有单元格内容之后,包含*rows* rows和*cols*列。
在表后添加一个空段落,因为Word要求每个单元格中的最后一个元素是段落元素。

8 merge()

kind=method class=_Cell objtype=function

返回一个合并的单元格,该单元格和*other_cell*作为对角角,跨越矩形区域。如果单元格没有定义矩形区域,则引发|InvalidSpanError|。

9 docx.table._Column

_Column, docx.table._Column, module=docx.table

表列

property

1 cells=<property object at 0x0000000003BBECC8> kind:property type:property class:<class ‘docx.table._Column’>
2 table=<property object at 0x0000000003BBED18> kind:property type:property class:<class ‘docx.table._Column’>
3 width=<property object at 0x0000000003BBEE08> kind:property type:property class:<class ‘docx.table._Column’>

10 docx.table._Columns

_Columns, docx.table._Columns, module=docx.table

|_Column|实例序列,对应表中的列。支持``len()``,迭代和索引访问。

property

1 table=<property object at 0x0000000003BBEEF8> kind:property type:property class:<class ‘docx.table._Columns’>

11 docx.table._Row

_Row, docx.table._Row, module=docx.table

表格行

property

1 cells=<property object at 0x0000000003BC3098> kind:property type:property class:<class ‘docx.table._Row’>
2 height=<property object at 0x0000000003BC3138> kind:property type:property class:<class ‘docx.table._Row’>
3 height_rule=<property object at 0x0000000003BC3188> kind:property type:property class:<class ‘docx.table._Row’>
4 table=<property object at 0x0000000003BC30E8> kind:property type:property class:<class ‘docx.table._Row’>

12 docx.table._Rows

_Rows, docx.table._Rows, module=docx.table

|_Row|对象序列,对应表中的行。支持``len()``,迭代,索引访问和切片。

property

1 table=<property object at 0x0000000003BC32C8> kind:property type:property class:<class ‘docx.table._Rows’>

私有或局部

13 _Cell <class ‘docx.table._Cell’>
14 _Column <class ‘docx.table._Column’>
15 _Columns <class ‘docx.table._Columns’>
16 _Row <class ‘docx.table._Row’>
17 _Rows <class ‘docx.table._Rows’>

剩余

18 loader <_frozen_importlib_external.SourceFileLoader object at 0x0000000003B5F908>
19 spec ModuleSpec(name=‘docx.table’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x0000000003B5F908>, origin=‘…\lib\site-packages\docx\table.py’)
20 absolute_import _Feature((2, 5, 0, ‘alpha’, 1), (3, 0, 0, ‘alpha’, 0), 16384)
21 print_function _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 65536)
22 unicode_literals _Feature((2, 6, 0, ‘alpha’, 2), (3, 0, 0, ‘alpha’, 0), 131072)

一图看懂 docx 读取、查询、修改 Ms Word docx 文件, 资料整理+笔记(大全)相关推荐

  1. 一图看懂信用报告在线查询指南

    来源:中国人民银行

  2. python生成word目录_使用Python更新MS Word .docx文档的目录(目录)

    我使用python包" python-docx"来修改MS Word .docx文档的结构和内容.该软件包无法更新TOC(目录)[Python: Create a "Ta ...

  3. 一图看懂 aiohttp 模块:基于 asyncio 的异步HTTP网络库, 资料整理+笔记(大全)

    本文由 大侠(AhcaoZhu)原创,转载请声明. 链接: https://blog.csdn.net/Ahcao2008 一图看懂 aiohttp 模块:基于 asyncio 的异步HTTP网络库, ...

  4. 一图看懂MVCC机制,RC级别解决脏读问题,RR级别怎么解决不可重复读问题【MySQL系列】

    说起事务隔离级别和各自解决的问题,相信学过MySQL的人都倒背如流, 三类问题:脏读.不可重复读.幻读问题: 四种隔离级别: 读不提交,最低的隔离级别,存在脏读.不可重复读.幻读问题: 读已提交,能解 ...

  5. sdn体系的三个平面_十张图看懂SDN与NFV的区别与联系?

    原标题:十张图看懂SDN与NFV的区别与联系? 专业的人说的很准确但是普通人难以理解,常常记不住,分不清,不专业的人往往又说的差点意思.无意间,笔者在领英上看到一个介绍SDN/NFV区别的公开文档,内 ...

  6. 一张“神图”看懂单机/集群/热备/磁盘阵列(RAID)

    一张"神图"看懂单机/集群/热备/磁盘阵列(RAID) 单机部署(stand-alone):只有一个饮水机提供服务,服务只部署一份 集群部署(cluster):有多个饮水机同时提供 ...

  7. 开源项目许可证相关-一张图看懂几种开源许可证

    常见的几种许可 开源许可证允许每个人出于任何目的使用.修改和共享许可软件,前提是要保持软件的来源和开放性.以下许可证从要求条件严苛程度递减排序,从最严苛(GNU AGPLv3)到没有条件(未许可).请 ...

  8. 一图看懂LGPL,MPT,GPL,BSD,MIT,Apache协议(最新版)

    目录 一图看懂LGPL,MPT,GPL,BSD,MIT,Apache协议: GPL LGPL MPL MIT Apache 一图看懂LGPL,MPT,GPL,BSD,MIT,Apache协议: GPL ...

  9. 一张图看懂微服务架构路线

    目录 一张图看懂微服务架构路线 我为什么选择微服务架构? 微服务架构路线 基本思路 Docker 容器编排 Docker 容器管理 API网关 负载均衡 服务发现 事件总线 日志记录 监控和警报 分布 ...

最新文章

  1. editor修改样式 vue_vue-quill-editor的使用及个性化定制操作
  2. label smoothing(标签平滑)
  3. 人可以拒绝任何东西,但绝对不可以拒绝成熟
  4. [渝粤教育] 江西外语外贸职业学院 商务英语翻译技巧 参考 资料
  5. 小程序学习(2):vs code 安装插件
  6. qxdm无法安装问题闪一下_win10系统显示“出现了问题,无法安装功能”解决办法...
  7. 方法区jdk1.7,1.8版本的构造变化
  8. 解决Robot Framework运行时没有Log的方案
  9. Linux下安装PHP扩展 pdo_sqlsrv
  10. ArcGIS 基础6-ArcCatalog数据库管理
  11. 傅里叶变换就是这么简单?
  12. UML系列文章(6)---公共机制
  13. [C语言]统计成绩问题:输入某班学生某门课的成绩(最多不超过40人,具体人数由用户键盘输入),用函数编程统计不及格人数。
  14. ansible问题记录--Timeout (12s) waiting for privilege escalation prompt
  15. 猜数游戏(GAMBLER)
  16. 企业微信对外收款使用指南
  17. 国庆的人山人海,生无可恋脸
  18. 手把手教你写第一个Windows窗口
  19. 不用心率表,教你一秒钟知道自己的心率
  20. Unity 编辑器运行没问题,打包exe文件运行蓝屏?

热门文章

  1. [Vim] Vim在tmux中颜色改变/不同的问题
  2. 批量修改html文件内容,批量修改word文件内容 批量修改WORD文件的页眉页脚
  3. 机械加工行业云MES解决方案
  4. Python--爬虫,了解防盗链-->解决防盗链,解决反反反爬
  5. 研磨设计模式 之 生成器模式(Builder)2 ——跟着cc学设计系列
  6. 深度学习已成功应用于这三大领域
  7. 深圳住房公积金提取攻略
  8. Javascript调用事件方法
  9. flutter调用js代码
  10. @serializedname注解的意思