docx_parser_converter.docx_parsers.document.document_numbering_parser module

class docx_parser_converter.docx_parsers.document.document_numbering_parser.DocumentNumberingParser[source]

Bases: object

Parses the numbering properties of a paragraph in a docx document.

This class contains methods to parse the numbering properties from the paragraph properties (pPr) element of a docx document. The numbering properties are essential for understanding the ordered or unordered list formatting in the document.

static parse(pPr: Element | None) Numbering | None[source]

Parses numbering from the given paragraph properties XML element.

Parameters:

pPr (Optional[etree.Element]) – The paragraph properties XML element. This element can contain numbering properties which define the list level and list ID for the paragraph.

Returns:

The parsed numbering, or None if not found.

Return type:

Optional[Numbering]

Example

The following is an example of the numbering properties in a paragraph properties (pPr) element:

<w:pPr>
    <w:numPr>
        <w:ilvl w:val="1"/>
        <w:numId w:val="2"/>
    </w:numPr>
</w:pPr>