Skip to content

coreprops

coreprops

Custom element classes for core properties-related XML elements.

CT_CoreProperties

Bases: BaseOxmlElement

<cp:coreProperties> element, the root element of the Core Properties part.

Stored as /docProps/core.xml. Implements many of the Dublin Core document metadata elements. String elements resolve to an empty string ("") if the element is not present in the XML. String elements are limited in length to 255 unicode characters.

author_text property writable

author_text: str

The text in the dc:creator child element.

revision_number property writable

revision_number: int

Integer value of revision property.

new classmethod

Return a new <cp:coreProperties> element.

Source code in src/docx/oxml/coreprops.py
@classmethod
def new(cls) -> CT_CoreProperties:
    """Return a new `<cp:coreProperties>` element."""
    xml = cls._coreProperties_tmpl
    coreProperties = cast(CT_CoreProperties, parse_xml(xml))
    return coreProperties