`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
| 14 | |
| 15 | |
| 16 | class CT_CoreProperties(BaseOxmlElement): |
| 17 | """`cp:coreProperties` element. |
| 18 | |
| 19 | The root element of the Core Properties part stored as `/docProps/core.xml`. Implements many |
| 20 | of the Dublin Core document metadata elements. String elements resolve to an empty string ('') |
| 21 | if the element is not present in the XML. String elements are limited in length to 255 unicode |
| 22 | characters. |
| 23 | """ |
| 24 | |
| 25 | get_or_add_revision: Callable[[], _Element] |
| 26 | |
| 27 | category = ZeroOrOne("cp:category", successors=()) |
| 28 | contentStatus = ZeroOrOne("cp:contentStatus", successors=()) |
| 29 | created = ZeroOrOne("dcterms:created", successors=()) |
| 30 | creator = ZeroOrOne("dc:creator", successors=()) |
| 31 | description = ZeroOrOne("dc:description", successors=()) |
| 32 | identifier = ZeroOrOne("dc:identifier", successors=()) |
| 33 | keywords = ZeroOrOne("cp:keywords", successors=()) |
| 34 | language = ZeroOrOne("dc:language", successors=()) |
| 35 | lastModifiedBy = ZeroOrOne("cp:lastModifiedBy", successors=()) |
| 36 | lastPrinted = ZeroOrOne("cp:lastPrinted", successors=()) |
| 37 | modified = ZeroOrOne("dcterms:modified", successors=()) |
| 38 | revision: _Element | None = ZeroOrOne( # pyright: ignore[reportAssignmentType] |
| 39 | "cp:revision", successors=() |
| 40 | ) |
| 41 | subject = ZeroOrOne("dc:subject", successors=()) |
| 42 | title = ZeroOrOne("dc:title", successors=()) |
| 43 | version = ZeroOrOne("cp:version", successors=()) |
| 44 | |
| 45 | _coreProperties_tmpl = "<cp:coreProperties %s/>\n" % nsdecls("cp", "dc", "dcterms") |
| 46 | |
| 47 | @staticmethod |
| 48 | def new_coreProperties() -> CT_CoreProperties: |
| 49 | """Return a new `cp:coreProperties` element""" |
| 50 | return cast(CT_CoreProperties, parse_xml(CT_CoreProperties._coreProperties_tmpl)) |
| 51 | |
| 52 | @property |
| 53 | def author_text(self) -> str: |
| 54 | return self._text_of_element("creator") |
| 55 | |
| 56 | @author_text.setter |
| 57 | def author_text(self, value: str): |
| 58 | self._set_element_text("creator", value) |
| 59 | |
| 60 | @property |
| 61 | def category_text(self) -> str: |
| 62 | return self._text_of_element("category") |
| 63 | |
| 64 | @category_text.setter |
| 65 | def category_text(self, value: str): |
| 66 | self._set_element_text("category", value) |
| 67 | |
| 68 | @property |
| 69 | def comments_text(self) -> str: |
| 70 | return self._text_of_element("description") |
| 71 | |
| 72 | @comments_text.setter |
| 73 | def comments_text(self, value: str): |