diff --git a/addons/sandbox/images/guest/Dockerfile b/addons/sandbox/images/guest/Dockerfile index 7601695af..3069d974c 100644 --- a/addons/sandbox/images/guest/Dockerfile +++ b/addons/sandbox/images/guest/Dockerfile @@ -101,6 +101,10 @@ RUN set -eux; \ python3 /tmp/guest-python/check-python.py; \ sh /tmp/guest-python/check-tools.sh; \ rm -rf /tmp/guest-python +# Helpers belong to the guest, not the documentation-only skill package. +COPY addons/sandbox/images/guest/document-skills/ /usr/local/lib/localai/document-skills/ +COPY addons/sandbox/images/guest/check-document-skills.py /usr/local/lib/localai/document-skills/check-document-skills.py +RUN python3 /usr/local/lib/localai/document-skills/check-document-skills.py # The guest has no network device. Every tool must use the proxy on the # loopback interface; the sandbox serves it with a host port handler. ENV HTTP_PROXY=http://127.0.0.1:3128 HTTPS_PROXY=http://127.0.0.1:3128 NO_PROXY=localhost,127.0.0.1 \ diff --git a/addons/sandbox/images/guest/check-document-skills.py b/addons/sandbox/images/guest/check-document-skills.py new file mode 100644 index 000000000..5e1d5d598 --- /dev/null +++ b/addons/sandbox/images/guest/check-document-skills.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: MIT +"""Exercise the installed PDF helper CLIs using only guest dependencies.""" + +import json +from pathlib import Path +import subprocess +import sys +import tempfile + +from reportlab.pdfgen import canvas + + +HELPERS = Path("/usr/local/lib/localai/document-skills/pdf") +SUCCESS = "document-skills fixtures: ok" + + +def require(condition, message): + if not condition: + raise RuntimeError(message) + + +def run_helper(name, pdf, exit_code): + result = subprocess.run( + [sys.executable, str(HELPERS / name), str(pdf), "--json"], + capture_output=True, text=True, timeout=30, check=False, + ) + require(result.returncode == exit_code, + f"{name} {pdf.name}: exit {result.returncode}, expected {exit_code}: {result.stderr}") + data = json.loads(result.stdout) + require(data["ok"] is (exit_code == 0), f"{name}: incorrect ok field") + require(data["page_count"] == 1 and len(data["pages"]) == 1, + f"{name}: incorrect page count") + require(data["error_count"] == sum(p["severity"] == "error" for p in data["problems"]), + f"{name}: incorrect error count") + require(data["warning_count"] == sum(p["severity"] == "warning" for p in data["problems"]), + f"{name}: incorrect warning count") + return data + + +def main(): + for name in ("content_qa.py", "verify_pdf.py", "notice.txt"): + require((HELPERS / name).is_file(), f"missing guest helper asset: {name}") + notice = (HELPERS / "notice.txt").read_text() + for attribution in ("MIT License", "Copyright (c) 2026 Paper Instruments, Inc.", + "Permission is hereby granted", "THE SOFTWARE IS PROVIDED"): + require(attribution in notice, f"missing helper license attribution: {attribution}") + + with tempfile.TemporaryDirectory(prefix="document-skills-") as directory: + root = Path(directory) + for name, x in (("valid", 72), ("empty", None), ("defective", -144)): + pdf = root / f"{name}.pdf" + document = canvas.Canvas(str(pdf), pagesize=(612, 792), invariant=1) + if x is not None: + document.drawString(x, 720, "Sandbox PDF fixture") + document.showPage() + document.save() + + for name in ("content_qa.py", "verify_pdf.py"): + valid = run_helper(name, root / "valid.pdf", 0) + require(valid["error_count"] == 0 and valid["warning_count"] == 0, + f"{name}: valid document reported problems") + empty = run_helper(name, root / "empty.pdf", 0) + expected = "empty_page_text" if name == "content_qa.py" else "pdf-no-extractable-text" + require(empty["error_count"] == 0 and empty["warning_count"] == 1, + f"{name}: empty-text document must warn, not fail") + require(empty["problems"][0]["kind"] == expected, f"{name}: missing empty-text warning") + require(empty["problems"][0]["page"] == 1, f"{name}: incorrect warning page") + if name == "content_qa.py": + require(valid["pages"][0]["text"].strip() == "Sandbox PDF fixture", + "content_qa.py: fixture text not extracted") + require(empty["pages"][0]["text"] == "", "empty fixture contains text") + else: + require(valid["pages"][0]["text_line_count"] > 0, + "verify_pdf.py: fixture text geometry not extracted") + + # The PDF is openable and contains text, but that text is outside its + # page box. Content QA should accept it; geometry verification must not. + content = run_helper("content_qa.py", root / "defective.pdf", 0) + require(content["error_count"] == 0 and content["warning_count"] == 0, + "content_qa.py: changed content-only behavior") + defective = run_helper("verify_pdf.py", root / "defective.pdf", 1) + require(defective["error_count"] > 0, "verify_pdf.py: missed defective geometry") + require(any(p["kind"] == "layout-boundary-violation" and p["severity"] == "error" + and p["page"] == 1 for p in defective["problems"]), + "verify_pdf.py: missing boundary violation") + print(SUCCESS) + + +if __name__ == "__main__": + main() diff --git a/core/services/studio/builtinskills/tree/pdf/scripts/content_qa.py b/addons/sandbox/images/guest/document-skills/pdf/content_qa.py similarity index 100% rename from core/services/studio/builtinskills/tree/pdf/scripts/content_qa.py rename to addons/sandbox/images/guest/document-skills/pdf/content_qa.py diff --git a/addons/sandbox/images/guest/document-skills/pdf/notice.txt b/addons/sandbox/images/guest/document-skills/pdf/notice.txt new file mode 100644 index 000000000..ff537ce50 --- /dev/null +++ b/addons/sandbox/images/guest/document-skills/pdf/notice.txt @@ -0,0 +1,30 @@ +PDF helpers from Feather +======================== + +Source: https://github.com/paper-instruments/feather-train +Commit: b7463092af862ebbdf4c5920c4bc9ab38ab17ad9 +Folder: feather-harness/src/feather_harness/skills/pdf/scripts + +The helper sources are copied without changes. + +MIT License + +Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/core/services/studio/builtinskills/tree/pdf/scripts/verify_pdf.py b/addons/sandbox/images/guest/document-skills/pdf/verify_pdf.py similarity index 100% rename from core/services/studio/builtinskills/tree/pdf/scripts/verify_pdf.py rename to addons/sandbox/images/guest/document-skills/pdf/verify_pdf.py diff --git a/addons/sandbox/manifest.json b/addons/sandbox/manifest.json index 7a9333c21..15673c4d6 100644 --- a/addons/sandbox/manifest.json +++ b/addons/sandbox/manifest.json @@ -118,7 +118,25 @@ } ], "title": "Sandbox" - } + }, + "skillDefinitions": [ + { + "name": "docx", + "shadows": "docx" + }, + { + "name": "pptx", + "shadows": "pptx" + }, + { + "name": "pdf", + "shadows": "pdf" + }, + { + "name": "xlsx", + "shadows": "xlsx" + } + ] }, "dataFormat": { "max": 1, diff --git a/addons/sandbox/package/platforms.yaml b/addons/sandbox/package/platforms.yaml index d7a55a19d..e0c91de53 100644 --- a/addons/sandbox/package/platforms.yaml +++ b/addons/sandbox/package/platforms.yaml @@ -26,6 +26,7 @@ executable: sandbox manifest: addons/sandbox/manifest.json # The directory whose content is laid at the package root (ui/sandbox.js ...). ui: addons/sandbox/ui/dist +skills: addons/sandbox/skills platforms: - platform: linux/amd64 enabled: true diff --git a/core/services/studio/builtinskills/tree/docx/SKILL.md b/addons/sandbox/skills/docx/SKILL.md similarity index 90% rename from core/services/studio/builtinskills/tree/docx/SKILL.md rename to addons/sandbox/skills/docx/SKILL.md index d9a4c1241..fe806fbd7 100644 --- a/core/services/studio/builtinskills/tree/docx/SKILL.md +++ b/addons/sandbox/skills/docx/SKILL.md @@ -22,7 +22,7 @@ Use your existing knowledge of `python-docx` for normal paragraphs, runs, styles `paper-docx` is installed under the `docx` import. -The [Paper API companion](references/paper-api.md) maps Paper-specific capabilities to their public symbols. The [generated API reference](references/api/index.md) covers the complete public API, including the surface inherited from `python-docx`, with one page per module. It is large; search by symbol and read only the relevant section. +The [Paper API companion](references/paper-api.md#source-c4b328c0772ccf3b) maps Paper-specific capabilities to their public symbols. The [generated API reference](references/api-002.md#source-56f84baa75bfbe31) covers the complete public API, including the surface inherited from `python-docx`, with one page per module. It is large; search by symbol and read only the relevant section. ## Package behavior diff --git a/addons/sandbox/skills/docx/notice.txt b/addons/sandbox/skills/docx/notice.txt new file mode 100644 index 000000000..e2afba80e --- /dev/null +++ b/addons/sandbox/skills/docx/notice.txt @@ -0,0 +1,107 @@ +Sandbox document skills +============================= + +The skills "docx", "xlsx", "pptx" and "pdf" are adapted from the skills of the +Feather project. + + Source: https://github.com/paper-instruments/feather-train + (folder feather-harness/src/feather_harness/skills) + Commit: b7463092af862ebbdf4c5920c4bc9ab38ab17ad9 + Licence: MIT, Copyright (c) 2026 Paper Instruments, Inc. + +What was changed: the text about LibreOffice was replaced by a note that +LibreOffice is not installed, the text about OCR was shortened in the same way, +and the generated page of the LibreOffice-backed module "openpyxl.oracle" got +the same note. Each of the four got one line that says to write +helper scripts in the chat's work folder. The remaining built-in skills are not part of this package. + +The MIT licence of the Feather project +-------------------------------------- + +MIT License + +Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +The generated API pages +----------------------- + +The pages under docx/references/api, xlsx/references/api and +pptx/references/api are generated from the docstrings of the Paper libraries +and of the libraries that they extend. The licences of those projects apply to +that text. All three are MIT licences. + +paper-docx extends python-docx, and paper-pptx extends python-pptx. Steve Canny +wrote both upstream libraries, so the two licence files of the Paper packages +have the same text. Each applies to its own package. + + paper-docx https://pypi.org/project/paper-docx/ (python-docx) + paper-pptx https://pypi.org/project/paper-pptx/ (python-pptx) + +The MIT License (MIT) +Copyright (c) 2013 Steve Canny, https://github.com/scanny +Portions Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +paper-xlsx extends openpyxl. + + paper-xlsx https://pypi.org/project/paper-xlsx/ (openpyxl) + +This software is under the MIT Licence +====================================== + +Copyright (c) 2010 openpyxl +Portions Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/addons/sandbox/skills/docx/references/api-001.md b/addons/sandbox/skills/docx/references/api-001.md new file mode 100644 index 000000000..56e4dfb2d --- /dev/null +++ b/addons/sandbox/skills/docx/references/api-001.md @@ -0,0 +1,5393 @@ + + + + +# `docx.api` + +Directly exposed API functions and classes, `Document` for now. + +## `Document` + +```python +Document(docx: str | IO[bytes] | None = None) -> DocumentObject +``` + +Return a `Document` object loaded from `docx`, where `docx` can be either a path +to a ``.docx`` file (a string) or a file-like object. + +If `docx` is missing or ``None``, the built-in default document "template" is +loaded. + + + + + +# `docx.blkcntnr` + +Block item container, used by body, cell, header, etc. + +## `BlockItemContainer` + +```python +BlockItemContainer(element: BlockItemElement, parent: t.ProvidesStoryPart) +``` + +Bases: `StoryChild` + +Base class for proxy objects that can contain block items. + +These containers include _Body, _Cell, header, footer, footnote, endnote, comment, +and text box objects. Provides the shared functionality to add a block item like a +paragraph or table. + +### `add_paragraph` + +```python +add_paragraph(text: str = '', style: str | ParagraphStyle | None = None) -> Paragraph +``` + +Return paragraph newly added to the end of the content in this container. + +The paragraph has `text` in a single run if present, and is given paragraph +style `style`. + +If `style` is `None`, no paragraph style is applied, which has the same effect +as applying the 'Normal' style. + +### `add_table` + +```python +add_table(rows: int, cols: int, width: Length) -> Table +``` + +Return table of `width` having `rows` rows and `cols` columns. + +The table is appended appended at the end of the content in this container. + +`width` is evenly distributed between the table columns. + +### `iter_inner_content` + +```python +iter_inner_content() -> Iterator[Paragraph | Table] +``` + +Generate each `Paragraph` or `Table` in this container in document order. + +### `paragraphs` + +```python +paragraphs +``` + +A list containing the paragraphs in this container, in document order. + +Read-only. + +### `tables` + +```python +tables +``` + +A list containing the tables in this container, in document order. + +Read-only. + +## `BlockItemElement` + +```python +BlockItemElement: TypeAlias = 'CT_Body | CT_Comment | CT_HdrFtr | CT_Tc' +``` + + + + + +# `docx.blocks` + +Anchor-relative block operations and clause-level redlines (paper-docx). + +## `BlockEditResult` + +```python +BlockEditResult(story: str, inserted_blocks: int, deleted_blocks: int, deleted_text: Tuple[str, ...], revision_ids: Tuple[int, ...]) -> None +``` + +Outcome of a block-level edit. + +### `deleted_blocks` + +```python +deleted_blocks: int +``` + +### `deleted_text` + +```python +deleted_text: Tuple[str, ...] +``` + +### `inserted_blocks` + +```python +inserted_blocks: int +``` + +### `revision_ids` + +```python +revision_ids: Tuple[int, ...] +``` + +### `story` + +```python +story: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `BlockTarget` + +```python +BlockTarget = Union[str, Block, Span] +``` + +## `ListBlock` + +```python +ListBlock(items: Sequence[str], kind: str = 'bullet', level: int = 0) -> None +``` + +A real bullet/decimal list (backed by a real numbering definition). + +### `items` + +```python +items: Sequence[str] +``` + +### `kind` + +```python +kind: str = 'bullet' +``` + +### `level` + +```python +level: int = 0 +``` + +## `RichParagraph` + +```python +RichParagraph(runs: Sequence[TextRun], style: Optional[str] = None) -> None +``` + +A paragraph built from styled runs. + +### `runs` + +```python +runs: Sequence[TextRun] +``` + +### `style` + +```python +style: Optional[str] = None +``` + +## `TableBlock` + +```python +TableBlock(rows: Sequence[Sequence[str]]) -> None +``` + +A simple rectangular table of plain-text cells. + +### `rows` + +```python +rows: Sequence[Sequence[str]] +``` + +## `TextRun` + +```python +TextRun(text: str, bold: bool = False, italic: bool = False) -> None +``` + +One run of a rich paragraph. + +### `bold` + +```python +bold: bool = False +``` + +### `italic` + +```python +italic: bool = False +``` + +### `text` + +```python +text: str +``` + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `insert_blocks_after` + +```python +insert_blocks_after(document: 'Document', anchor: BlockTarget, *, blocks: 'Sequence[object]', tracked: bool = False, author: Optional[str] = None, date: Optional[dt.datetime] = None) -> BlockEditResult +``` + +Insert a typed block list after `anchor`, and return a `BlockEditResult`. + +`blocks` mixes `RichParagraph` (styled runs), `ListBlock` (real bullet or decimal lists, +numbering definition created on demand) and `TableBlock` (rectangular tables). Reach for +this when you want structure rather than raw XML. Refuses a protected document, and an +anchor that is missing, ambiguous, foreign, stale, or spans more than one paragraph. + +## `insert_section_after` + +```python +insert_section_after(document: 'Document', anchor: BlockTarget, *, heading: str, paragraphs: Sequence[str], heading_style: str = 'Heading2', body_style: Optional[str] = None, tracked: bool = False, author: Optional[str] = None, date: Optional[dt.datetime] = None) -> BlockEditResult +``` + +Insert a heading plus body paragraphs after `anchor`, and return a `BlockEditResult`. + +With `tracked=True` each inserted paragraph is a real Word insertion attributed to +`author` (required) and `date`. Refuses a protected document, an undefined heading +style, and an anchor that is missing, ambiguous, foreign, stale, or spans +more than one paragraph. + +## `require_anchor_owner` + +```python +require_anchor_owner(document: 'Document', anchor: object, *, argument: str = 'anchor') -> None +``` + +Check ownership for live anchor forms; value/string anchors are inert. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + +## `tracked_delete_paragraphs` + +```python +tracked_delete_paragraphs(document: 'Document', start_anchor: BlockTarget, *, end_anchor: Optional[BlockTarget] = None, count: int = 1, author: str, date: Optional[dt.datetime] = None) -> BlockEditResult +``` + +Mark a paragraph range deleted with real tracked changes; returns a `BlockEditResult`. + +Runs move into `w:del` with formatting intact and the paragraph mark is stamped, so +accepting removes the paragraphs and rejecting restores them exactly. Refuses a +protected document, an endpoint spanning multiple paragraphs, a range +crossing stories or parents, a bookmarked or non-plain run, and an open field. + +## `tracked_replace_paragraphs` + +```python +tracked_replace_paragraphs(document: 'Document', start_anchor: BlockTarget, replacement_paragraphs: Sequence[str], *, end_anchor: Optional[BlockTarget] = None, count: int = 1, body_style: Optional[str] = None, author: str, date: Optional[dt.datetime] = None) -> BlockEditResult +``` + +Tracked-delete a paragraph range and tracked-insert replacements after it. + +Returns a `BlockEditResult`. Replacements land after the last deleted paragraph. Carries +the same refusals as `tracked_delete_paragraphs`: protection, a multi-paragraph +endpoint, a range crossing stories, bookmarked or non-plain runs, an open field. + + + + + +# `docx.bookmarks` + +Bookmark enumeration, creation, and deletion. + +## `BookmarkInfo` + +```python +BookmarkInfo(name: str, bookmark_id: int, story: str, text: str) -> None +``` + +One bookmark: its name, id, story, and the visible text it wraps. + +### `bookmark_id` + +```python +bookmark_id: int +``` + +### `is_point` + +```python +is_point: bool +``` + +### `name` + +```python +name: str +``` + +### `story` + +```python +story: str +``` + +### `text` + +```python +text: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `DEL_TEXT` + +```python +DEL_TEXT = qn('w:delText') +``` + +## `INSTR_TEXT` + +```python +INSTR_TEXT = qn('w:instrText') +``` + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `create_bookmark` + +```python +create_bookmark(document: 'Document', span: 'Span', name: str) -> BookmarkInfo +``` + +Bookmark exactly `span`'s text under `name`, and return its `BookmarkInfo`. + +Use this to give a span a stable target that survives later edits; cross-references and +`add_reference_field` ride on bookmarks. Splits boundary runs so the markers wrap the +span's characters exactly. Refuses a protected document, a foreign or stale span, and a +name Word rejects or the document already uses. + +## `delete_bookmark` + +```python +delete_bookmark(document: 'Document', name: str) -> None +``` + +Remove `name`'s markers, leaving the text in place. + +Use this to retire a bookmark without touching content. Refuses while a field +instruction still references the name, since a dangling REF renders "Error! Reference +source not found." in Word. Refuses a protected document and an unknown name. + +## `is_direct_run_child` + +```python +is_direct_run_child(element: '_Element') -> bool +``` + +Whether ``element`` is a direct child of a ``w:r`` element. + +## `list_bookmarks` + +```python +list_bookmarks(document: 'Document') -> 'List[BookmarkInfo]' +``` + +Every bookmark across every story, in document order. + +## `project_run_child` + +```python +project_run_child(element: '_Element') -> RunChildProjection +``` + +Return the conservative text projection for a direct ``w:r`` child. + +## `require_span_owner` + +```python +require_span_owner(document: 'Document', span: 'Span', *, argument: str = 'span') -> None +``` + +Refuse a live span captured from a different document package. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.commentops` + +Comment thread operations: anchored text, replies, resolution. + +## `COMMENTS_EXTENDED_CONTENT_TYPE` + +```python +COMMENTS_EXTENDED_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml' +``` + +## `COMMENTS_EXTENDED_RELATIONSHIP_TYPE` + +```python +COMMENTS_EXTENDED_RELATIONSHIP_TYPE = 'http://schemas.microsoft.com/office/2011/relationships/commentsExtended' +``` + +## `COMMENTS_EXTENSIBLE_CONTENT_TYPE` + +```python +COMMENTS_EXTENSIBLE_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml' +``` + +## `COMMENTS_EXTENSIBLE_RELATIONSHIP_TYPE` + +```python +COMMENTS_EXTENSIBLE_RELATIONSHIP_TYPE = 'http://schemas.microsoft.com/office/2018/08/relationships/commentsExtensible' +``` + +## `COMMENTS_IDS_CONTENT_TYPE` + +```python +COMMENTS_IDS_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml' +``` + +## `COMMENTS_IDS_RELATIONSHIP_TYPE` + +```python +COMMENTS_IDS_RELATIONSHIP_TYPE = 'http://schemas.microsoft.com/office/2016/09/relationships/commentsIds' +``` + +## `DEL_TEXT` + +```python +DEL_TEXT = qn('w:delText') +``` + +## `INSTR_TEXT` + +```python +INSTR_TEXT = qn('w:instrText') +``` + +## `anchored_text` + +```python +anchored_text(document: 'Document', comment: 'Comment') -> str +``` + +The document text `comment` is anchored to, taken from its range marks. + +Refuses a stale or foreign comment, and a comment whose range marks are missing or +crossed. + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `comment_thread` + +```python +comment_thread(document: 'Document') -> Tuple[dict, ...] +``` + +Every comment with its thread state: id, author, text, resolved, parent id, and anchored +text where available. + +Use it to read a whole discussion in one pass rather than walking replies. Refuses a +stale comment and a malformed `commentsExtended` part. + +## `delete_comment` + +```python +delete_comment(document: 'Document', comment: 'Comment') -> None +``` + +Delete `comment` and its replies, removing their range marks from the text. + +Refuses a protected document, a stale or foreign comment, and a comments part that is +missing or ambiguous. + +## `is_direct_run_child` + +```python +is_direct_run_child(element: '_Element') -> bool +``` + +Whether ``element`` is a direct child of a ``w:r`` element. + +## `is_resolved` + +```python +is_resolved(document: 'Document', comment: 'Comment') -> bool +``` + +Whether `comment`'s thread is marked resolved. + +Reads `commentsExtended`, where Word keeps resolution state. Refuses a stale or foreign +comment, and a malformed `commentsExtended` part. + +## `parent_of` + +```python +parent_of(document: 'Document', comment: 'Comment') -> Optional[int] +``` + +The comment `comment` replies to, or None when it starts a thread. + +Refuses a stale or foreign comment, and a malformed `commentsExtended` part. + +## `project_run_child` + +```python +project_run_child(element: '_Element') -> RunChildProjection +``` + +Return the conservative text projection for a direct ``w:r`` child. + +## `reply` + +```python +reply(document: 'Document', comment: 'Comment', text: str, *, author: str, initials: Optional[str] = None, date: Optional[dt.datetime] = None) -> 'Comment' +``` + +Add a threaded reply to `comment` and return the new `Comment`. + +The reply gets its own comment-range start, range end, and reference around the same +selected text. Its `w15:paraIdParent` names the parent's final comment-body paragraph; the +reply does not reuse the parent's marker id. Creates `commentsExtended` on first use, since +Word keeps threading outside `w:comment`. Refuses a protected document, a stale or foreign +comment, and a comments part that is missing or ambiguous. + +## `require_comment_owner` + +```python +require_comment_owner(document: 'Document', comment: 'Comment', *, argument: str = 'comment') -> None +``` + +Refuse a comment proxy from another part and detect detached proxies. + +## `resolve` + +```python +resolve(document: 'Document', comment: 'Comment', *, resolved: bool = True) -> None +``` + +Mark `comment`'s thread resolved, or reopen it with `resolved=False`. + +Word keeps resolution in `commentsExtended` rather than on the comment, so this writes +that part. Refuses a protected document, and a stale or foreign comment. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.comments` + +Collection providing access to comments added to this document. + +## `Comment` + +```python +Comment(comment_elm: CT_Comment, comments_part: CommentsPart) +``` + +Bases: `BlockItemContainer` + +Proxy for a single comment in the document. + +Reads author, initials, date and body content, and adds paragraphs or tables. Every +mutation revalidates that the comment is still live first, so a proxy whose part was +removed or replaced refuses instead of writing into a detached tree. + +### `add_paragraph` + +```python +add_paragraph(text: str = '', style: str | ParagraphStyle | None = None) -> Paragraph +``` + +Append a paragraph to this comment's body and return it. + +Re-keys the comment's `commentEx`, its replies' `paraIdParent`, and its `commentsIds` row +onto the new last paragraph, so appending rewrites thread and resolution state. Refuses a +protected document, and a proxy whose part was removed or replaced. + +### `add_table` + +```python +add_table(rows: int, cols: int, width: Length) -> Table +``` + +Append a table to this comment's body and return it. + +Re-keys thread and resolution state onto the new last paragraph, as `add_paragraph` does. +Refuses a protected document, and a proxy whose part was removed or replaced. + +### `author` + +```python +author: str +``` + +Read/write. The recorded author of this comment. + +This field is required but can be set to the empty string. + +### `comment_id` + +```python +comment_id: int +``` + +The unique identifier of this comment. + +### `initials` + +```python +initials: str | None +``` + +Read/write. The recorded initials of the comment author. + +This attribute is optional in the XML, returns `None` if not set. Assigning `None` removes +any existing initials from the XML. + +### `text` + +```python +text: str +``` + +The text content of this comment as a string. + +Only content in paragraphs is included and of course all emphasis and styling is stripped. + +Paragraph boundaries are indicated with a newline (`"\\n"`) + +### `timestamp` + +```python +timestamp: dt.datetime | None +``` + +The date and time this comment was authored. + +This attribute is optional in the XML, returns `None` if not set. + +## `Comments` + +```python +Comments(comments_elm: CT_Comments, comments_part: CommentsPart) +``` + +Collection containing the comments added to this document. + +### `add_comment` + +```python +add_comment(text: str = '', author: str = '', initials: str | None = '') -> Comment +``` + +Add a new comment to the document and return it. + +Assigns a unique id and writes the modern identity parts (`commentsIds`, +`commentsExtensible`, a `w14:paraId`) that Word needs to thread replies. Refuses a +protected document, a collection whose part was removed or replaced, and an ambiguous +comments relationship. + +### `get` + +```python +get(comment_id: int) -> Comment | None +``` + +Return the comment identified by `comment_id`, or `None` if not found. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + +## `rollback_xml_on_error` + +```python +rollback_xml_on_error(root: '_Element') -> Generator[None, None, None] +``` + +Restore one live XML tree after an error in a local compound edit. + + + + + +# `docx.composition` + +Cross-document composition. + +## `CompositionFinding` + +```python +CompositionFinding(kind: str, detail: str) -> None +``` + +### `detail` + +```python +detail: str +``` + +### `kind` + +```python +kind: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `CompositionReport` + +```python +CompositionReport(inserted_blocks: int = 0, style_map: Dict[str, str] = dict(), imported_styles: List[str] = list(), renamed_styles: Dict[str, str] = dict(), numbering_map: Dict[int, int] = dict(), media_copied: List[str] = list(), bookmarks_renamed: Dict[str, str] = dict(), findings: List[CompositionFinding] = list(), declared_parts: List[str] = list()) -> None +``` + +Everything one composition call did — the declared changed-part +budget, the reconciliation maps, and what was reported instead of done. + +### `bookmarks_renamed` + +```python +bookmarks_renamed: Dict[str, str] = field(default_factory=dict) +``` + +### `declared_parts` + +```python +declared_parts: List[str] = field(default_factory=list) +``` + +### `findings` + +```python +findings: List[CompositionFinding] = field(default_factory=list) +``` + +### `imported_styles` + +```python +imported_styles: List[str] = field(default_factory=list) +``` + +### `inserted_blocks` + +```python +inserted_blocks: int = 0 +``` + +### `media_copied` + +```python +media_copied: List[str] = field(default_factory=list) +``` + +### `numbering_map` + +```python +numbering_map: Dict[int, int] = field(default_factory=dict) +``` + +### `renamed_styles` + +```python +renamed_styles: Dict[str, str] = field(default_factory=dict) +``` + +### `style_map` + +```python +style_map: Dict[str, str] = field(default_factory=dict) +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `append_document` + +```python +append_document(document: 'Document', source: 'Document', *, section: str = 'new_page', styles: str = 'match_by_name', headers: str = 'destination') -> CompositionReport +``` + +Append `source`'s whole body to `document`, and return a `CompositionReport`. + +Keeps the destination's headers and footers by default and authors no new `w:sectPr`: +`section="new_page"` prefixes a page break, `"continuous"` appends flush. +`headers="source"` overwrites the destination's last-section header and footer and flips +the document-wide even/odd setting. Refuses a protected document and an empty body on +either side. Also refuses when insertion after the destination's final paragraph, +table, or block content control would remain inside an open field result. + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `insert_blocks_from` + +```python +insert_blocks_from(document: 'Document', source: 'Document', start_anchor: 'Document', *, anchor: 'Document', end_anchor: 'Document' = None, count: int = 1, styles: str = 'match_by_name', include_start: bool = True, include_end: bool = True) -> CompositionReport +``` + +Copy a block range from `source` after `anchor`, and return a `CompositionReport`. + +Reconciles styles, numbering, media and bookmarks so the copy keeps its appearance. +`start_anchor` and `end_anchor` identify SOURCE paragraphs whose containing top-level body +blocks form the range endpoints. A direct body paragraph or a paragraph in a top-level +content control can serve as an endpoint; paragraphs in tables, table cells, and text boxes +cannot. Both endpoints are included by default; setting either inclusion flag false excludes +that endpoint's block. With no `end_anchor`, `count` blocks are copied beginning at the start +block or the following block when `include_start=False`. With an `end_anchor`, `count` is +validated but does not limit the range. `include_end=False` without an end anchor raises +`ValueError`. Refuses an empty adjusted range, a protected destination, an endpoint that is +missing, ambiguous, or spans multiple paragraphs, and source content this package cannot +carry over: revisions, comments, OLE objects, EMF/WMF images. Live source +endpoints may come from any supported inspection view. A live destination +must come from ``view="current"``; reacquire a historical destination before +composing. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.controls` + +Content-control (structured document tag) surface — the templating + +## `Control` + +```python +Control(sdt: '_Element', story: str, document: 'Document') -> None +``` + +Live proxy for one content control. + +### `alias` + +```python +alias: Optional[str] +``` + +### `control_type` + +```python +control_type: str +``` + +### `info` + +```python +info() -> ControlInfo +``` + +### `is_data_bound` + +```python +is_data_bound: bool +``` + +### `set_value` + +```python +set_value(value: 'Union[str, bool, dt.date, dt.datetime]') -> None +``` + +Set the control's value, validating fully before mutating anything. + +Text and rich-text controls take a string, checkboxes a bool, dropdowns a value from +their `w:listItem` choices, dates an ISO date. Refuses a protected document, a stale or +foreign control, a locked or data-bound surface, a picture, group or building-block +control, a dropdown value outside its choices, and an unsupported date format. + +### `showing_placeholder` + +```python +showing_placeholder: bool +``` + +### `tag` + +```python +tag: Optional[str] +``` + +### `value` + +```python +value: 'Union[str, bool]' +``` + +The control's current value (bool for checkboxes, text otherwise). + +## `ControlInfo` + +```python +ControlInfo(tag: Optional[str], alias: Optional[str], control_type: str, value: str, story: str, showing_placeholder: bool, is_data_bound: bool, choices: Tuple[str, ...]) -> None +``` + +Identity and current state of one content control. + +### `alias` + +```python +alias: Optional[str] +``` + +### `choices` + +```python +choices: Tuple[str, ...] +``` + +### `control_type` + +```python +control_type: str +``` + +### `is_data_bound` + +```python +is_data_bound: bool +``` + +### `showing_placeholder` + +```python +showing_placeholder: bool +``` + +### `story` + +```python +story: str +``` + +### `tag` + +```python +tag: Optional[str] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +### `value` + +```python +value: str +``` + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `get_control` + +```python +get_control(document: 'Document', *, tag: Optional[str] = None, alias: Optional[str] = None) -> Control +``` + +The single control matching `tag` and/or `alias`, or a typed refusal. + +## `iter_controls` + +```python +iter_controls(document: 'Document') -> 'Iterator[Control]' +``` + +Every content control in every story part, document order. + +## `list_controls` + +```python +list_controls(document: 'Document') -> Tuple[ControlInfo, ...] +``` + +Identity and state of every control (schema-stable via .to_dict()). + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + +## `set_control_value` + +```python +set_control_value(document: 'Document', value: 'Union[str, bool, dt.date, dt.datetime]', *, tag: Optional[str] = None, alias: Optional[str] = None) -> None +``` + +Set the value of the control that `tag` names. + +Refuses when no control carries the tag and when several do, plus every refusal +`Control.set_value` raises. + + + + + +# `docx.dml.color` + +DrawingML objects related to color, ColorFormat being the most prominent. + +## `ColorFormat` + +```python +ColorFormat(rPr_parent: RPrParent) +``` + +Bases: `ElementProxy` + +Provides access to color settings like RGB color, theme color, and luminance adjustments. + +### `rgb` + +```python +rgb: RGBColor | None +``` + +An `RGBColor` value or `None` if no RGB color is specified. + +When `type` is `MSO_COLOR_TYPE.RGB`, the value of this property will always be an +`RGBColor` value. It may also be an `RGBColor` value if `type` is +`MSO_COLOR_TYPE.THEME`, as Word writes the current value of a theme color when one is +assigned. In that case, the RGB value should be interpreted as no more than a good guess +however, as the theme color takes precedence at rendering time. Its value is `None` +whenever `type` is either `None` or `MSO_COLOR_TYPE.AUTO`. + +Assigning an `RGBColor` value causes `type` to become `MSO_COLOR_TYPE.RGB` and any +theme color is removed. Assigning `None` causes any color to be removed such that the +effective color is inherited from the style hierarchy. + +### `theme_color` + +```python +theme_color: MSO_THEME_COLOR | None +``` + +Member of `MsoThemeColorIndex` or `None` if no theme color is specified. + +When `type` is `MSO_COLOR_TYPE.THEME`, the value of this property will always be a +member of `MsoThemeColorIndex`. When `type` has any other value, the value of +this property is `None`. + +Assigning a member of `MsoThemeColorIndex` causes `type` to become +`MSO_COLOR_TYPE.THEME`. Any existing RGB value is retained but ignored by Word. Assigning +`None` causes any color specification to be removed such that the effective color is +inherited from the style hierarchy. + +### `type` + +```python +type: MSO_COLOR_TYPE | None +``` + +Read-only. + +A member of `MsoColorType`, one of RGB, THEME, or AUTO, corresponding to the way this +color is defined. Its value is `None` if no color is applied at this level, which causes +the effective color to be inherited from the style hierarchy. + +## `RPrParent` + +```python +RPrParent: TypeAlias = 'CT_R' +``` + + + + + +# `docx.document` + +`Document` and closely related objects. + +## `Document` + +```python +Document(element: CT_Document, part: DocumentPart) +``` + +Bases: `ElementProxy` + +WordprocessingML (WML) document. + +Not intended to be constructed directly. Use `docx.Document` to open or create +a document. + +### `add_comment` + +```python +add_comment(runs: Run | Sequence[Run], text: str | None = '', author: str = '', initials: str | None = '') -> Comment +``` + +Add a comment anchored to `runs`, and return it. + +Pass one `Run` or a sequence; only the first and last are used, so handing over +`paragraph.runs` works. Reach for `Span.comment` instead when the anchor should match +exact text rather than whole runs. Refuses a protected document, runs belonging to +another document, and a comments part that is missing or ambiguous. + +### `add_heading` + +```python +add_heading(text: str = '', level: int = 1) +``` + +Return a heading paragraph newly added to the end of the document. + +The heading paragraph will contain `text` and have its paragraph style +determined by `level`. If `level` is 0, the style is set to `Title`. If `level` +is 1 (or omitted), `Heading 1` is used. Otherwise the style is set to `Heading +{level}`. Raises `ValueError` if `level` is outside the range 0-9. + +### `add_page_break` + +```python +add_page_break() +``` + +Return newly `Paragraph` object containing only a page break. + +### `add_paragraph` + +```python +add_paragraph(text: str = '', style: str | ParagraphStyle | None = None) -> Paragraph +``` + +Return paragraph newly added to the end of the document. + +The paragraph is populated with `text` and having paragraph style `style`. + +`text` can contain tab (``\t``) characters, which are converted to the +appropriate XML form for a tab. `text` can also include newline (``\n``) or +carriage return (``\r``) characters, each of which is converted to a line +break. + +### `add_picture` + +```python +add_picture(image_path_or_stream: str | IO[bytes], width: int | Length | None = None, height: int | Length | None = None) +``` + +Return new picture shape added in its own paragraph at end of the document. + +The picture contains the image at `image_path_or_stream`, scaled based on +`width` and `height`. If neither width nor height is specified, the picture +appears at its native size. If only one is specified, it is used to compute a +scaling factor that is then applied to the unspecified dimension, preserving the +aspect ratio of the image. The native size of the picture is calculated using +the dots-per-inch (dpi) value specified in the image file, defaulting to 72 dpi +if no value is specified, as is often the case. + +### `add_section` + +```python +add_section(start_type: WD_SECTION = WD_SECTION.NEW_PAGE) +``` + +Return a `Section` object newly added at the end of the document. + +The optional `start_type` argument must be a member of the `WdSectionStart` +enumeration, and defaults to ``WD_SECTION.NEW_PAGE`` if not provided. + +### `add_table` + +```python +add_table(rows: int, cols: int, style: str | _TableStyle | None = None) +``` + +Add a table having row and column counts of `rows` and `cols` respectively. + +`style` may be a table style object or a table style name. If `style` is `None`, +the table inherits the default table style of the document. + +### `comments` + +```python +comments: Comments +``` + +A `Comments` object providing access to comments added to the document. + +### `core_properties` + +```python +core_properties +``` + +A `CoreProperties` object providing Dublin Core properties of document. + +### `inline_shapes` + +```python +inline_shapes +``` + +The `InlineShapes` collection for this document. + +An inline shape is a graphical object, such as a picture, contained in a run of +text and behaving like a character glyph, being flowed like other text in a +paragraph. + +### `iter_inner_content` + +```python +iter_inner_content() -> Iterator[Paragraph | Table] +``` + +Generate each `Paragraph` or `Table` in this document in document order. + +### `paragraphs` + +```python +paragraphs: List[Paragraph] +``` + +The `Paragraph` instances in the document, in document order. + +Note that paragraphs within revision marks such as ```` or ```` do +not appear in this list. + +### `part` + +```python +part: DocumentPart +``` + +The `DocumentPart` object of this document. + +### `revisions` + +```python +revisions +``` + +`Revisions` object enumerating tracked changes across all story parts. + +paper-docx addition: a fresh snapshot on each access; supports +accept/reject of all revisions or filtered by author. See +`docx.revision`. + +### `save` + +```python +save(path_or_stream: str | IO[bytes]) +``` + +Save this document to `path_or_stream`. + +`path_or_stream` can be either a path to a filesystem location (a string) or a +file-like object. + +### `sections` + +```python +sections: Sections +``` + +`Sections` object providing access to each section in this document. + +### `settings` + +```python +settings: Settings +``` + +A `Settings` object providing access to the document-level settings. + +### `styles` + +```python +styles +``` + +A `Styles` object providing access to the styles in this document. + +### `tables` + +```python +tables: List[Table] +``` + +All `Table` instances in the document, in document order. + +Note that only tables appearing at the top level of the document appear in this +list; a table nested inside a table cell does not appear. A table within +revision marks such as ```` or ```` will also not appear in the +list. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.drawing` + +DrawingML-related objects are in this subpackage. + +## `Drawing` + +```python +Drawing(drawing: CT_Drawing, parent: t.ProvidesStoryPart) +``` + +Bases: `Parented` + +Container for a DrawingML object. + +### `has_picture` + +```python +has_picture: bool +``` + +True when `drawing` contains an embedded picture. + +A drawing can contain a picture, but it can also contain a chart, SmartArt, or a +drawing canvas. Methods related to a picture, like `.image`, will raise when the drawing +does not contain a picture. Use this value to determine whether image methods will succeed. + +This value is `False` when a linked picture is present. This should be relatively rare and +the image would only be retrievable from the filesystem. + +Note this does not distinguish between inline and floating images. The presence of either +one will cause this value to be `True`. + +### `image` + +```python +image: Image +``` + +An `Image` proxy object for the image in this (picture) drawing. + +Raises `ValueError` when this drawing does contains something other than a picture. Use +`.has_picture` to qualify drawing objects before using this property. + +### `replace_picture` + +```python +replace_picture(image_descriptor: str | IO[bytes]) -> None +``` + +Swap this drawing's image bytes, keeping display size and position. + +Always writes a new image part, so other shapes sharing the old part are unchanged; +the old relationship stays behind. Refuses a drawing with no picture, a linked picture +whose bytes live outside the package, and a protected document. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.enum.base` + +Base classes and other objects used by enumerations. + +## `BaseEnum` + +Bases: `int`, `Enum` + +Base class for Enums that do not map XML attr values. + +The enum's value will be an integer, corresponding to the integer assigned the +corresponding member in the MS API enum of the same name. + +## `BaseXmlEnum` + +Bases: `int`, `Enum` + +Base class for Enums that also map XML attr values. + +The enum's value will be an integer, corresponding to the integer assigned the +corresponding member in the MS API enum of the same name. + +### `from_xml` + +```python +from_xml(xml_value: str | None) -> Self +``` + +Enumeration member corresponding to XML attribute value `xml_value`. + +Example:: + + >>> WD_PARAGRAPH_ALIGNMENT.from_xml("center") + WD_PARAGRAPH_ALIGNMENT.CENTER + +### `to_xml` + +```python +to_xml(value: int | _T | None) -> str | None +``` + +XML value of this enum member, generally an XML attribute value. + +### `xml_value` + +```python +xml_value: str | None +``` + +## `DocsPageFormatter` + +```python +DocsPageFormatter(clsname: str, clsdict: Dict[str, Any]) +``` + +Generate an .rst doc page for an enumeration. + +Formats a RestructuredText documention page (string) for the enumeration class parts +passed to the constructor. An immutable one-shot service object. + +### `page_str` + +```python +page_str +``` + +The RestructuredText documentation page for the enumeration. + +This is the only API member for the class. + + + + + +# `docx.enum.dml` + +Enumerations used by DrawingML objects. + +## `MSO_COLOR_TYPE` + +Bases: `BaseEnum` + +Specifies the color specification scheme. + +Example:: + + from docx.enum.dml import MSO_COLOR_TYPE + + assert font.color.type == MSO_COLOR_TYPE.SCHEME + +MS API name: `MsoColorType` + +http://msdn.microsoft.com/en-us/library/office/ff864912(v=office.15).aspx + +### `AUTO` + +```python +AUTO = (101, 'Color is determined automatically by the application.') +``` + +Color is determined automatically by the application. + +### `RGB` + +```python +RGB = (1, 'Color is specified by an `RGBColor` value.') +``` + +Color is specified by an `RGBColor` value. + +### `THEME` + +```python +THEME = (2, 'Color is one of the preset theme colors.') +``` + +Color is one of the preset theme colors. + +## `MSO_THEME_COLOR` + +```python +MSO_THEME_COLOR = MSO_THEME_COLOR_INDEX +``` + +## `MSO_THEME_COLOR_INDEX` + +Bases: `BaseXmlEnum` + +Indicates the Office theme color, one of those shown in the color gallery on the +formatting ribbon. + +Alias: ``MSO_THEME_COLOR`` + +Example:: + + from docx.enum.dml import MSO_THEME_COLOR + + font.color.theme_color = MSO_THEME_COLOR.ACCENT_1 + +MS API name: `MsoThemeColorIndex` + +http://msdn.microsoft.com/en-us/library/office/ff860782(v=office.15).aspx + +### `ACCENT_1` + +```python +ACCENT_1 = (5, 'accent1', 'Specifies the Accent 1 theme color.') +``` + +Specifies the Accent 1 theme color. + +### `ACCENT_2` + +```python +ACCENT_2 = (6, 'accent2', 'Specifies the Accent 2 theme color.') +``` + +Specifies the Accent 2 theme color. + +### `ACCENT_3` + +```python +ACCENT_3 = (7, 'accent3', 'Specifies the Accent 3 theme color.') +``` + +Specifies the Accent 3 theme color. + +### `ACCENT_4` + +```python +ACCENT_4 = (8, 'accent4', 'Specifies the Accent 4 theme color.') +``` + +Specifies the Accent 4 theme color. + +### `ACCENT_5` + +```python +ACCENT_5 = (9, 'accent5', 'Specifies the Accent 5 theme color.') +``` + +Specifies the Accent 5 theme color. + +### `ACCENT_6` + +```python +ACCENT_6 = (10, 'accent6', 'Specifies the Accent 6 theme color.') +``` + +Specifies the Accent 6 theme color. + +### `BACKGROUND_1` + +```python +BACKGROUND_1 = (14, 'background1', 'Specifies the Background 1 theme color.') +``` + +Specifies the Background 1 theme color. + +### `BACKGROUND_2` + +```python +BACKGROUND_2 = (16, 'background2', 'Specifies the Background 2 theme color.') +``` + +Specifies the Background 2 theme color. + +### `DARK_1` + +```python +DARK_1 = (1, 'dark1', 'Specifies the Dark 1 theme color.') +``` + +Specifies the Dark 1 theme color. + +### `DARK_2` + +```python +DARK_2 = (3, 'dark2', 'Specifies the Dark 2 theme color.') +``` + +Specifies the Dark 2 theme color. + +### `FOLLOWED_HYPERLINK` + +```python +FOLLOWED_HYPERLINK = (12, 'followedHyperlink', 'Specifies the theme color for a clicked hyperlink.') +``` + +Specifies the theme color for a clicked hyperlink. + +### `HYPERLINK` + +```python +HYPERLINK = (11, 'hyperlink', 'Specifies the theme color for a hyperlink.') +``` + +Specifies the theme color for a hyperlink. + +### `LIGHT_1` + +```python +LIGHT_1 = (2, 'light1', 'Specifies the Light 1 theme color.') +``` + +Specifies the Light 1 theme color. + +### `LIGHT_2` + +```python +LIGHT_2 = (4, 'light2', 'Specifies the Light 2 theme color.') +``` + +Specifies the Light 2 theme color. + +### `NOT_THEME_COLOR` + +```python +NOT_THEME_COLOR = (0, 'UNMAPPED', 'Indicates the color is not a theme color.') +``` + +Indicates the color is not a theme color. + +### `TEXT_1` + +```python +TEXT_1 = (13, 'text1', 'Specifies the Text 1 theme color.') +``` + +Specifies the Text 1 theme color. + +### `TEXT_2` + +```python +TEXT_2 = (15, 'text2', 'Specifies the Text 2 theme color.') +``` + +Specifies the Text 2 theme color. + + + + + +# `docx.enum.section` + +Enumerations related to the main document in WordprocessingML files. + +## `WD_HEADER_FOOTER` + +```python +WD_HEADER_FOOTER = WD_HEADER_FOOTER_INDEX +``` + +## `WD_HEADER_FOOTER_INDEX` + +Bases: `BaseXmlEnum` + +Alias: **WD_HEADER_FOOTER** + +Specifies one of the three possible header/footer definitions for a section. + +For internal use only; not part of the python-docx API. + +MS API name: `WdHeaderFooterIndex` +URL: https://docs.microsoft.com/en-us/office/vba/api/word.wdheaderfooterindex + +### `EVEN_PAGE` + +```python +EVEN_PAGE = (3, 'even', 'Header for even pages of recto/verso section.') +``` + +Header for even pages of recto/verso section. + +### `FIRST_PAGE` + +```python +FIRST_PAGE = (2, 'first', 'Header for first page of section.') +``` + +Header for first page of section. + +### `PRIMARY` + +```python +PRIMARY = (1, 'default', 'Header for odd pages or all if no even header.') +``` + +Header for odd pages or all if no even header. + +## `WD_ORIENT` + +```python +WD_ORIENT = WD_ORIENTATION +``` + +## `WD_ORIENTATION` + +Bases: `BaseXmlEnum` + +Alias: **WD_ORIENT** + +Specifies the page layout orientation. + +Example:: + + from docx.enum.section import WD_ORIENT + + section = document.sections[-1] section.orientation = WD_ORIENT.LANDSCAPE + +MS API name: `WdOrientation` +MS API URL: http://msdn.microsoft.com/en-us/library/office/ff837902.aspx + +### `LANDSCAPE` + +```python +LANDSCAPE = (1, 'landscape', 'Landscape orientation.') +``` + +Landscape orientation. + +### `PORTRAIT` + +```python +PORTRAIT = (0, 'portrait', 'Portrait orientation.') +``` + +Portrait orientation. + +## `WD_SECTION` + +```python +WD_SECTION = WD_SECTION_START +``` + +## `WD_SECTION_START` + +Bases: `BaseXmlEnum` + +Alias: **WD_SECTION** + +Specifies the start type of a section break. + +Example:: + + from docx.enum.section import WD_SECTION + + section = document.sections[0] section.start_type = WD_SECTION.NEW_PAGE + +MS API name: `WdSectionStart` +MS API URL: http://msdn.microsoft.com/en-us/library/office/ff840975.aspx + +### `CONTINUOUS` + +```python +CONTINUOUS = (0, 'continuous', 'Continuous section break.') +``` + +Continuous section break. + +### `EVEN_PAGE` + +```python +EVEN_PAGE = (3, 'evenPage', 'Even pages section break.') +``` + +Even pages section break. + +### `NEW_COLUMN` + +```python +NEW_COLUMN = (1, 'nextColumn', 'New column section break.') +``` + +New column section break. + +### `NEW_PAGE` + +```python +NEW_PAGE = (2, 'nextPage', 'New page section break.') +``` + +New page section break. + +### `ODD_PAGE` + +```python +ODD_PAGE = (4, 'oddPage', 'Section begins on next odd page.') +``` + +Section begins on next odd page. + + + + + +# `docx.enum.shape` + +Enumerations related to DrawingML shapes in WordprocessingML files. + +## `WD_INLINE_SHAPE` + +```python +WD_INLINE_SHAPE = WD_INLINE_SHAPE_TYPE +``` + +## `WD_INLINE_SHAPE_TYPE` + +Bases: `Enum` + +Corresponds to WdInlineShapeType enumeration. + +http://msdn.microsoft.com/en-us/library/office/ff192587.aspx. + +### `CHART` + +```python +CHART = 12 +``` + +### `LINKED_PICTURE` + +```python +LINKED_PICTURE = 4 +``` + +### `NOT_IMPLEMENTED` + +```python +NOT_IMPLEMENTED = -6 +``` + +### `PICTURE` + +```python +PICTURE = 3 +``` + +### `SMART_ART` + +```python +SMART_ART = 15 +``` + + + + + +# `docx.enum.style` + +Enumerations related to styles. + +## `WD_BUILTIN_STYLE` + +Bases: `BaseEnum` + +Alias: **WD_STYLE** + +Specifies a built-in Microsoft Word style. + +Example:: + + from docx import Document + from docx.enum.style import WD_STYLE + + document = Document() + styles = document.styles + style = styles[WD_STYLE.BODY_TEXT] + + +MS API name: `WdBuiltinStyle` + +http://msdn.microsoft.com/en-us/library/office/ff835210.aspx + +### `BLOCK_QUOTATION` + +```python +BLOCK_QUOTATION = (-85, 'Block Text.') +``` + +Block Text. + +### `BODY_TEXT` + +```python +BODY_TEXT = (-67, 'Body Text.') +``` + +Body Text. + +### `BODY_TEXT_2` + +```python +BODY_TEXT_2 = (-81, 'Body Text 2.') +``` + +Body Text 2. + +### `BODY_TEXT_3` + +```python +BODY_TEXT_3 = (-82, 'Body Text 3.') +``` + +Body Text 3. + +### `BODY_TEXT_FIRST_INDENT` + +```python +BODY_TEXT_FIRST_INDENT = (-78, 'Body Text First Indent.') +``` + +Body Text First Indent. + +### `BODY_TEXT_FIRST_INDENT_2` + +```python +BODY_TEXT_FIRST_INDENT_2 = (-79, 'Body Text First Indent 2.') +``` + +Body Text First Indent 2. + +### `BODY_TEXT_INDENT` + +```python +BODY_TEXT_INDENT = (-68, 'Body Text Indent.') +``` + +Body Text Indent. + +### `BODY_TEXT_INDENT_2` + +```python +BODY_TEXT_INDENT_2 = (-83, 'Body Text Indent 2.') +``` + +Body Text Indent 2. + +### `BODY_TEXT_INDENT_3` + +```python +BODY_TEXT_INDENT_3 = (-84, 'Body Text Indent 3.') +``` + +Body Text Indent 3. + +### `BOOK_TITLE` + +```python +BOOK_TITLE = (-265, 'Book Title.') +``` + +Book Title. + +### `CAPTION` + +```python +CAPTION = (-35, 'Caption.') +``` + +Caption. + +### `CLOSING` + +```python +CLOSING = (-64, 'Closing.') +``` + +Closing. + +### `COMMENT_REFERENCE` + +```python +COMMENT_REFERENCE = (-40, 'Comment Reference.') +``` + +Comment Reference. + +### `COMMENT_TEXT` + +```python +COMMENT_TEXT = (-31, 'Comment Text.') +``` + +Comment Text. + +### `DATE` + +```python +DATE = (-77, 'Date.') +``` + +Date. + +### `DEFAULT_PARAGRAPH_FONT` + +```python +DEFAULT_PARAGRAPH_FONT = (-66, 'Default Paragraph Font.') +``` + +Default Paragraph Font. + +### `EMPHASIS` + +```python +EMPHASIS = (-89, 'Emphasis.') +``` + +Emphasis. + +### `ENDNOTE_REFERENCE` + +```python +ENDNOTE_REFERENCE = (-43, 'Endnote Reference.') +``` + +Endnote Reference. + +### `ENDNOTE_TEXT` + +```python +ENDNOTE_TEXT = (-44, 'Endnote Text.') +``` + +Endnote Text. + +### `ENVELOPE_ADDRESS` + +```python +ENVELOPE_ADDRESS = (-37, 'Envelope Address.') +``` + +Envelope Address. + +### `ENVELOPE_RETURN` + +```python +ENVELOPE_RETURN = (-38, 'Envelope Return.') +``` + +Envelope Return. + +### `FOOTER` + +```python +FOOTER = (-33, 'Footer.') +``` + +Footer. + +### `FOOTNOTE_REFERENCE` + +```python +FOOTNOTE_REFERENCE = (-39, 'Footnote Reference.') +``` + +Footnote Reference. + +### `FOOTNOTE_TEXT` + +```python +FOOTNOTE_TEXT = (-30, 'Footnote Text.') +``` + +Footnote Text. + +### `HEADER` + +```python +HEADER = (-32, 'Header.') +``` + +Header. + +### `HEADING_1` + +```python +HEADING_1 = (-2, 'Heading 1.') +``` + +Heading 1. + +### `HEADING_2` + +```python +HEADING_2 = (-3, 'Heading 2.') +``` + +Heading 2. + +### `HEADING_3` + +```python +HEADING_3 = (-4, 'Heading 3.') +``` + +Heading 3. + +### `HEADING_4` + +```python +HEADING_4 = (-5, 'Heading 4.') +``` + +Heading 4. + +### `HEADING_5` + +```python +HEADING_5 = (-6, 'Heading 5.') +``` + +Heading 5. + +### `HEADING_6` + +```python +HEADING_6 = (-7, 'Heading 6.') +``` + +Heading 6. + +### `HEADING_7` + +```python +HEADING_7 = (-8, 'Heading 7.') +``` + +Heading 7. + +### `HEADING_8` + +```python +HEADING_8 = (-9, 'Heading 8.') +``` + +Heading 8. + +### `HEADING_9` + +```python +HEADING_9 = (-10, 'Heading 9.') +``` + +Heading 9. + +### `HTML_ACRONYM` + +```python +HTML_ACRONYM = (-96, 'HTML Acronym.') +``` + +HTML Acronym. + +### `HTML_ADDRESS` + +```python +HTML_ADDRESS = (-97, 'HTML Address.') +``` + +HTML Address. + +### `HTML_CITE` + +```python +HTML_CITE = (-98, 'HTML Cite.') +``` + +HTML Cite. + +### `HTML_CODE` + +```python +HTML_CODE = (-99, 'HTML Code.') +``` + +HTML Code. + +### `HTML_DFN` + +```python +HTML_DFN = (-100, 'HTML Definition.') +``` + +HTML Definition. + +### `HTML_KBD` + +```python +HTML_KBD = (-101, 'HTML Keyboard.') +``` + +HTML Keyboard. + +### `HTML_NORMAL` + +```python +HTML_NORMAL = (-95, 'Normal (Web).') +``` + +Normal (Web). + +### `HTML_PRE` + +```python +HTML_PRE = (-102, 'HTML Preformatted.') +``` + +HTML Preformatted. + +### `HTML_SAMP` + +```python +HTML_SAMP = (-103, 'HTML Sample.') +``` + +HTML Sample. + +### `HTML_TT` + +```python +HTML_TT = (-104, 'HTML Typewriter.') +``` + +HTML Typewriter. + +### `HTML_VAR` + +```python +HTML_VAR = (-105, 'HTML Variable.') +``` + +HTML Variable. + +### `HYPERLINK` + +```python +HYPERLINK = (-86, 'Hyperlink.') +``` + +Hyperlink. + +### `HYPERLINK_FOLLOWED` + +```python +HYPERLINK_FOLLOWED = (-87, 'Followed Hyperlink.') +``` + +Followed Hyperlink. + +### `INDEX_1` + +```python +INDEX_1 = (-11, 'Index 1.') +``` + +Index 1. + +### `INDEX_2` + +```python +INDEX_2 = (-12, 'Index 2.') +``` + +Index 2. + +### `INDEX_3` + +```python +INDEX_3 = (-13, 'Index 3.') +``` + +Index 3. + +### `INDEX_4` + +```python +INDEX_4 = (-14, 'Index 4.') +``` + +Index 4. + +### `INDEX_5` + +```python +INDEX_5 = (-15, 'Index 5.') +``` + +Index 5. + +### `INDEX_6` + +```python +INDEX_6 = (-16, 'Index 6.') +``` + +Index 6. + +### `INDEX_7` + +```python +INDEX_7 = (-17, 'Index 7.') +``` + +Index 7. + +### `INDEX_8` + +```python +INDEX_8 = (-18, 'Index 8.') +``` + +Index 8. + +### `INDEX_9` + +```python +INDEX_9 = (-19, 'Index 9.') +``` + +Index 9. + +### `INDEX_HEADING` + +```python +INDEX_HEADING = (-34, 'Index Heading') +``` + +Index Heading + +### `INTENSE_EMPHASIS` + +```python +INTENSE_EMPHASIS = (-262, 'Intense Emphasis.') +``` + +Intense Emphasis. + +### `INTENSE_QUOTE` + +```python +INTENSE_QUOTE = (-182, 'Intense Quote.') +``` + +Intense Quote. + +### `INTENSE_REFERENCE` + +```python +INTENSE_REFERENCE = (-264, 'Intense Reference.') +``` + +Intense Reference. + +### `LINE_NUMBER` + +```python +LINE_NUMBER = (-41, 'Line Number.') +``` + +Line Number. + +### `LIST` + +```python +LIST = (-48, 'List.') +``` + +List. + +### `LIST_2` + +```python +LIST_2 = (-51, 'List 2.') +``` + +List 2. + +### `LIST_3` + +```python +LIST_3 = (-52, 'List 3.') +``` + +List 3. + +### `LIST_4` + +```python +LIST_4 = (-53, 'List 4.') +``` + +List 4. + +### `LIST_5` + +```python +LIST_5 = (-54, 'List 5.') +``` + +List 5. + +### `LIST_BULLET` + +```python +LIST_BULLET = (-49, 'List Bullet.') +``` + +List Bullet. + +### `LIST_BULLET_2` + +```python +LIST_BULLET_2 = (-55, 'List Bullet 2.') +``` + +List Bullet 2. + +### `LIST_BULLET_3` + +```python +LIST_BULLET_3 = (-56, 'List Bullet 3.') +``` + +List Bullet 3. + +### `LIST_BULLET_4` + +```python +LIST_BULLET_4 = (-57, 'List Bullet 4.') +``` + +List Bullet 4. + +### `LIST_BULLET_5` + +```python +LIST_BULLET_5 = (-58, 'List Bullet 5.') +``` + +List Bullet 5. + +### `LIST_CONTINUE` + +```python +LIST_CONTINUE = (-69, 'List Continue.') +``` + +List Continue. + +### `LIST_CONTINUE_2` + +```python +LIST_CONTINUE_2 = (-70, 'List Continue 2.') +``` + +List Continue 2. + +### `LIST_CONTINUE_3` + +```python +LIST_CONTINUE_3 = (-71, 'List Continue 3.') +``` + +List Continue 3. + +### `LIST_CONTINUE_4` + +```python +LIST_CONTINUE_4 = (-72, 'List Continue 4.') +``` + +List Continue 4. + +### `LIST_CONTINUE_5` + +```python +LIST_CONTINUE_5 = (-73, 'List Continue 5.') +``` + +List Continue 5. + +### `LIST_NUMBER` + +```python +LIST_NUMBER = (-50, 'List Number.') +``` + +List Number. + +### `LIST_NUMBER_2` + +```python +LIST_NUMBER_2 = (-59, 'List Number 2.') +``` + +List Number 2. + +### `LIST_NUMBER_3` + +```python +LIST_NUMBER_3 = (-60, 'List Number 3.') +``` + +List Number 3. + +### `LIST_NUMBER_4` + +```python +LIST_NUMBER_4 = (-61, 'List Number 4.') +``` + +List Number 4. + +### `LIST_NUMBER_5` + +```python +LIST_NUMBER_5 = (-62, 'List Number 5.') +``` + +List Number 5. + +### `LIST_PARAGRAPH` + +```python +LIST_PARAGRAPH = (-180, 'List Paragraph.') +``` + +List Paragraph. + +### `MACRO_TEXT` + +```python +MACRO_TEXT = (-46, 'Macro Text.') +``` + +Macro Text. + +### `MESSAGE_HEADER` + +```python +MESSAGE_HEADER = (-74, 'Message Header.') +``` + +Message Header. + +### `NAV_PANE` + +```python +NAV_PANE = (-90, 'Document Map.') +``` + +Document Map. + +### `NORMAL` + +```python +NORMAL = (-1, 'Normal.') +``` + +Normal. + +### `NORMAL_INDENT` + +```python +NORMAL_INDENT = (-29, 'Normal Indent.') +``` + +Normal Indent. + +### `NORMAL_OBJECT` + +```python +NORMAL_OBJECT = (-158, 'Normal (applied to an object).') +``` + +Normal (applied to an object). + +### `NORMAL_TABLE` + +```python +NORMAL_TABLE = (-106, 'Normal (applied within a table).') +``` + +Normal (applied within a table). + +### `NOTE_HEADING` + +```python +NOTE_HEADING = (-80, 'Note Heading.') +``` + +Note Heading. + +### `PAGE_NUMBER` + +```python +PAGE_NUMBER = (-42, 'Page Number.') +``` + +Page Number. + +### `PLAIN_TEXT` + +```python +PLAIN_TEXT = (-91, 'Plain Text.') +``` + +Plain Text. + +### `QUOTE` + +```python +QUOTE = (-181, 'Quote.') +``` + +Quote. + +### `SALUTATION` + +```python +SALUTATION = (-76, 'Salutation.') +``` + +Salutation. + +### `SIGNATURE` + +```python +SIGNATURE = (-65, 'Signature.') +``` + +Signature. + +### `STRONG` + +```python +STRONG = (-88, 'Strong.') +``` + +Strong. + +### `SUBTITLE` + +```python +SUBTITLE = (-75, 'Subtitle.') +``` + +Subtitle. + +### `SUBTLE_EMPHASIS` + +```python +SUBTLE_EMPHASIS = (-261, 'Subtle Emphasis.') +``` + +Subtle Emphasis. + +### `SUBTLE_REFERENCE` + +```python +SUBTLE_REFERENCE = (-263, 'Subtle Reference.') +``` + +Subtle Reference. + +### `TABLE_COLORFUL_GRID` + +```python +TABLE_COLORFUL_GRID = (-172, 'Colorful Grid.') +``` + +Colorful Grid. + +### `TABLE_COLORFUL_LIST` + +```python +TABLE_COLORFUL_LIST = (-171, 'Colorful List.') +``` + +Colorful List. + +### `TABLE_COLORFUL_SHADING` + +```python +TABLE_COLORFUL_SHADING = (-170, 'Colorful Shading.') +``` + +Colorful Shading. + +### `TABLE_DARK_LIST` + +```python +TABLE_DARK_LIST = (-169, 'Dark List.') +``` + +Dark List. + +### `TABLE_LIGHT_GRID` + +```python +TABLE_LIGHT_GRID = (-161, 'Light Grid.') +``` + +Light Grid. + +### `TABLE_LIGHT_GRID_ACCENT_1` + +```python +TABLE_LIGHT_GRID_ACCENT_1 = (-175, 'Light Grid Accent 1.') +``` + +Light Grid Accent 1. + +### `TABLE_LIGHT_LIST` + +```python +TABLE_LIGHT_LIST = (-160, 'Light List.') +``` + +Light List. + +### `TABLE_LIGHT_LIST_ACCENT_1` + +```python +TABLE_LIGHT_LIST_ACCENT_1 = (-174, 'Light List Accent 1.') +``` + +Light List Accent 1. + +### `TABLE_LIGHT_SHADING` + +```python +TABLE_LIGHT_SHADING = (-159, 'Light Shading.') +``` + +Light Shading. + +### `TABLE_LIGHT_SHADING_ACCENT_1` + +```python +TABLE_LIGHT_SHADING_ACCENT_1 = (-173, 'Light Shading Accent 1.') +``` + +Light Shading Accent 1. + +### `TABLE_MEDIUM_GRID_1` + +```python +TABLE_MEDIUM_GRID_1 = (-166, 'Medium Grid 1.') +``` + +Medium Grid 1. + +### `TABLE_MEDIUM_GRID_2` + +```python +TABLE_MEDIUM_GRID_2 = (-167, 'Medium Grid 2.') +``` + +Medium Grid 2. + +### `TABLE_MEDIUM_GRID_3` + +```python +TABLE_MEDIUM_GRID_3 = (-168, 'Medium Grid 3.') +``` + +Medium Grid 3. + +### `TABLE_MEDIUM_LIST_1` + +```python +TABLE_MEDIUM_LIST_1 = (-164, 'Medium List 1.') +``` + +Medium List 1. + +### `TABLE_MEDIUM_LIST_1_ACCENT_1` + +```python +TABLE_MEDIUM_LIST_1_ACCENT_1 = (-178, 'Medium List 1 Accent 1.') +``` + +Medium List 1 Accent 1. + +### `TABLE_MEDIUM_LIST_2` + +```python +TABLE_MEDIUM_LIST_2 = (-165, 'Medium List 2.') +``` + +Medium List 2. + +### `TABLE_MEDIUM_SHADING_1` + +```python +TABLE_MEDIUM_SHADING_1 = (-162, 'Medium Shading 1.') +``` + +Medium Shading 1. + +### `TABLE_MEDIUM_SHADING_1_ACCENT_1` + +```python +TABLE_MEDIUM_SHADING_1_ACCENT_1 = (-176, 'Medium Shading 1 Accent 1.') +``` + +Medium Shading 1 Accent 1. + +### `TABLE_MEDIUM_SHADING_2` + +```python +TABLE_MEDIUM_SHADING_2 = (-163, 'Medium Shading 2.') +``` + +Medium Shading 2. + +### `TABLE_MEDIUM_SHADING_2_ACCENT_1` + +```python +TABLE_MEDIUM_SHADING_2_ACCENT_1 = (-177, 'Medium Shading 2 Accent 1.') +``` + +Medium Shading 2 Accent 1. + +### `TABLE_OF_AUTHORITIES` + +```python +TABLE_OF_AUTHORITIES = (-45, 'Table of Authorities.') +``` + +Table of Authorities. + +### `TABLE_OF_FIGURES` + +```python +TABLE_OF_FIGURES = (-36, 'Table of Figures.') +``` + +Table of Figures. + +### `TITLE` + +```python +TITLE = (-63, 'Title.') +``` + +Title. + +### `TOAHEADING` + +```python +TOAHEADING = (-47, 'TOA Heading.') +``` + +TOA Heading. + +### `TOC_1` + +```python +TOC_1 = (-20, 'TOC 1.') +``` + +TOC 1. + +### `TOC_2` + +```python +TOC_2 = (-21, 'TOC 2.') +``` + +TOC 2. + +### `TOC_3` + +```python +TOC_3 = (-22, 'TOC 3.') +``` + +TOC 3. + +### `TOC_4` + +```python +TOC_4 = (-23, 'TOC 4.') +``` + +TOC 4. + +### `TOC_5` + +```python +TOC_5 = (-24, 'TOC 5.') +``` + +TOC 5. + +### `TOC_6` + +```python +TOC_6 = (-25, 'TOC 6.') +``` + +TOC 6. + +### `TOC_7` + +```python +TOC_7 = (-26, 'TOC 7.') +``` + +TOC 7. + +### `TOC_8` + +```python +TOC_8 = (-27, 'TOC 8.') +``` + +TOC 8. + +### `TOC_9` + +```python +TOC_9 = (-28, 'TOC 9.') +``` + +TOC 9. + +## `WD_STYLE` + +```python +WD_STYLE = WD_BUILTIN_STYLE +``` + +## `WD_STYLE_TYPE` + +Bases: `BaseXmlEnum` + +Specifies one of the four style types: paragraph, character, list, or table. + +Example:: + + from docx import Document + from docx.enum.style import WD_STYLE_TYPE + + styles = Document().styles + assert styles[0].type == WD_STYLE_TYPE.PARAGRAPH + +MS API name: `WdStyleType` + +http://msdn.microsoft.com/en-us/library/office/ff196870.aspx + +### `CHARACTER` + +```python +CHARACTER = (2, 'character', 'Character style.') +``` + +Character style. + +### `LIST` + +```python +LIST = (4, 'numbering', 'List style.') +``` + +List style. + +### `PARAGRAPH` + +```python +PARAGRAPH = (1, 'paragraph', 'Paragraph style.') +``` + +Paragraph style. + +### `TABLE` + +```python +TABLE = (3, 'table', 'Table style.') +``` + +Table style. + + + + + +# `docx.enum.table` + +Enumerations related to tables in WordprocessingML files. + +## `WD_ALIGN_VERTICAL` + +```python +WD_ALIGN_VERTICAL = WD_CELL_VERTICAL_ALIGNMENT +``` + +## `WD_CELL_VERTICAL_ALIGNMENT` + +Bases: `BaseXmlEnum` + +Alias: **WD_ALIGN_VERTICAL** + +Specifies the vertical alignment of text in one or more cells of a table. + +Example:: + + from docx.enum.table import WD_ALIGN_VERTICAL + + table = document.add_table(3, 3) + table.cell(0, 0).vertical_alignment = WD_ALIGN_VERTICAL.BOTTOM + +MS API name: `WdCellVerticalAlignment` + +https://msdn.microsoft.com/en-us/library/office/ff193345.aspx + +### `BOTH` + +```python +BOTH = (101, 'both', "This is an option in the OpenXml spec, but not in Word itself. It's not clear what Word behavior this setting produces. If you find out please let us know and we'll update this documentation. Otherwise, probably best to avoid this option.") +``` + +This is an option in the OpenXml spec, but not in Word itself. + +It's not clear what Word behavior this setting produces. If you find out please let +us know and we'll update this documentation. Otherwise, probably best to avoid this +option. + +### `BOTTOM` + +```python +BOTTOM = (3, 'bottom', 'Text is aligned to the bottom border of the cell.') +``` + +Text is aligned to the bottom border of the cell. + +### `CENTER` + +```python +CENTER = (1, 'center', 'Text is aligned to the center of the cell.') +``` + +Text is aligned to the center of the cell. + +### `TOP` + +```python +TOP = (0, 'top', 'Text is aligned to the top border of the cell.') +``` + +Text is aligned to the top border of the cell. + +## `WD_ROW_HEIGHT` + +```python +WD_ROW_HEIGHT = WD_ROW_HEIGHT_RULE +``` + +## `WD_ROW_HEIGHT_RULE` + +Bases: `BaseXmlEnum` + +Alias: **WD_ROW_HEIGHT** + +Specifies the rule for determining the height of a table row + +Example:: + + from docx.enum.table import WD_ROW_HEIGHT_RULE + + table = document.add_table(3, 3) + table.rows[0].height_rule = WD_ROW_HEIGHT_RULE.EXACTLY + +MS API name: `WdRowHeightRule` + +https://msdn.microsoft.com/en-us/library/office/ff193620.aspx + +### `AT_LEAST` + +```python +AT_LEAST = (1, 'atLeast', 'The row height is at least a minimum specified value.') +``` + +The row height is at least a minimum specified value. + +### `AUTO` + +```python +AUTO = (0, 'auto', 'The row height is adjusted to accommodate the tallest value in the row.') +``` + +The row height is adjusted to accommodate the tallest value in the row. + +### `EXACTLY` + +```python +EXACTLY = (2, 'exact', 'The row height is an exact value.') +``` + +The row height is an exact value. + +## `WD_TABLE_ALIGNMENT` + +Bases: `BaseXmlEnum` + +Specifies table justification type. + +Example:: + + from docx.enum.table import WD_TABLE_ALIGNMENT + + table = document.add_table(3, 3) + table.alignment = WD_TABLE_ALIGNMENT.CENTER + +MS API name: `WdRowAlignment` + +http://office.microsoft.com/en-us/word-help/HV080607259.aspx + +### `CENTER` + +```python +CENTER = (1, 'center', 'Center-aligned.') +``` + +Center-aligned. + +### `LEFT` + +```python +LEFT = (0, 'left', 'Left-aligned') +``` + +Left-aligned + +### `RIGHT` + +```python +RIGHT = (2, 'right', 'Right-aligned.') +``` + +Right-aligned. + +## `WD_TABLE_DIRECTION` + +Bases: `BaseEnum` + +Specifies the direction in which an application orders cells in the specified +table or row. + +Example:: + + from docx.enum.table import WD_TABLE_DIRECTION + + table = document.add_table(3, 3) + table.direction = WD_TABLE_DIRECTION.RTL + +MS API name: `WdTableDirection` + +http://msdn.microsoft.com/en-us/library/ff835141.aspx + +### `LTR` + +```python +LTR = (0, 'The table or row is arranged with the first column in the leftmost position.') +``` + +The table or row is arranged with the first column in the leftmost position. + +### `RTL` + +```python +RTL = (1, 'The table or row is arranged with the first column in the rightmost position.') +``` + +The table or row is arranged with the first column in the rightmost position. + + + + + +# `docx.enum.text` + +Enumerations related to text in WordprocessingML files. + +## `WD_ALIGN_PARAGRAPH` + +```python +WD_ALIGN_PARAGRAPH = WD_PARAGRAPH_ALIGNMENT +``` + +## `WD_BREAK` + +```python +WD_BREAK = WD_BREAK_TYPE +``` + +## `WD_BREAK_TYPE` + +Bases: `Enum` + +Corresponds to WdBreakType enumeration. + +http://msdn.microsoft.com/en-us/library/office/ff195905.aspx. + +### `COLUMN` + +```python +COLUMN = 8 +``` + +### `LINE` + +```python +LINE = 6 +``` + +### `LINE_CLEAR_ALL` + +```python +LINE_CLEAR_ALL = 11 +``` + +### `LINE_CLEAR_LEFT` + +```python +LINE_CLEAR_LEFT = 9 +``` + +### `LINE_CLEAR_RIGHT` + +```python +LINE_CLEAR_RIGHT = 10 +``` + +### `PAGE` + +```python +PAGE = 7 +``` + +### `SECTION_CONTINUOUS` + +```python +SECTION_CONTINUOUS = 3 +``` + +### `SECTION_EVEN_PAGE` + +```python +SECTION_EVEN_PAGE = 4 +``` + +### `SECTION_NEXT_PAGE` + +```python +SECTION_NEXT_PAGE = 2 +``` + +### `SECTION_ODD_PAGE` + +```python +SECTION_ODD_PAGE = 5 +``` + +### `TEXT_WRAPPING` + +```python +TEXT_WRAPPING = 11 +``` + +## `WD_COLOR` + +```python +WD_COLOR = WD_COLOR_INDEX +``` + +## `WD_COLOR_INDEX` + +Bases: `BaseXmlEnum` + +Specifies a standard preset color to apply. + +Used for font highlighting and perhaps other applications. + +* MS API name: `WdColorIndex` +* URL: https://msdn.microsoft.com/EN-US/library/office/ff195343.aspx + +### `AUTO` + +```python +AUTO = (0, 'default', 'Automatic color. Default; usually black.') +``` + +Automatic color. Default; usually black. + +### `BLACK` + +```python +BLACK = (1, 'black', 'Black color.') +``` + +Black color. + +### `BLUE` + +```python +BLUE = (2, 'blue', 'Blue color') +``` + +Blue color + +### `BRIGHT_GREEN` + +```python +BRIGHT_GREEN = (4, 'green', 'Bright green color.') +``` + +Bright green color. + +### `DARK_BLUE` + +```python +DARK_BLUE = (9, 'darkBlue', 'Dark blue color.') +``` + +Dark blue color. + +### `DARK_RED` + +```python +DARK_RED = (13, 'darkRed', 'Dark red color.') +``` + +Dark red color. + +### `DARK_YELLOW` + +```python +DARK_YELLOW = (14, 'darkYellow', 'Dark yellow color.') +``` + +Dark yellow color. + +### `GRAY_25` + +```python +GRAY_25 = (16, 'lightGray', '25% shade of gray color.') +``` + +25% shade of gray color. + +### `GRAY_50` + +```python +GRAY_50 = (15, 'darkGray', '50% shade of gray color.') +``` + +50% shade of gray color. + +### `GREEN` + +```python +GREEN = (11, 'darkGreen', 'Green color.') +``` + +Green color. + +### `INHERITED` + +```python +INHERITED = (-1, None, 'Color is inherited from the style hierarchy.') +``` + +Color is inherited from the style hierarchy. + +### `PINK` + +```python +PINK = (5, 'magenta', 'Pink color.') +``` + +Pink color. + +### `RED` + +```python +RED = (6, 'red', 'Red color.') +``` + +Red color. + +### `TEAL` + +```python +TEAL = (10, 'darkCyan', 'Teal color.') +``` + +Teal color. + +### `TURQUOISE` + +```python +TURQUOISE = (3, 'cyan', 'Turquoise color.') +``` + +Turquoise color. + +### `VIOLET` + +```python +VIOLET = (12, 'darkMagenta', 'Violet color.') +``` + +Violet color. + +### `WHITE` + +```python +WHITE = (8, 'white', 'White color.') +``` + +White color. + +### `YELLOW` + +```python +YELLOW = (7, 'yellow', 'Yellow color.') +``` + +Yellow color. + +## `WD_LINE_SPACING` + +Bases: `BaseXmlEnum` + +Specifies a line spacing format to be applied to a paragraph. + +Example:: + + from docx.enum.text import WD_LINE_SPACING + + paragraph = document.add_paragraph() + paragraph.line_spacing_rule = WD_LINE_SPACING.EXACTLY + + +MS API name: `WdLineSpacing` + +URL: http://msdn.microsoft.com/en-us/library/office/ff844910.aspx + +### `AT_LEAST` + +```python +AT_LEAST = (3, 'atLeast', 'Minimum line spacing is specified amount. Amount is specified separately.') +``` + +Minimum line spacing is specified amount. Amount is specified separately. + +### `DOUBLE` + +```python +DOUBLE = (2, 'UNMAPPED', 'Double spaced.') +``` + +Double spaced. + +### `EXACTLY` + +```python +EXACTLY = (4, 'exact', 'Line spacing is exactly specified amount. Amount is specified separately.') +``` + +Line spacing is exactly specified amount. Amount is specified separately. + +### `MULTIPLE` + +```python +MULTIPLE = (5, 'auto', 'Line spacing is specified as multiple of line heights. Changing font size will change line spacing proportionately.') +``` + +Line spacing is specified as multiple of line heights. Changing font size will +change the line spacing proportionately. + +### `ONE_POINT_FIVE` + +```python +ONE_POINT_FIVE = (1, 'UNMAPPED', 'Space-and-a-half line spacing.') +``` + +Space-and-a-half line spacing. + +### `SINGLE` + +```python +SINGLE = (0, 'UNMAPPED', 'Single spaced (default).') +``` + +Single spaced (default). + +## `WD_PARAGRAPH_ALIGNMENT` + +Bases: `BaseXmlEnum` + +Alias: **WD_ALIGN_PARAGRAPH** + +Specifies paragraph justification type. + +Example:: + + from docx.enum.text import WD_ALIGN_PARAGRAPH + + paragraph = document.add_paragraph() + paragraph.alignment = WD_ALIGN_PARAGRAPH.CENTER + +### `CENTER` + +```python +CENTER = (1, 'center', 'Center-aligned.') +``` + +Center-aligned. + +### `DISTRIBUTE` + +```python +DISTRIBUTE = (4, 'distribute', 'Paragraph characters are distributed to fill entire width of paragraph.') +``` + +Paragraph characters are distributed to fill entire width of paragraph. + +### `JUSTIFY` + +```python +JUSTIFY = (3, 'both', 'Fully justified.') +``` + +Fully justified. + +### `JUSTIFY_HI` + +```python +JUSTIFY_HI = (7, 'highKashida', 'Justified with a high character compression ratio.') +``` + +Justified with a high character compression ratio. + +### `JUSTIFY_LOW` + +```python +JUSTIFY_LOW = (8, 'lowKashida', 'Justified with a low character compression ratio.') +``` + +Justified with a low character compression ratio. + +### `JUSTIFY_MED` + +```python +JUSTIFY_MED = (5, 'mediumKashida', 'Justified with a medium character compression ratio.') +``` + +Justified with a medium character compression ratio. + +### `LEFT` + +```python +LEFT = (0, 'left', 'Left-aligned') +``` + +Left-aligned + +### `RIGHT` + +```python +RIGHT = (2, 'right', 'Right-aligned.') +``` + +Right-aligned. + +### `THAI_JUSTIFY` + +```python +THAI_JUSTIFY = (9, 'thaiDistribute', 'Justified according to Thai formatting layout.') +``` + +Justified according to Thai formatting layout. + +## `WD_TAB_ALIGNMENT` + +Bases: `BaseXmlEnum` + +Specifies the tab stop alignment to apply. + +MS API name: `WdTabAlignment` + +URL: https://msdn.microsoft.com/EN-US/library/office/ff195609.aspx + +### `BAR` + +```python +BAR = (4, 'bar', 'Bar-aligned.') +``` + +Bar-aligned. + +### `CENTER` + +```python +CENTER = (1, 'center', 'Center-aligned.') +``` + +Center-aligned. + +### `CLEAR` + +```python +CLEAR = (101, 'clear', 'Clear an inherited tab stop.') +``` + +Clear an inherited tab stop. + +### `DECIMAL` + +```python +DECIMAL = (3, 'decimal', 'Decimal-aligned.') +``` + +Decimal-aligned. + +### `END` + +```python +END = (102, 'end', 'Right-aligned. (deprecated)') +``` + +Right-aligned. (deprecated) + +### `LEFT` + +```python +LEFT = (0, 'left', 'Left-aligned.') +``` + +Left-aligned. + +### `LIST` + +```python +LIST = (6, 'list', 'List-aligned. (deprecated)') +``` + +List-aligned. (deprecated) + +### `NUM` + +```python +NUM = (103, 'num', 'Left-aligned. (deprecated)') +``` + +Left-aligned. (deprecated) + +### `RIGHT` + +```python +RIGHT = (2, 'right', 'Right-aligned.') +``` + +Right-aligned. + +### `START` + +```python +START = (104, 'start', 'Left-aligned. (deprecated)') +``` + +Left-aligned. (deprecated) + +## `WD_TAB_LEADER` + +Bases: `BaseXmlEnum` + +Specifies the character to use as the leader with formatted tabs. + +MS API name: `WdTabLeader` + +URL: https://msdn.microsoft.com/en-us/library/office/ff845050.aspx + +### `DASHES` + +```python +DASHES = (2, 'hyphen', 'Dashes.') +``` + +Dashes. + +### `DOTS` + +```python +DOTS = (1, 'dot', 'Dots.') +``` + +Dots. + +### `HEAVY` + +```python +HEAVY = (4, 'heavy', 'A heavy line.') +``` + +A heavy line. + +### `LINES` + +```python +LINES = (3, 'underscore', 'Double lines.') +``` + +Double lines. + +### `MIDDLE_DOT` + +```python +MIDDLE_DOT = (5, 'middleDot', 'A vertically-centered dot.') +``` + +A vertically-centered dot. + +### `SPACES` + +```python +SPACES = (0, 'none', 'Spaces. Default.') +``` + +Spaces. Default. + +## `WD_UNDERLINE` + +Bases: `BaseXmlEnum` + +Specifies the style of underline applied to a run of characters. + +MS API name: `WdUnderline` + +URL: http://msdn.microsoft.com/en-us/library/office/ff822388.aspx + +### `DASH` + +```python +DASH = (7, 'dash', 'Dashes.') +``` + +Dashes. + +### `DASH_HEAVY` + +```python +DASH_HEAVY = (23, 'dashedHeavy', 'Heavy dashes.') +``` + +Heavy dashes. + +### `DASH_LONG` + +```python +DASH_LONG = (39, 'dashLong', 'Long dashes.') +``` + +Long dashes. + +### `DASH_LONG_HEAVY` + +```python +DASH_LONG_HEAVY = (55, 'dashLongHeavy', 'Long heavy dashes.') +``` + +Long heavy dashes. + +### `DOTTED` + +```python +DOTTED = (4, 'dotted', 'Dots.') +``` + +Dots. + +### `DOTTED_HEAVY` + +```python +DOTTED_HEAVY = (20, 'dottedHeavy', 'Heavy dots.') +``` + +Heavy dots. + +### `DOT_DASH` + +```python +DOT_DASH = (9, 'dotDash', 'Alternating dots and dashes.') +``` + +Alternating dots and dashes. + +### `DOT_DASH_HEAVY` + +```python +DOT_DASH_HEAVY = (25, 'dashDotHeavy', 'Alternating heavy dots and heavy dashes.') +``` + +Alternating heavy dots and heavy dashes. + +### `DOT_DOT_DASH` + +```python +DOT_DOT_DASH = (10, 'dotDotDash', 'An alternating dot-dot-dash pattern.') +``` + +An alternating dot-dot-dash pattern. + +### `DOT_DOT_DASH_HEAVY` + +```python +DOT_DOT_DASH_HEAVY = (26, 'dashDotDotHeavy', 'An alternating heavy dot-dot-dash pattern.') +``` + +An alternating heavy dot-dot-dash pattern. + +### `DOUBLE` + +```python +DOUBLE = (3, 'double', 'A double line.') +``` + +A double line. + +### `INHERITED` + +```python +INHERITED = (-1, None, 'Inherit underline setting from containing paragraph.') +``` + +Inherit underline setting from containing paragraph. + +### `NONE` + +```python +NONE = (0, 'none', 'No underline.\n\nThis setting overrides any inherited underline value, so can be used to remove underline from a run that inherits underlining from its containing paragraph. Note this is not the same as assigning `None` to Run.underline. `None` is a valid assignment value, but causes the run to inherit its underline value. Assigning `WD_UNDERLINE.NONE` causes underlining to be unconditionally turned off.') +``` + +No underline. + +This setting overrides any inherited underline value, so can be used to remove +underline from a run that inherits underlining from its containing paragraph. Note +this is not the same as assigning `None` to Run.underline. `None` is a valid +assignment value, but causes the run to inherit its underline value. Assigning +``WD_UNDERLINE.NONE`` causes underlining to be unconditionally turned off. + +### `SINGLE` + +```python +SINGLE = (1, 'single', 'A single line.\n\nNote that this setting is write-only in the sense that `True` (rather than `WD_UNDERLINE.SINGLE`) is returned for a run having this setting.') +``` + +A single line. + +Note that this setting is write-only in the sense that `True` +(rather than ``WD_UNDERLINE.SINGLE``) is returned for a run having this setting. + +### `THICK` + +```python +THICK = (6, 'thick', 'A single thick line.') +``` + +A single thick line. + +### `WAVY` + +```python +WAVY = (11, 'wave', 'A single wavy line.') +``` + +A single wavy line. + +### `WAVY_DOUBLE` + +```python +WAVY_DOUBLE = (43, 'wavyDouble', 'A double wavy line.') +``` + +A double wavy line. + +### `WAVY_HEAVY` + +```python +WAVY_HEAVY = (27, 'wavyHeavy', 'A heavy wavy line.') +``` + +A heavy wavy line. + +### `WORDS` + +```python +WORDS = (2, 'words', 'Underline individual words only.') +``` + +Underline individual words only. + + + + + +# `docx.errors` + +Typed refusals for paper-docx safe-editing APIs. + +## `AmbiguousTargetError` + +Bases: `PaperRefusal` + +The target specification matches more than one location. + +Supply a more specific exact target: for example a live span or block, a +narrower story, or an explicit `nth` when supported. To inspect contextual +ranking without hiding candidates, use `find_text(..., near=...)`. + +## `BoundaryViolationError` + +Bases: `PaperRefusal` + +The operation would cross a structural boundary it must respect. + +Examples: a character-level replacement spanning a paragraph boundary or +entering/leaving a content control; a block operation selecting +paragraphs that do not share one parent. + +## `DocumentProtectedError` + +Bases: `PaperRefusal` + +The document enforces an editing restriction this operation ignores. + +Word honors `w:documentProtection` (read-only, forms-only, comments-only, +tracked-changes-enforced); silently editing a locked template reports +false state. Protection is ADVISORY, not security — after reviewing why +the document is locked, call +`docx.protection.acknowledge_protection(document)` to proceed. paper-docx +never strips the protection setting itself. + +## `MalformedPackageError` + +Bases: `PaperRefusal` + +The file is not a package this library can safely read. + +Raised for a damaged or inconsistent ZIP envelope, an encrypted or +unsupported member, a member name that cannot denote one part, and a +`[Content_Types].xml` or relationship graph that does not describe a +readable package. Validation runs before any XML is parsed or any output is +replaced, so this is a safe refusal: nothing was read into the object model +and nothing on disk was touched. + +It does not mean the file is too large. Size and member-count ceilings were +removed once Word was measured opening documents past all of them. + +## `PaperRefusal` + +Bases: `Exception` + +Base for every safe refusal raised by paper-docx APIs. + +A refused operation mutated nothing, in memory or on disk. The message +states what was found and why it was unsafe to proceed. + +## `RelationshipPolicyError` + +Bases: `PaperRefusal` + +The operation would create or modify a package relationship unsafely. + +## `TargetNotFoundError` + +Bases: `PaperRefusal` + +No location matches the target specification. + +Also raised when a previously-valid anchor or span has gone stale — the +underlying content changed since it was captured. + +## `UnsupportedStructureError` + +Bases: `PaperRefusal` + +The target involves structure this operation does not safely support. + +Examples: text inside a tracked deletion or field instruction; a table +with merged or nested cells; numbering that would require authoring new +definitions. + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + + + + + +# `docx.exceptions` + +Exceptions used with python-docx. + +## `InvalidSpanError` + +Bases: `PythonDocxError` + +Raised when an invalid merge region is specified in a request to merge table +cells. + +## `InvalidXmlError` + +Bases: `PythonDocxError` + +Raised when invalid XML is encountered, such as on attempt to access a missing +required child element. + +## `PythonDocxError` + +Bases: `Exception` + +Generic error class. + + + + + +# `docx.fields` + +Field authoring — formulas, never values. + +## `add_caption` + +```python +add_caption(paragraph: 'Paragraph', *, label: str = 'Figure', description: str = '') -> None +``` + +Append a SEQ caption (`Figure 1`, `Table 1`) to `paragraph`. + +Writes the field rather than the displayed integer, so Word recomputes the number on +open. Sets the paragraph style to "Caption" without checking that the style exists. +Refuses a protected document and an unknown label. + +## `add_date_field` + +```python +add_date_field(paragraph: 'Paragraph', *, date_format: Optional[str] = None) -> None +``` + +Append a DATE field; `date_format` is Word's \@ picture, for example 'MMMM d, yyyy'. + +The result stays a placeholder until a renderer opens the file; this package never +computes a date into the result. Refuses a protected document. + +## `add_page_count_field` + +```python +add_page_count_field(paragraph: 'Paragraph') -> None +``` + +Append a NUMPAGES field, typically to a footer paragraph. + +Writes the field, not a number, so Word computes the count on open. Refuses a protected +document. + +## `add_page_number_field` + +```python +add_page_number_field(paragraph: 'Paragraph') -> None +``` + +Append a PAGE field, typically to a footer paragraph. + +Writes the field, not a number, so Word computes the page on open. Refuses a protected +document. + +## `add_reference_field` + +```python +add_reference_field(paragraph: 'Paragraph', *, bookmark: str, kind: str = 'text') -> None +``` + +Append a cross-reference to `bookmark`: its text (`kind="text"`), page (`"page"`), or +paragraph number (`"number"`). + +Writes a REF field, so Word recomputes it on open. Refuses a protected document and an +unknown bookmark name. + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `insert_toc_after` + +```python +insert_toc_after(document: 'Document', anchor: 'Document', *, levels: Tuple[int, int] = (1, 3)) -> None +``` + +Insert a TOC field in a new paragraph after `anchor`. + +Marked dirty so the renderer builds the real table on open; heading `levels` maps to the +\o "1-3" switch. Refuses a protected document, and an anchor that is missing, ambiguous +foreign, or spans more than one paragraph. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.formatting` + +Effective-format resolver — read-only, provenance-bearing. + +## `EffectiveFormat` + +```python +EffectiveFormat(properties: Dict[str, ResolvedValue], unresolved: Tuple[str, ...]) -> None +``` + +The resolved property map, plus what is declared unresolvable. + +### `properties` + +```python +properties: Dict[str, ResolvedValue] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +### `unresolved` + +```python +unresolved: Tuple[str, ...] +``` + +### `value_of` + +```python +value_of(key: str) +``` + +## `ResolvedValue` + +```python +ResolvedValue(value: object, source: str, chain: Tuple[str, ...] = ()) -> None +``` + +One property's effective value and where it came from. + +`source` is "direct", "character_style:", "paragraph_style:", "doc_defaults", +"toggle_xor", "agreeing_layers", "mixed", or "none". `chain` holds the contributing +layers. + +### `chain` + +```python +chain: Tuple[str, ...] = () +``` + +### `source` + +```python +source: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +### `value` + +```python +value: object +``` + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `format_of` + +```python +format_of(target) -> EffectiveFormat +``` + +The effective formatting of a `Run`, `Paragraph` or `Span`. + +Read-only and provenance-bearing: each `ResolvedValue` says where its value came from. +Runs resolve the supported run-property subset; paragraphs resolve alignment and style +plus the run defaults their style chain implies; spans resolve every run they touch and +report "mixed" where runs disagree. Raises `TypeError` for anything else. + + + + + +# `docx.image.bmp` + +## `Bmp` + +Bases: `BaseImageHeader` + +Image header parser for BMP images. + +### `content_type` + +```python +content_type +``` + +MIME content type for this image, unconditionally `image/bmp` for BMP +images. + +### `default_ext` + +```python +default_ext +``` + +Default filename extension, always 'bmp' for BMP images. + +### `from_stream` + +```python +from_stream(stream) +``` + +Return `Bmp` instance having header properties parsed from the BMP image in +`stream`. + + + + + +# `docx.image.constants` + +Constants specific the the image sub-package. + +## `JPEG_MARKER_CODE` + +JPEG marker codes. + +### `APP0` + +```python +APP0 = b'\xe0' +``` + +### `APP1` + +```python +APP1 = b'\xe1' +``` + +### `APP2` + +```python +APP2 = b'\xe2' +``` + +### `APP3` + +```python +APP3 = b'\xe3' +``` + +### `APP4` + +```python +APP4 = b'\xe4' +``` + +### `APP5` + +```python +APP5 = b'\xe5' +``` + +### `APP6` + +```python +APP6 = b'\xe6' +``` + +### `APP7` + +```python +APP7 = b'\xe7' +``` + +### `APP8` + +```python +APP8 = b'\xe8' +``` + +### `APP9` + +```python +APP9 = b'\xe9' +``` + +### `APPA` + +```python +APPA = b'\xea' +``` + +### `APPB` + +```python +APPB = b'\xeb' +``` + +### `APPC` + +```python +APPC = b'\xec' +``` + +### `APPD` + +```python +APPD = b'\xed' +``` + +### `APPE` + +```python +APPE = b'\xee' +``` + +### `APPF` + +```python +APPF = b'\xef' +``` + +### `DAC` + +```python +DAC = b'\xcc' +``` + +### `DHP` + +```python +DHP = b'\xde' +``` + +### `DHT` + +```python +DHT = b'\xc4' +``` + +### `DNL` + +```python +DNL = b'\xdc' +``` + +### `DQT` + +```python +DQT = b'\xdb' +``` + +### `DRI` + +```python +DRI = b'\xdd' +``` + +### `EOI` + +```python +EOI = b'\xd9' +``` + +### `EXP` + +```python +EXP = b'\xdf' +``` + +### `JPG` + +```python +JPG = b'\xc8' +``` + +### `RST0` + +```python +RST0 = b'\xd0' +``` + +### `RST1` + +```python +RST1 = b'\xd1' +``` + +### `RST2` + +```python +RST2 = b'\xd2' +``` + +### `RST3` + +```python +RST3 = b'\xd3' +``` + +### `RST4` + +```python +RST4 = b'\xd4' +``` + +### `RST5` + +```python +RST5 = b'\xd5' +``` + +### `RST6` + +```python +RST6 = b'\xd6' +``` + +### `RST7` + +```python +RST7 = b'\xd7' +``` + +### `SOF0` + +```python +SOF0 = b'\xc0' +``` + +### `SOF1` + +```python +SOF1 = b'\xc1' +``` + +### `SOF2` + +```python +SOF2 = b'\xc2' +``` + +### `SOF3` + +```python +SOF3 = b'\xc3' +``` + +### `SOF5` + +```python +SOF5 = b'\xc5' +``` + +### `SOF6` + +```python +SOF6 = b'\xc6' +``` + +### `SOF7` + +```python +SOF7 = b'\xc7' +``` + +### `SOF9` + +```python +SOF9 = b'\xc9' +``` + +### `SOFA` + +```python +SOFA = b'\xca' +``` + +### `SOFB` + +```python +SOFB = b'\xcb' +``` + +### `SOFD` + +```python +SOFD = b'\xcd' +``` + +### `SOFE` + +```python +SOFE = b'\xce' +``` + +### `SOFF` + +```python +SOFF = b'\xcf' +``` + +### `SOF_MARKER_CODES` + +```python +SOF_MARKER_CODES = (SOF0, SOF1, SOF2, SOF3, SOF5, SOF6, SOF7, SOF9, SOFA, SOFB, SOFD, SOFE, SOFF) +``` + +### `SOI` + +```python +SOI = b'\xd8' +``` + +### `SOS` + +```python +SOS = b'\xda' +``` + +### `STANDALONE_MARKERS` + +```python +STANDALONE_MARKERS = (TEM, SOI, EOI, RST0, RST1, RST2, RST3, RST4, RST5, RST6, RST7) +``` + +### `TEM` + +```python +TEM = b'\x01' +``` + +### `is_standalone` + +```python +is_standalone(marker_code) +``` + +### `marker_names` + +```python +marker_names = {b'\x00': 'UNKNOWN', b'\xc0': 'SOF0', b'\xc2': 'SOF2', b'\xc4': 'DHT', b'\xda': 'SOS', b'\xd8': 'SOI', b'\xd9': 'EOI', b'\xdb': 'DQT', b'\xe0': 'APP0', b'\xe1': 'APP1', b'\xe2': 'APP2', b'\xed': 'APP13', b'\xee': 'APP14'} +``` + +## `MIME_TYPE` + +Image content types. + +### `BMP` + +```python +BMP = 'image/bmp' +``` + +### `GIF` + +```python +GIF = 'image/gif' +``` + +### `JPEG` + +```python +JPEG = 'image/jpeg' +``` + +### `PNG` + +```python +PNG = 'image/png' +``` + +### `TIFF` + +```python +TIFF = 'image/tiff' +``` + +## `PNG_CHUNK_TYPE` + +PNG chunk type names. + +### `IEND` + +```python +IEND = 'IEND' +``` + +### `IHDR` + +```python +IHDR = 'IHDR' +``` + +### `pHYs` + +```python +pHYs = 'pHYs' +``` + +## `TIFF_FLD` + +```python +TIFF_FLD = TIFF_FLD_TYPE +``` + +## `TIFF_FLD_TYPE` + +Tag codes for TIFF Image File Directory (IFD) entries. + +### `ASCII` + +```python +ASCII = 2 +``` + +### `BYTE` + +```python +BYTE = 1 +``` + +### `LONG` + +```python +LONG = 4 +``` + +### `RATIONAL` + +```python +RATIONAL = 5 +``` + +### `SHORT` + +```python +SHORT = 3 +``` + +### `field_type_names` + +```python +field_type_names = {1: 'BYTE', 2: 'ASCII char', 3: 'SHORT', 4: 'LONG', 5: 'RATIONAL'} +``` + +## `TIFF_TAG` + +Tag codes for TIFF Image File Directory (IFD) entries. + +### `IMAGE_LENGTH` + +```python +IMAGE_LENGTH = 257 +``` + +### `IMAGE_WIDTH` + +```python +IMAGE_WIDTH = 256 +``` + +### `RESOLUTION_UNIT` + +```python +RESOLUTION_UNIT = 296 +``` + +### `X_RESOLUTION` + +```python +X_RESOLUTION = 282 +``` + +### `Y_RESOLUTION` + +```python +Y_RESOLUTION = 283 +``` + +### `tag_names` + +```python +tag_names = {254: 'NewSubfileType', 256: 'ImageWidth', 257: 'ImageLength', 258: 'BitsPerSample', 259: 'Compression', 262: 'PhotometricInterpretation', 270: 'ImageDescription', 271: 'Make', 272: 'Model', 273: 'StripOffsets', 274: 'Orientation', 277: 'SamplesPerPixel', 279: 'StripByteCounts', 282: 'XResolution', 283: 'YResolution', 284: 'PlanarConfiguration', 296: 'ResolutionUnit', 305: 'Software', 306: 'DateTime', 531: 'YCbCrPositioning', 34665: 'ExifTag', 34853: 'GPS IFD', 50341: 'PrintImageMatching'} +``` + + + + + +# `docx.image.exceptions` + +Exceptions specific the the image sub-package. + +## `InvalidImageStreamError` + +Bases: `Exception` + +The recognized image stream appears to be corrupted. + +## `UnexpectedEndOfFileError` + +Bases: `Exception` + +EOF was unexpectedly encountered while reading an image stream. + +## `UnrecognizedImageError` + +Bases: `Exception` + +The provided image stream could not be recognized. + + + + + +# `docx.image.gif` + +## `Gif` + +Bases: `BaseImageHeader` + +Image header parser for GIF images. + +Note that the GIF format does not support resolution (DPI) information. Both +horizontal and vertical DPI default to 72. + +### `content_type` + +```python +content_type +``` + +MIME content type for this image, unconditionally `image/gif` for GIF +images. + +### `default_ext` + +```python +default_ext +``` + +Default filename extension, always 'gif' for GIF images. + +### `from_stream` + +```python +from_stream(stream) +``` + +Return `Gif` instance having header properties parsed from GIF image in +`stream`. + + + + + +# `docx.image.helpers` + +## `BIG_ENDIAN` + +```python +BIG_ENDIAN = '>' +``` + +## `LITTLE_ENDIAN` + +```python +LITTLE_ENDIAN = '<' +``` + +## `StreamReader` + +```python +StreamReader(stream, byte_order, base_offset = 0) +``` + +Wraps a file-like object to provide access to structured data from a binary file. + +Byte-order is configurable. `base_offset` is added to any base value provided to +calculate actual location for reads. + +### `read` + +```python +read(count) +``` + +Allow pass-through read() call. + +### `read_byte` + +```python +read_byte(base, offset = 0) +``` + +Return the int value of the byte at the file position defined by +self._base_offset + `base` + `offset`. + +If `base` is None, the byte is read from the current position in the stream. + +### `read_long` + +```python +read_long(base, offset = 0) +``` + +Return the int value of the four bytes at the file position defined by +self._base_offset + `base` + `offset`. + +If `base` is None, the long is read from the current position in the stream. The +endian setting of this instance is used to interpret the byte layout of the +long. + +### `read_short` + +```python +read_short(base, offset = 0) +``` + +Return the int value of the two bytes at the file position determined by +`base` and `offset`, similarly to ``read_long()`` above. + +### `read_str` + +```python +read_str(char_count, base, offset = 0) +``` + +Return a string containing the `char_count` bytes at the file position +determined by self._base_offset + `base` + `offset`. + +### `seek` + +```python +seek(base, offset = 0) +``` + +### `tell` + +```python +tell() +``` + +Allow pass-through tell() call. + + + + + +# `docx.image.image` + +Provides objects that can characterize image streams. + +## `BaseImageHeader` + +```python +BaseImageHeader(px_width: int, px_height: int, horz_dpi: int, vert_dpi: int) +``` + +Base class for image header subclasses like `Jpeg` and `Tiff`. + +### `content_type` + +```python +content_type: str +``` + +Abstract property definition, must be implemented by all subclasses. + +### `default_ext` + +```python +default_ext: str +``` + +Default filename extension for images of this type. + +An abstract property definition, must be implemented by all subclasses. + +### `horz_dpi` + +```python +horz_dpi +``` + +Integer dots per inch for the width of this image. + +Defaults to 72 when not present in the file, as is often the case. + +### `px_height` + +```python +px_height +``` + +The vertical pixel dimension of the image. + +### `px_width` + +```python +px_width +``` + +The horizontal pixel dimension of the image. + +### `vert_dpi` + +```python +vert_dpi +``` + +Integer dots per inch for the height of this image. + +Defaults to 72 when not present in the file, as is often the case. + +## `Image` + +```python +Image(blob: bytes, filename: str, image_header: BaseImageHeader) +``` + +Graphical image stream such as JPEG, PNG, or GIF with properties and methods +required by ImagePart. + +### `blob` + +```python +blob +``` + +The bytes of the image 'file'. + +### `content_type` + +```python +content_type: str +``` + +MIME content type for this image, e.g. ``'image/jpeg'`` for a JPEG image. + +### `ext` + +```python +ext() +``` + +The file extension for the image. + +If an actual one is available from a load filename it is used. Otherwise a +canonical extension is assigned based on the content type. Does not contain the +leading period, e.g. 'jpg', not '.jpg'. + +### `filename` + +```python +filename +``` + +Original image file name, if loaded from disk, or a generic filename if +loaded from an anonymous stream. + +### `from_blob` + +```python +from_blob(blob: bytes) -> Image +``` + +Return a new `Image` subclass instance parsed from the image binary contained +in `blob`. + +### `from_file` + +```python +from_file(image_descriptor: str | IO[bytes]) +``` + +Return a new `Image` subclass instance loaded from the image file identified +by `image_descriptor`, a path or file-like object. + +### `height` + +```python +height: Inches +``` + +A `Length` value representing the native height of the image, calculated from +the values of `px_height` and `vert_dpi`. + +### `horz_dpi` + +```python +horz_dpi: int +``` + +Integer dots per inch for the width of this image. + +Defaults to 72 when not present in the file, as is often the case. + +### `px_height` + +```python +px_height: int +``` + +The vertical pixel dimension of the image. + +### `px_width` + +```python +px_width: int +``` + +The horizontal pixel dimension of the image. + +### `scaled_dimensions` + +```python +scaled_dimensions(width: int | Length | None = None, height: int | Length | None = None) -> Tuple[Length, Length] +``` + +(cx, cy) pair representing scaled dimensions of this image. + +The native dimensions of the image are scaled by applying the following rules to +the `width` and `height` arguments. + +* If both `width` and `height` are specified, the return value is (`width`, +`height`); no scaling is performed. +* If only one is specified, it is used to compute a scaling factor that is then +applied to the unspecified dimension, preserving the aspect ratio of the image. +* If both `width` and `height` are `None`, the native dimensions are returned. + +The native dimensions are calculated using the dots-per-inch (dpi) value +embedded in the image, defaulting to 72 dpi if no value is specified, as is +often the case. The returned values are both `Length` objects. + +### `sha1` + +```python +sha1() +``` + +SHA1 hash digest of the image blob. + +### `vert_dpi` + +```python +vert_dpi: int +``` + +Integer dots per inch for the height of this image. + +Defaults to 72 when not present in the file, as is often the case. + +### `width` + +```python +width: Inches +``` + +A `Length` value representing the native width of the image, calculated from +the values of `px_width` and `horz_dpi`. + + + + + +# `docx.image.jpeg` + +Objects related to parsing headers of JPEG image streams. + +## `Exif` + +Bases: `Jpeg` + +Image header parser for Exif image format. + +### `from_stream` + +```python +from_stream(stream) +``` + +Return `Exif` instance having header properties parsed from Exif image in +`stream`. + +## `Jfif` + +Bases: `Jpeg` + +Image header parser for JFIF image format. + +### `from_stream` + +```python +from_stream(stream) +``` + +Return a `Jfif` instance having header properties parsed from image in +`stream`. + +## `Jpeg` + +Bases: `BaseImageHeader` + +Base class for JFIF and EXIF subclasses. + +### `content_type` + +```python +content_type +``` + +MIME content type for this image, unconditionally `image/jpeg` for JPEG +images. + +### `default_ext` + +```python +default_ext +``` + +Default filename extension, always 'jpg' for JPG images. + + + + + +# `docx.image` + +Provides objects that can characterize image streams. + +## `SIGNATURES` + +```python +SIGNATURES = ((Png, 0, b'\x89PNG\r\n\x1a\n'), (Jfif, 6, b'JFIF'), (Exif, 6, b'Exif'), (Gif, 0, b'GIF87a'), (Gif, 0, b'GIF89a'), (Tiff, 0, b'MM\x00*'), (Tiff, 0, b'II*\x00'), (Bmp, 0, b'BM')) +``` + + + + + +# `docx.image.png` + +## `Png` + +Bases: `BaseImageHeader` + +Image header parser for PNG images. + +### `content_type` + +```python +content_type +``` + +MIME content type for this image, unconditionally `image/png` for PNG +images. + +### `default_ext` + +```python +default_ext +``` + +Default filename extension, always 'png' for PNG images. + +### `from_stream` + +```python +from_stream(stream) +``` + +Return a `Png` instance having header properties parsed from image in +`stream`. + + + + + +# `docx.image.tiff` + +## `Tiff` + +Bases: `BaseImageHeader` + +Image header parser for TIFF images. + +Handles both big and little endian byte ordering. + +### `content_type` + +```python +content_type +``` + +Return the MIME type of this TIFF image, unconditionally the string +``image/tiff``. + +### `default_ext` + +```python +default_ext +``` + +Default filename extension, always 'tiff' for TIFF images. + +### `from_stream` + +```python +from_stream(stream) +``` + +Return a `Tiff` instance containing the properties of the TIFF image in +`stream`. diff --git a/addons/sandbox/skills/docx/references/api-002.md b/addons/sandbox/skills/docx/references/api-002.md new file mode 100644 index 000000000..2930d2851 --- /dev/null +++ b/addons/sandbox/skills/docx/references/api-002.md @@ -0,0 +1,5220 @@ + + + + +# paper-docx API reference + +The complete public API of `docx` 0.2.0, generated from docstrings. The distribution is `paper-docx`, a fork of python-docx; the import name is `docx`. Both what the fork adds and the API it inherits from python-docx are documented here. + +This index names every symbol documented here. Open the one page you need rather than reading them all. + +## Modules + +| Page | Surface | +| --- | --- | +| [`docx.api`](api-001.md#source-d3c6d8a2063ea1b9) | 1 member | +| [`docx.blkcntnr`](api-001.md#source-159c84700f3fb7a9) | 2 members | +| [`docx.blocks`](api-001.md#source-559940c98b8ab48e) | 13 members | +| [`docx.bookmarks`](api-001.md#source-0eb8e7fe049a1194) | 11 members | +| [`docx.commentops`](api-001.md#source-8f1e4f580e83a5d0) | 20 members | +| [`docx.comments`](api-001.md#source-e4a8576a6dcbd98f) | 4 members | +| [`docx.composition`](api-001.md#source-12b50f562db8cd2f) | 6 members | +| [`docx.controls`](api-001.md#source-b8f6b3944ebc8cbd) | 8 members | +| [`docx.dml.color`](api-001.md#source-955ea838037f755e) | 2 members | +| [`docx.document`](api-001.md#source-1f833f98d375a316) | 2 members | +| [`docx.drawing`](api-001.md#source-39ef763a9ce964c8) | 2 members | +| [`docx.enum.base`](api-001.md#source-5dd3a18ad2f06af4) | 3 members | +| [`docx.enum.dml`](api-001.md#source-d95470ef1e394d1b) | 3 members | +| [`docx.enum.section`](api-001.md#source-29cb1aa11d41c51e) | 6 members | +| [`docx.enum.shape`](api-001.md#source-b37d8620ff2f23a1) | 2 members | +| [`docx.enum.style`](api-001.md#source-9434a7db09bd1c01) | 3 members | +| [`docx.enum.table`](api-001.md#source-1f675541a0e52e24) | 6 members | +| [`docx.enum.text`](api-001.md#source-f05e757fcce33a9d) | 10 members | +| [`docx.errors`](api-001.md#source-15259882f4deb2a3) | 9 members | +| [`docx.exceptions`](api-001.md#source-5ba7c82a99f28757) | 3 members | +| [`docx.fields`](api-001.md#source-a3b4eaa58fcf5889) | 8 members | +| [`docx.formatting`](api-001.md#source-1dec973f3b97903a) | 4 members | +| [`docx.image`](api-001.md#source-b8c62bb744e27a81) | 1 member | +| [`docx.image.bmp`](api-001.md#source-cdfcdfa3143e1415) | 1 member | +| [`docx.image.constants`](api-001.md#source-cd6ae809876304fa) | 6 members | +| [`docx.image.exceptions`](api-001.md#source-93e3b74e30e5b70d) | 3 members | +| [`docx.image.gif`](api-001.md#source-0c70ceec21fb4450) | 1 member | +| [`docx.image.helpers`](api-001.md#source-07b25500f249c3ce) | 3 members | +| [`docx.image.image`](api-001.md#source-083f592a0c8631cc) | 2 members | +| [`docx.image.jpeg`](api-001.md#source-7671e88f38d60e00) | 3 members | +| [`docx.image.png`](api-001.md#source-1ff94a8d5409223f) | 1 member | +| [`docx.image.tiff`](api-001.md#source-9f7686d8c790e5e0) | 1 member | +| [`docx.links`](api-002.md#source-c169840ba53458fd) | 4 members | +| [`docx.notes`](api-002.md#source-6b756e6a87f50fae) | 5 members | +| [`docx.numbering`](api-002.md#source-61a628fe2ee2866a) | 11 members | +| [`docx.opc.constants`](api-002.md#source-9a5b2f4589772f7a) | 4 members | +| [`docx.opc.coreprops`](api-002.md#source-ff23b2e7f45659e6) | 1 member | +| [`docx.opc.exceptions`](api-002.md#source-4eb353a0957fc371) | 2 members | +| [`docx.opc.oxml`](api-002.md#source-4080bba1ebfeb0c5) | 15 members | +| [`docx.opc.package`](api-002.md#source-d23a8c64e00a62f7) | 2 members | +| [`docx.opc.packuri`](api-002.md#source-3991256132d60e2f) | 3 members | +| [`docx.opc.part`](api-002.md#source-af3c023a316b85ae) | 3 members | +| [`docx.opc.parts.coreprops`](api-002.md#source-90b8541a1f60e01f) | 1 member | +| [`docx.opc.phys_pkg`](api-002.md#source-929fd048fcc3ba2b) | 4 members | +| [`docx.opc.pkgreader`](api-002.md#source-6f13d33426ef53f2) | 4 members | +| [`docx.opc.pkgwriter`](api-002.md#source-9ab18049af59e808) | 1 member | +| [`docx.opc.rel`](api-002.md#source-b06938114c472f39) | 1 member | +| [`docx.opc.shared`](api-002.md#source-174a9136bc6f2b62) | 2 members | +| [`docx.opc.spec`](api-002.md#source-9ed61d16d8e8ea38) | 1 member | +| [`docx.oxml.comments`](api-002.md#source-9e40b590666fa759) | 2 members | +| [`docx.oxml.coreprops`](api-002.md#source-f2ee1e7f4466f0aa) | 1 member | +| [`docx.oxml.document`](api-002.md#source-90fe632de8cbe585) | 2 members | +| [`docx.oxml.drawing`](api-002.md#source-585ff05c61f1b05c) | 1 member | +| [`docx.oxml.exceptions`](api-002.md#source-a13795e46d38261b) | 2 members | +| [`docx.oxml.ns`](api-002.md#source-3776be9049db09e6) | 6 members | +| [`docx.oxml.numbering`](api-002.md#source-eb336efe1afe672d) | 4 members | +| [`docx.oxml.parser`](api-002.md#source-4e15de4882fc29ef) | 5 members | +| [`docx.oxml.revision`](api-002.md#source-868781954bd7f97a) | 1 member | +| [`docx.oxml.section`](api-002.md#source-5cae517757ff9cab) | 7 members | +| [`docx.oxml.settings`](api-002.md#source-45b5f1beb29c3ab7) | 1 member | +| [`docx.oxml.shape`](api-003.md#source-3c34f39af8be119f) | 17 members | +| [`docx.oxml.shared`](api-003.md#source-05c954f91ee8b9d5) | 3 members | +| [`docx.oxml.simpletypes`](api-003.md#source-6b3f05b8ff6f1d9d) | 35 members | +| [`docx.oxml.styles`](api-003.md#source-fa6a21a66e584ad1) | 5 members | +| [`docx.oxml.table`](api-003.md#source-3570d1cbd726407b) | 14 members | +| [`docx.oxml.text.font`](api-003.md#source-4d4f960722b22afa) | 7 members | +| [`docx.oxml.text.hyperlink`](api-003.md#source-7ada26ea94abbe06) | 1 member | +| [`docx.oxml.text.pagebreak`](api-003.md#source-f3aef6b9eb6b1517) | 1 member | +| [`docx.oxml.text.paragraph`](api-003.md#source-1e76def15bbd8450) | 1 member | +| [`docx.oxml.text.parfmt`](api-003.md#source-ac18acaea7c8b971) | 6 members | +| [`docx.oxml.text.run`](api-003.md#source-5569e2e09c4bff18) | 6 members | +| [`docx.oxml.xmlchemy`](api-003.md#source-15800524d904f954) | 13 members | +| [`docx.package`](api-003.md#source-85bd5a055971b2f8) | 17 members | +| [`docx.parts.comments`](api-003.md#source-d07f59ec6b6091ab) | 1 member | +| [`docx.parts.document`](api-003.md#source-feecabc5676a282a) | 1 member | +| [`docx.parts.endnotes`](api-003.md#source-9fd9de78cb108dd6) | 1 member | +| [`docx.parts.footnotes`](api-003.md#source-449e9230d2b2ea6f) | 1 member | +| [`docx.parts.hdrftr`](api-003.md#source-52daf888ea897871) | 2 members | +| [`docx.parts.image`](api-003.md#source-a83c3679f718c78a) | 1 member | +| [`docx.parts.numbering`](api-003.md#source-dd7e507740c186b6) | 1 member | +| [`docx.parts.settings`](api-003.md#source-56e5dd859ff03e89) | 1 member | +| [`docx.parts.story`](api-003.md#source-926a44a16e867f59) | 1 member | +| [`docx.parts.styles`](api-003.md#source-bae14dee2b7024de) | 1 member | +| [`docx.protection`](api-003.md#source-dc198d86f07b14e6) | 10 members | +| [`docx.revision`](api-003.md#source-3d87bbe7684c1331) | 5 members | +| [`docx.search`](api-003.md#source-678e9875a3fa1ca8) | 9 members | +| [`docx.section`](api-003.md#source-eee4067844e2f8df) | 2 members | +| [`docx.settings`](api-003.md#source-532a135b0b75ed2c) | 1 member | +| [`docx.shape`](api-003.md#source-1de2aab13071562e) | 2 members | +| [`docx.shared`](api-003.md#source-09c5113e562f432e) | 15 members | +| [`docx.story`](api-003.md#source-6248ea8bd2e0c910) | 12 members | +| [`docx.styles`](api-003.md#source-9047785bdc7a3919) | 1 member | +| [`docx.styles.latent`](api-003.md#source-d3ea04d7bb4f510e) | 1 member | +| [`docx.styles.style`](api-003.md#source-382c966f01959966) | 4 members | +| [`docx.styles.styles`](api-003.md#source-28eb6ea5b5023bcb) | 1 member | +| [`docx.table`](api-003.md#source-ce74a9bf2d749312) | 2 members | +| [`docx.tableops`](api-004.md#source-32cd0a2c56006650) | 5 members | +| [`docx.text.font`](api-004.md#source-c00c94b81e29f2ef) | 1 member | +| [`docx.text.hyperlink`](api-004.md#source-4214660cb391bec9) | 2 members | +| [`docx.text.pagebreak`](api-004.md#source-44dfc592f980e410) | 1 member | +| [`docx.text.paragraph`](api-004.md#source-2c1d902c346c5cdd) | 1 member | +| [`docx.text.parfmt`](api-004.md#source-79ff58c0fb93748a) | 1 member | +| [`docx.text.run`](api-004.md#source-1b9a14c58e608abf) | 2 members | +| [`docx.text.tabstops`](api-004.md#source-eeaa259c323fdf65) | 2 members | +| [`docx.types`](api-004.md#source-b2a7210fa4b39232) | 2 members | + +## `docx.api` + +Directly exposed API functions and classes, `Document` for now. + +Full contract: [api.md](api-001.md#source-d3c6d8a2063ea1b9) + +- `Document(docx=None) -> DocumentObject` — Return a `Document` object loaded from `docx`, where `docx` can be either a path + +## `docx.blkcntnr` + +Block item container, used by body, cell, header, etc. + +Full contract: [blkcntnr.md](api-001.md#source-159c84700f3fb7a9) + +- `BlockItemContainer` — Base class for proxy objects that can contain block items. +- `BlockItemElement = 'CT_Body | CT_Comment | CT_HdrFtr | CT_Tc'` + +## `docx.blocks` + +Anchor-relative block operations and clause-level redlines (paper-docx). + +Full contract: [blocks.md](api-001.md#source-559940c98b8ab48e) + +- `BlockEditResult` — Outcome of a block-level edit. +- `BlockTarget = Union[str, Block, Span]` +- `ListBlock` — A real bullet/decimal list (backed by a real numbering definition). +- `RichParagraph` — A paragraph built from styled runs. +- `TableBlock` — A simple rectangular table of plain-text cells. +- `TextRun` — One run of a rich paragraph. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `insert_blocks_after(document, anchor, *, blocks, tracked=False, author=None, date=None) -> BlockEditResult` — Insert a typed block list after `anchor`, and return a `BlockEditResult`. +- `insert_section_after(document, anchor, *, heading, paragraphs, heading_style='Heading2', body_style=None, tracked=False, author=None, date=None) -> BlockEditResult` — Insert a heading plus body paragraphs after `anchor`, and return a `BlockEditResult`. +- `require_anchor_owner(document, anchor, *, argument='anchor') -> None` — Check ownership for live anchor forms; value/string anchors are inert. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. +- `tracked_delete_paragraphs(document, start_anchor, *, end_anchor=None, count=1, author, date=None) -> BlockEditResult` — Mark a paragraph range deleted with real tracked changes; returns a `BlockEditResult`. +- `tracked_replace_paragraphs(document, start_anchor, replacement_paragraphs, *, end_anchor=None, count=1, body_style=None, author, date=None) -> BlockEditResult` — Tracked-delete a paragraph range and tracked-insert replacements after it. + +## `docx.bookmarks` + +Bookmark enumeration, creation, and deletion. + +Full contract: [bookmarks.md](api-001.md#source-0eb8e7fe049a1194) + +- `BookmarkInfo` — One bookmark: its name, id, story, and the visible text it wraps. +- `DEL_TEXT = qn('w:delText')` +- `INSTR_TEXT = qn('w:instrText')` +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `create_bookmark(document, span, name) -> BookmarkInfo` — Bookmark exactly `span`'s text under `name`, and return its `BookmarkInfo`. +- `delete_bookmark(document, name) -> None` — Remove `name`'s markers, leaving the text in place. +- `is_direct_run_child(element) -> bool` — Whether ``element`` is a direct child of a ``w:r`` element. +- `list_bookmarks(document) -> 'List[BookmarkInfo]'` — Every bookmark across every story, in document order. +- `project_run_child(element) -> RunChildProjection` — Return the conservative text projection for a direct ``w:r`` child. +- `require_span_owner(document, span, *, argument='span') -> None` — Refuse a live span captured from a different document package. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.commentops` + +Comment thread operations: anchored text, replies, resolution. + +Full contract: [commentops.md](api-001.md#source-8f1e4f580e83a5d0) + +- `COMMENTS_EXTENDED_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml'` +- `COMMENTS_EXTENDED_RELATIONSHIP_TYPE = 'http://schemas.microsoft.com/office/2011/relationships/commentsExtended'` +- `COMMENTS_EXTENSIBLE_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml'` +- `COMMENTS_EXTENSIBLE_RELATIONSHIP_TYPE = 'http://schemas.microsoft.com/office/2018/08/relationships/commentsExtensible'` +- `COMMENTS_IDS_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml'` +- `COMMENTS_IDS_RELATIONSHIP_TYPE = 'http://schemas.microsoft.com/office/2016/09/relationships/commentsIds'` +- `DEL_TEXT = qn('w:delText')` +- `INSTR_TEXT = qn('w:instrText')` +- `anchored_text(document, comment) -> str` — The document text `comment` is anchored to, taken from its range marks. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `comment_thread(document) -> Tuple[dict, ...]` — Every comment with its thread state: id, author, text, resolved, parent id, and anchored +- `delete_comment(document, comment) -> None` — Delete `comment` and its replies, removing their range marks from the text. +- `is_direct_run_child(element) -> bool` — Whether ``element`` is a direct child of a ``w:r`` element. +- `is_resolved(document, comment) -> bool` — Whether `comment`'s thread is marked resolved. +- `parent_of(document, comment) -> Optional[int]` — The comment `comment` replies to, or None when it starts a thread. +- `project_run_child(element) -> RunChildProjection` — Return the conservative text projection for a direct ``w:r`` child. +- `reply(document, comment, text, *, author, initials=None, date=None) -> 'Comment'` — Add a threaded reply to `comment` and return the new `Comment`. +- `require_comment_owner(document, comment, *, argument='comment') -> None` — Refuse a comment proxy from another part and detect detached proxies. +- `resolve(document, comment, *, resolved=True) -> None` — Mark `comment`'s thread resolved, or reopen it with `resolved=False`. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.comments` + +Collection providing access to comments added to this document. + +Full contract: [comments.md](api-001.md#source-e4a8576a6dcbd98f) + +- `Comment` — Proxy for a single comment in the document. +- `Comments` — Collection containing the comments added to this document. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. +- `rollback_xml_on_error(root) -> Generator[None, None, None]` — Restore one live XML tree after an error in a local compound edit. + +## `docx.composition` + +Cross-document composition. + +Full contract: [composition.md](api-001.md#source-12b50f562db8cd2f) + +- `CompositionFinding` +- `CompositionReport` — Everything one composition call did — the declared changed-part +- `append_document(document, source, *, section='new_page', styles='match_by_name', headers='destination') -> CompositionReport` — Append `source`'s whole body to `document`, and return a `CompositionReport`. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `insert_blocks_from(document, source, start_anchor, *, anchor, end_anchor=None, count=1, styles='match_by_name', include_start=True, include_end=True) -> CompositionReport` — Copy a block range from `source` after `anchor`, and return a `CompositionReport`. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.controls` + +Content-control (structured document tag) surface — the templating + +Full contract: [controls.md](api-001.md#source-b8f6b3944ebc8cbd) + +- `Control` — Live proxy for one content control. +- `ControlInfo` — Identity and current state of one content control. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `get_control(document, *, tag=None, alias=None) -> Control` — The single control matching `tag` and/or `alias`, or a typed refusal. +- `iter_controls(document) -> 'Iterator[Control]'` — Every content control in every story part, document order. +- `list_controls(document) -> Tuple[ControlInfo, ...]` — Identity and state of every control (schema-stable via .to_dict()). +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. +- `set_control_value(document, value, *, tag=None, alias=None) -> None` — Set the value of the control that `tag` names. + +## `docx.dml.color` + +DrawingML objects related to color, ColorFormat being the most prominent. + +Full contract: [dml.color.md](api-001.md#source-955ea838037f755e) + +- `ColorFormat` — Provides access to color settings like RGB color, theme color, and luminance adjustments. +- `RPrParent = 'CT_R'` + +## `docx.document` + +`Document` and closely related objects. + +Full contract: [document.md](api-001.md#source-1f833f98d375a316) + +- `Document` — WordprocessingML (WML) document. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.drawing` + +DrawingML-related objects are in this subpackage. + +Full contract: [drawing.md](api-001.md#source-39ef763a9ce964c8) + +- `Drawing` — Container for a DrawingML object. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.enum.base` + +Base classes and other objects used by enumerations. + +Full contract: [enum.base.md](api-001.md#source-5dd3a18ad2f06af4) + +- `BaseEnum` — Base class for Enums that do not map XML attr values. +- `BaseXmlEnum` — Base class for Enums that also map XML attr values. +- `DocsPageFormatter` — Generate an .rst doc page for an enumeration. + +## `docx.enum.dml` + +Enumerations used by DrawingML objects. + +Full contract: [enum.dml.md](api-001.md#source-d95470ef1e394d1b) + +- `MSO_COLOR_TYPE` — Specifies the color specification scheme. +- `MSO_THEME_COLOR = MSO_THEME_COLOR_INDEX` +- `MSO_THEME_COLOR_INDEX` — Indicates the Office theme color, one of those shown in the color gallery on the + +## `docx.enum.section` + +Enumerations related to the main document in WordprocessingML files. + +Full contract: [enum.section.md](api-001.md#source-29cb1aa11d41c51e) + +- `WD_HEADER_FOOTER = WD_HEADER_FOOTER_INDEX` +- `WD_HEADER_FOOTER_INDEX` — Alias: **WD_HEADER_FOOTER** +- `WD_ORIENT = WD_ORIENTATION` +- `WD_ORIENTATION` — Alias: **WD_ORIENT** +- `WD_SECTION = WD_SECTION_START` +- `WD_SECTION_START` — Alias: **WD_SECTION** + +## `docx.enum.shape` + +Enumerations related to DrawingML shapes in WordprocessingML files. + +Full contract: [enum.shape.md](api-001.md#source-b37d8620ff2f23a1) + +- `WD_INLINE_SHAPE = WD_INLINE_SHAPE_TYPE` +- `WD_INLINE_SHAPE_TYPE` — Corresponds to WdInlineShapeType enumeration. + +## `docx.enum.style` + +Enumerations related to styles. + +Full contract: [enum.style.md](api-001.md#source-9434a7db09bd1c01) + +- `WD_BUILTIN_STYLE` — Alias: **WD_STYLE** +- `WD_STYLE = WD_BUILTIN_STYLE` +- `WD_STYLE_TYPE` — Specifies one of the four style types: paragraph, character, list, or table. + +## `docx.enum.table` + +Enumerations related to tables in WordprocessingML files. + +Full contract: [enum.table.md](api-001.md#source-1f675541a0e52e24) + +- `WD_ALIGN_VERTICAL = WD_CELL_VERTICAL_ALIGNMENT` +- `WD_CELL_VERTICAL_ALIGNMENT` — Alias: **WD_ALIGN_VERTICAL** +- `WD_ROW_HEIGHT = WD_ROW_HEIGHT_RULE` +- `WD_ROW_HEIGHT_RULE` — Alias: **WD_ROW_HEIGHT** +- `WD_TABLE_ALIGNMENT` — Specifies table justification type. +- `WD_TABLE_DIRECTION` — Specifies the direction in which an application orders cells in the specified + +## `docx.enum.text` + +Enumerations related to text in WordprocessingML files. + +Full contract: [enum.text.md](api-001.md#source-f05e757fcce33a9d) + +- `WD_ALIGN_PARAGRAPH = WD_PARAGRAPH_ALIGNMENT` +- `WD_BREAK = WD_BREAK_TYPE` +- `WD_BREAK_TYPE` — Corresponds to WdBreakType enumeration. +- `WD_COLOR = WD_COLOR_INDEX` +- `WD_COLOR_INDEX` — Specifies a standard preset color to apply. +- `WD_LINE_SPACING` — Specifies a line spacing format to be applied to a paragraph. +- `WD_PARAGRAPH_ALIGNMENT` — Alias: **WD_ALIGN_PARAGRAPH** +- `WD_TAB_ALIGNMENT` — Specifies the tab stop alignment to apply. +- `WD_TAB_LEADER` — Specifies the character to use as the leader with formatted tabs. +- `WD_UNDERLINE` — Specifies the style of underline applied to a run of characters. + +## `docx.errors` + +Typed refusals for paper-docx safe-editing APIs. + +Full contract: [errors.md](api-001.md#source-15259882f4deb2a3) + +- `AmbiguousTargetError` — The target specification matches more than one location. +- `BoundaryViolationError` — The operation would cross a structural boundary it must respect. +- `DocumentProtectedError` — The document enforces an editing restriction this operation ignores. +- `MalformedPackageError` — The file is not a package this library can safely read. +- `PaperRefusal` — Base for every safe refusal raised by paper-docx APIs. +- `RelationshipPolicyError` — The operation would create or modify a package relationship unsafely. +- `TargetNotFoundError` — No location matches the target specification. +- `UnsupportedStructureError` — The target involves structure this operation does not safely support. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. + +## `docx.exceptions` + +Exceptions used with python-docx. + +Full contract: [exceptions.md](api-001.md#source-5ba7c82a99f28757) + +- `InvalidSpanError` — Raised when an invalid merge region is specified in a request to merge table +- `InvalidXmlError` — Raised when invalid XML is encountered, such as on attempt to access a missing +- `PythonDocxError` — Generic error class. + +## `docx.fields` + +Field authoring — formulas, never values. + +Full contract: [fields.md](api-001.md#source-a3b4eaa58fcf5889) + +- `add_caption(paragraph, *, label='Figure', description='') -> None` — Append a SEQ caption (`Figure 1`, `Table 1`) to `paragraph`. +- `add_date_field(paragraph, *, date_format=None) -> None` — Append a DATE field; `date_format` is Word's \@ picture, for example 'MMMM d, yyyy'. +- `add_page_count_field(paragraph) -> None` — Append a NUMPAGES field, typically to a footer paragraph. +- `add_page_number_field(paragraph) -> None` — Append a PAGE field, typically to a footer paragraph. +- `add_reference_field(paragraph, *, bookmark, kind='text') -> None` — Append a cross-reference to `bookmark`: its text (`kind="text"`), page (`"page"`), or +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `insert_toc_after(document, anchor, *, levels=(1, 3)) -> None` — Insert a TOC field in a new paragraph after `anchor`. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.formatting` + +Effective-format resolver — read-only, provenance-bearing. + +Full contract: [formatting.md](api-001.md#source-1dec973f3b97903a) + +- `EffectiveFormat` — The resolved property map, plus what is declared unresolvable. +- `ResolvedValue` — One property's effective value and where it came from. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `format_of(target) -> EffectiveFormat` — The effective formatting of a `Run`, `Paragraph` or `Span`. + +## `docx.image` + +Provides objects that can characterize image streams. + +Full contract: [image.md](api-001.md#source-b8c62bb744e27a81) + +- `SIGNATURES = ((Png, 0, b'\x89PNG\r\n\x1a\n'), (Jfif, 6, b'JFIF'), (Exif, 6, b'Exif'), (Gif, 0, b'GIF87a'), (Gif, 0, b'GIF89a'), (Tiff, 0, b'MM\x00*'), (Tiff, 0, b'II*\x00'), (Bmp, 0, b'BM'))` + +## `docx.image.bmp` + +Full contract: [image.bmp.md](api-001.md#source-cdfcdfa3143e1415) + +- `Bmp` — Image header parser for BMP images. + +## `docx.image.constants` + +Constants specific the the image sub-package. + +Full contract: [image.constants.md](api-001.md#source-cd6ae809876304fa) + +- `JPEG_MARKER_CODE` — JPEG marker codes. +- `MIME_TYPE` — Image content types. +- `PNG_CHUNK_TYPE` — PNG chunk type names. +- `TIFF_FLD = TIFF_FLD_TYPE` +- `TIFF_FLD_TYPE` — Tag codes for TIFF Image File Directory (IFD) entries. +- `TIFF_TAG` — Tag codes for TIFF Image File Directory (IFD) entries. + +## `docx.image.exceptions` + +Exceptions specific the the image sub-package. + +Full contract: [image.exceptions.md](api-001.md#source-93e3b74e30e5b70d) + +- `InvalidImageStreamError` — The recognized image stream appears to be corrupted. +- `UnexpectedEndOfFileError` — EOF was unexpectedly encountered while reading an image stream. +- `UnrecognizedImageError` — The provided image stream could not be recognized. + +## `docx.image.gif` + +Full contract: [image.gif.md](api-001.md#source-0c70ceec21fb4450) + +- `Gif` — Image header parser for GIF images. + +## `docx.image.helpers` + +Full contract: [image.helpers.md](api-001.md#source-07b25500f249c3ce) + +- `BIG_ENDIAN = '>'` +- `LITTLE_ENDIAN = '<'` +- `StreamReader` — Wraps a file-like object to provide access to structured data from a binary file. + +## `docx.image.image` + +Provides objects that can characterize image streams. + +Full contract: [image.image.md](api-001.md#source-083f592a0c8631cc) + +- `BaseImageHeader` — Base class for image header subclasses like `Jpeg` and `Tiff`. +- `Image` — Graphical image stream such as JPEG, PNG, or GIF with properties and methods + +## `docx.image.jpeg` + +Objects related to parsing headers of JPEG image streams. + +Full contract: [image.jpeg.md](api-001.md#source-7671e88f38d60e00) + +- `Exif` — Image header parser for Exif image format. +- `Jfif` — Image header parser for JFIF image format. +- `Jpeg` — Base class for JFIF and EXIF subclasses. + +## `docx.image.png` + +Full contract: [image.png.md](api-001.md#source-1ff94a8d5409223f) + +- `Png` — Image header parser for PNG images. + +## `docx.image.tiff` + +Full contract: [image.tiff.md](api-001.md#source-9f7686d8c790e5e0) + +- `Tiff` — Image header parser for TIFF images. + +## `docx.links` + +Create and retarget hyperlinks on existing text. + +Full contract: [links.md](api-002.md#source-c169840ba53458fd) + +- `add_hyperlink(document, span, address) -> Hyperlink` — Wrap `span`'s runs in a hyperlink pointing at `address`. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `require_span_owner(document, span, *, argument='span') -> None` — Refuse a live span captured from a different document package. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.notes` + +Create footnotes and endnotes, including the note body and the mark. + +Full contract: [notes.md](api-002.md#source-6b756e6a87f50fae) + +- `add_endnote(document, span, text) -> int` — Attach an endnote to `span` and return its note id. +- `add_footnote(document, span, text) -> int` — Attach a footnote to `span` and return its note id. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `require_span_owner(document, span, *, argument='span') -> None` — Refuse a live span captured from a different document package. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.numbering` + +Numbering enumeration, application, and minimal authoring (paper-docx). + +Full contract: [numbering.md](api-002.md#source-61a628fe2ee2866a) + +- `NumberedParagraph` +- `NumberingDefinition` +- `NumberingLevel` +- `NumberingReport` +- `apply_list_style(paragraph, style_name) -> None` — Apply the existing paragraph style `style_name` to `paragraph`. +- `apply_numbering(paragraph, *, num_id, level=0) -> None` — Give `paragraph` the existing numbering definition `num_id` at `level`. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `ensure_bullet_definition(document) -> int` — The numId of a canonical bullet-list definition, creating it when absent. +- `ensure_decimal_definition(document) -> int` — The numId of a canonical decimal-list definition, creating it when absent. +- `list_numbering(document) -> NumberingReport` — Every numbering definition and every numbered paragraph in `document`. +- `restart_numbering(document, *, num_id) -> int` — A NEW numId continuing `num_id`'s formatting but restarting the count at 1. + +## `docx.opc.constants` + +Constant values related to the Open Packaging Convention. + +Full contract: [opc.constants.md](api-002.md#source-9a5b2f4589772f7a) + +- `CONTENT_TYPE` — Content type URIs (like MIME-types) that specify a part's format. +- `NAMESPACE` — Constant values for OPC XML namespaces. +- `RELATIONSHIP_TARGET_MODE` — Open XML relationship target modes. +- `RELATIONSHIP_TYPE` + +## `docx.opc.coreprops` + +Provides CoreProperties, Dublin-Core attributes of the document. + +Full contract: [opc.coreprops.md](api-002.md#source-ff23b2e7f45659e6) + +- `CoreProperties` — Corresponds to part named ``/docProps/core.xml``, containing the core document + +## `docx.opc.exceptions` + +Exceptions specific to python-opc. + +Full contract: [opc.exceptions.md](api-002.md#source-4eb353a0957fc371) + +- `OpcError` — Base error class for python-opc. +- `PackageNotFoundError` — Raised when a package cannot be found at the specified path. + +## `docx.opc.oxml` + +Temporary stand-in for main oxml module. + +Full contract: [opc.oxml.md](api-002.md#source-4080bba1ebfeb0c5) + +- `BaseOxmlElement` — Base class for all custom element classes, to add standardized behavior to all +- `CT_Default` — `` element that appears in `[Content_Types].xml` part. +- `CT_Override` — ```` element, specifying the content type to be applied for a part with +- `CT_Relationship` — `` element, representing a single relationship from source to target part. +- `CT_Relationships` — ```` element, the root element in a .rels file. +- `CT_Types` — ```` element, the container element for Default and Override elements in +- `ct_namespace = element_class_lookup.get_namespace(nsmap['ct'])` +- `element_class_lookup = etree.ElementNamespaceClassLookup()` +- `nsmap = {'ct': NS.OPC_CONTENT_TYPES, 'pr': NS.OPC_RELATIONSHIPS, 'r': NS.OFC_RELATIONSHIPS}` +- `oxml_parser = etree.XMLParser(remove_blank_text=True, resolve_entities=False)` +- `parse_xml(text) -> etree._Element` — `etree.fromstring()` replacement that uses oxml parser. +- `pr_namespace = element_class_lookup.get_namespace(nsmap['pr'])` +- `qn(tag) -> str` — Stands for "qualified name", a utility function to turn a namespace prefixed tag +- `serialize_for_reading(element) -> str` — Serialize `element` to human-readable XML suitable for tests. +- `serialize_part_xml(part_elm) -> bytes` — Serialize `part_elm` etree element to XML suitable for storage as an XML part. + +## `docx.opc.package` + +Objects that implement reading and writing OPC packages. + +Full contract: [opc.package.md](api-002.md#source-d23a8c64e00a62f7) + +- `OpcPackage` — Main API class for `python-opc`. +- `Unmarshaller` — Hosts static methods for unmarshalling a package from a `PackageReader`. + +## `docx.opc.packuri` + +Provides the PackURI value type. + +Full contract: [opc.packuri.md](api-002.md#source-3991256132d60e2f) + +- `CONTENT_TYPES_URI = PackURI('/[Content_Types].xml')` +- `PACKAGE_URI = PackURI('/')` +- `PackURI` — Provides access to pack URI components such as the baseURI and the filename slice. + +## `docx.opc.part` + +Open Packaging Convention (OPC) objects related to package parts. + +Full contract: [opc.part.md](api-002.md#source-af3c023a316b85ae) + +- `Part` — Base class for package parts. +- `PartFactory` — Provides a way for client code to specify a subclass of `Part` to be constructed +- `XmlPart` — Base class for package parts containing an XML payload, which is most of them. + +## `docx.opc.parts.coreprops` + +Core properties part, corresponds to ``/docProps/core.xml`` part in package. + +Full contract: [opc.parts.coreprops.md](api-002.md#source-90b8541a1f60e01f) + +- `CorePropertiesPart` — Corresponds to part named ``/docProps/core.xml``. + +## `docx.opc.phys_pkg` + +Provides a general interface to a `physical` OPC package, such as a zip file. + +Full contract: [opc.phys_pkg.md](api-002.md#source-929fd048fcc3ba2b) + +- `GuardedZipReader` — Validate and stream every member of an already-open ``ZipFile``. +- `PhysPkgReader` — Factory for physical package reader objects. +- `PhysPkgWriter` — Factory for physical package writer objects. +- `preflight_zip(source) -> None` — Validate central-directory metadata before ``ZipFile`` opens. + +## `docx.opc.pkgreader` + +Low-level, read-only API to a serialized Open Packaging Convention (OPC) package. + +Full contract: [opc.pkgreader.md](api-002.md#source-6f13d33426ef53f2) + +- `PackageReader` — Provides access to the contents of a zip-format OPC package via its +- `content_type_matches(actual, expected) -> bool` +- `is_relationship_type(actual, expected) -> bool` +- `is_xml_id(value) -> bool` — Whether ``value`` has the XML Schema ID/NCName lexical form. + +## `docx.opc.pkgwriter` + +Provides low-level, write-only API to serialized (OPC) package. + +Full contract: [opc.pkgwriter.md](api-002.md#source-9ab18049af59e808) + +- `PackageWriter` — Writes a zip-format OPC package to `pkg_file`, where `pkg_file` can be either a + +## `docx.opc.rel` + +Relationship-related objects. + +Full contract: [opc.rel.md](api-002.md#source-b06938114c472f39) + +- `Relationships` — Collection object for `_Relationship` instances, having list semantics. + +## `docx.opc.shared` + +Objects shared by opc modules. + +Full contract: [opc.shared.md](api-002.md#source-174a9136bc6f2b62) + +- `CaseInsensitiveDict` — Mapping type that behaves like dict except that it matches without respect to the +- `cls_method_fn(method_name)` — Return method of `cls` having `method_name`. + +## `docx.opc.spec` + +Provides mappings that embody aspects of the Open XML spec ISO/IEC 29500. + +Full contract: [opc.spec.md](api-002.md#source-9ed61d16d8e8ea38) + +- `default_content_types = (('bin', CT.PML_PRINTER_SETTINGS), ('bin', CT.SML_PRINTER_SETTINGS), ('bin', CT.WML_PRINTER_SETTINGS), ('bmp', CT.BMP), ('emf', CT.X_EMF), ('fntdata', CT.X_FONTDATA), ('gif', CT.GIF), ('jpe', CT.JPEG), ('jpeg', CT.JPEG), ('jpg', CT.JPEG), ('png', CT.PNG), ('rels', CT.OPC_RELATIONSHIPS), ('tif', CT.TIFF), ('tiff', CT.TIFF), ('wdp', CT.MS_PHOTO), ('wmf', CT.X_WMF), ('xlsx', CT.SML_SHEET), ('xml', CT.XML))` + +## `docx.oxml.comments` + +Custom element classes related to document comments. + +Full contract: [oxml.comments.md](api-002.md#source-9e40b590666fa759) + +- `CT_Comment` — `w:comment` element, representing a single comment. +- `CT_Comments` — `w:comments` element, the root element for the comments part. + +## `docx.oxml.coreprops` + +Custom element classes for core properties-related XML elements. + +Full contract: [oxml.coreprops.md](api-002.md#source-f2ee1e7f4466f0aa) + +- `CT_CoreProperties` — `` element, the root element of the Core Properties part. + +## `docx.oxml.document` + +Custom element classes that correspond to the document part, e.g. . + +Full contract: [oxml.document.md](api-002.md#source-90fe632de8cbe585) + +- `CT_Body` — `w:body`, the container element for the main document story in `document.xml`. +- `CT_Document` — ```` element, the root element of a document.xml file. + +## `docx.oxml.drawing` + +Custom element-classes for DrawingML-related elements like ``. + +Full contract: [oxml.drawing.md](api-002.md#source-585ff05c61f1b05c) + +- `CT_Drawing` — `` element, containing a DrawingML object like a picture or chart. + +## `docx.oxml.exceptions` + +Exceptions for oxml sub-package. + +Full contract: [oxml.exceptions.md](api-002.md#source-a13795e46d38261b) + +- `InvalidXmlError` — Raised when invalid XML is encountered, such as on attempt to access a missing +- `XmlchemyError` — Generic error class. + +## `docx.oxml.ns` + +Namespace-related objects. + +Full contract: [oxml.ns.md](api-002.md#source-3776be9049db09e6) + +- `NamespacePrefixedTag` — Value object that knows the semantics of an XML tag having a namespace prefix. +- `nsdecls(*prefixes) -> str` — Namespace declaration including each namespace-prefix in `prefixes`. +- `nsmap = {'a': 'http://schemas.openxmlformats.org/drawingml/2006/main', 'c': 'http://schemas.openxmlformats.org/drawingml/2006/chart', 'cp': 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties', 'dc': 'http://purl.org/dc/elements/1.1/', 'dcmitype': 'http://purl.org/dc/dcmitype/', 'dcterms': 'http://purl.org/dc/terms/', 'dgm': 'http://schemas.openxmlformats.org/drawingml/2006/diagram', 'm': 'http://schemas.openxmlformats.org/officeDocument/2006/math', 'pic': 'http://schemas.openxmlformats.org/drawingml/2006/picture', 'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships', 'sl': 'http://schemas.openxmlformats.org/schemaLibrary/2006/main', 'w': 'http://schemas.openxmlformats.org/wordprocessingml/2006/main', 'w14': 'http://schemas.microsoft.com/office/word/2010/wordml', 'wp': 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing', 'xml': 'http://www.w3.org/XML/1998/namespace', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}` +- `nspfxmap(*nspfxs) -> Dict[str, str]` — Subset namespace-prefix mappings specified by *nspfxs*. +- `pfxmap = {value: key for key, value in nsmap.items()}` +- `qn(tag) -> str` — Stands for "qualified name". + +## `docx.oxml.numbering` + +Custom element classes related to the numbering part. + +Full contract: [oxml.numbering.md](api-002.md#source-eb336efe1afe672d) + +- `CT_Num` — ```` element, which represents a concrete list definition instance, having +- `CT_NumLvl` — ```` element, which identifies a level in a list definition to +- `CT_NumPr` — A ```` element, a container for numbering properties applied to a +- `CT_Numbering` — ```` element, the root element of a numbering part, i.e. + +## `docx.oxml.parser` + +XML parser for python-docx. + +Full contract: [oxml.parser.md](api-002.md#source-4e15de4882fc29ef) + +- `OxmlElement(nsptag_str, attrs=None, nsdecls=None) -> BaseOxmlElement | etree._Element` — Return a 'loose' lxml element having the tag specified by `nsptag_str`. +- `element_class_lookup = etree.ElementNamespaceClassLookup()` +- `oxml_parser = etree.XMLParser(remove_blank_text=True, resolve_entities=False)` +- `parse_xml(xml) -> 'BaseOxmlElement'` — Root lxml element obtained by parsing XML character string `xml`. +- `register_element_cls(tag)` — Register an lxml custom element-class to use for `tag`. + +## `docx.oxml.revision` + +Custom element classes for the tracked-change (revision) vocabulary. + +Full contract: [oxml.revision.md](api-002.md#source-868781954bd7f97a) + +- `CT_RunTrackChange` — `w:ins` and `w:del` elements: a tracked run-level change. + +## `docx.oxml.section` + +Section-related custom element classes. + +Full contract: [oxml.section.md](api-002.md#source-5cae517757ff9cab) + +- `BlockElement = 'CT_P | CT_Tbl'` +- `CT_HdrFtr` — `w:hdr` and `w:ftr`, the root element for header and footer part respectively. +- `CT_HdrFtrRef` — `w:headerReference` and `w:footerReference` elements. +- `CT_PageMar` — ```` element, defining page margins. +- `CT_PageSz` — ```` element, defining page dimensions and orientation. +- `CT_SectPr` — `w:sectPr` element, the container element for section properties. +- `CT_SectType` — ```` element, defining the section start type. + +## `docx.oxml.settings` + +Custom element classes related to document settings. + +Full contract: [oxml.settings.md](api-002.md#source-45b5f1beb29c3ab7) + +- `CT_Settings` — `w:settings` element, root element for the settings part. + +## `docx.oxml.shape` + +Custom element classes for shape-related elements like ``. + +Full contract: [oxml.shape.md](api-003.md#source-3c34f39af8be119f) + +- `CT_Anchor` — `` element, container for a "floating" shape. +- `CT_Blip` — ```` element, specifies image source and adjustments such as alpha and +- `CT_BlipFillProperties` — ```` element, specifies picture properties. +- `CT_GraphicalObject` — ```` element, container for a DrawingML object. +- `CT_GraphicalObjectData` — ```` element, container for the XML of a DrawingML object. +- `CT_Inline` — `` element, container for an inline shape. +- `CT_NonVisualDrawingProps` — Used for ```` element, and perhaps others. +- `CT_NonVisualPictureProperties` — ```` element, specifies picture locking and resize behaviors. +- `CT_Picture` — ```` element, a DrawingML picture. +- `CT_PictureNonVisual` — ```` element, non-visual picture properties. +- `CT_Point2D` — Used for ```` element, and perhaps others. +- `CT_PositiveSize2D` — Used for ```` element, and perhaps others later. +- `CT_PresetGeometry2D` — ```` element, specifies an preset autoshape geometry, such as +- `CT_RelativeRect` — ```` element, specifying picture should fill containing rectangle +- `CT_ShapeProperties` — ```` element, specifies size and shape of picture container. +- `CT_StretchInfoProperties` — ```` element, specifies how picture should fill its containing +- `CT_Transform2D` — ```` element, specifies size and shape of picture container. + +## `docx.oxml.shared` + +Objects shared by modules in the docx.oxml subpackage. + +Full contract: [oxml.shared.md](api-003.md#source-05c954f91ee8b9d5) + +- `CT_DecimalNumber` — Used for ````, ````, ```` and several others, +- `CT_OnOff` — Used for `w:b`, `w:i` elements and others. +- `CT_String` — Used for `w:pStyle` and `w:tblStyle` elements and others. + +## `docx.oxml.simpletypes` + +Simple-type classes, corresponding to ST_* schema items. + +Full contract: [oxml.simpletypes.md](api-003.md#source-6b3f05b8ff6f1d9d) + +- `BaseIntType` +- `BaseSimpleType` — Base class for simple-types. +- `BaseStringEnumerationType` +- `BaseStringType` +- `ST_BrClear` +- `ST_BrType` +- `ST_Coordinate` +- `ST_CoordinateUnqualified` +- `ST_DateTime` +- `ST_DecimalNumber` +- `ST_DrawingElementId` +- `ST_HexColor` +- `ST_HexColorAuto` — Value for `w:color/[@val="auto"] attribute setting. +- `ST_HpsMeasure` — Half-point measure, e.g. 24.0 represents 12.0 points. +- `ST_Merge` — Valid values for attribute. +- `ST_OnOff` +- `ST_PositiveCoordinate` +- `ST_RelationshipId` +- `ST_SignedTwipsMeasure` +- `ST_String` +- `ST_TblLayoutType` +- `ST_TblWidth` +- `ST_TwipsMeasure` +- `ST_UniversalMeasure` +- `ST_VerticalAlignRun` — Valid values for `w:vertAlign/@val`. +- `XsdAnyUri` — There's a regex in the spec this is supposed to meet... +- `XsdBoolean` +- `XsdId` — String that must begin with a letter or underscore and cannot contain any colons. +- `XsdInt` +- `XsdLong` +- `XsdString` +- `XsdStringEnumeration` — Set of enumerated xsd:string values. +- `XsdToken` — Xsd:string with whitespace collapsing, e.g. multiple spaces reduced to one, +- `XsdUnsignedInt` +- `XsdUnsignedLong` + +## `docx.oxml.styles` + +Custom element classes related to the styles part. + +Full contract: [oxml.styles.md](api-003.md#source-fa6a21a66e584ad1) + +- `CT_LatentStyles` — `w:latentStyles` element, defining behavior defaults for latent styles and +- `CT_LsdException` — ```` element, defining override visibility behaviors for a named +- `CT_Style` — A ```` element, representing a style definition. +- `CT_Styles` — ```` element, the root element of a styles part, i.e. styles.xml. +- `styleId_from_name(name)` — Return the style id corresponding to `name`, taking into account special-case + +## `docx.oxml.table` + +Custom element classes for tables. + +Full contract: [oxml.table.md](api-003.md#source-3570d1cbd726407b) + +- `CT_Height` — Used for `w:trHeight` to specify a row height and row height rule. +- `CT_Row` — ```` element. +- `CT_Tbl` — ```` element. +- `CT_TblGrid` — `w:tblGrid` element. +- `CT_TblGridCol` — `w:gridCol` element, child of `w:tblGrid`, defines a table column. +- `CT_TblLayoutType` — `w:tblLayout` element. +- `CT_TblPr` — ```` element, child of ````, holds child elements that define +- `CT_TblPrEx` — `w:tblPrEx` element, exceptions to table-properties. +- `CT_TblWidth` — Used for `w:tblW` and `w:tcW` and others, specifies a table-related width. +- `CT_Tc` — `w:tc` table cell element. +- `CT_TcPr` — ```` element, defining table cell properties. +- `CT_TrPr` — ```` element, defining table row properties. +- `CT_VMerge` — ```` element, specifying vertical merging behavior of a cell. +- `CT_VerticalJc` — `w:vAlign` element, specifying vertical alignment of cell. + +## `docx.oxml.text.font` + +Custom element classes related to run properties (font). + +Full contract: [oxml.text.font.md](api-003.md#source-4d4f960722b22afa) + +- `CT_Color` — `w:color` element, specifying the color of a font and perhaps other objects. +- `CT_Fonts` — `` element. +- `CT_Highlight` — `w:highlight` element, specifying font highlighting/background color. +- `CT_HpsMeasure` — Used for `` element and others, specifying font size in half-points. +- `CT_RPr` — `` element, containing the properties for a run. +- `CT_Underline` — `` element, specifying the underlining style for a run. +- `CT_VerticalAlignRun` — `` element, specifying subscript or superscript. + +## `docx.oxml.text.hyperlink` + +Custom element classes related to hyperlinks (CT_Hyperlink). + +Full contract: [oxml.text.hyperlink.md](api-003.md#source-7ada26ea94abbe06) + +- `CT_Hyperlink` — `` element, containing the text and address for a hyperlink. + +## `docx.oxml.text.pagebreak` + +Custom element class for rendered page-break (CT_LastRenderedPageBreak). + +Full contract: [oxml.text.pagebreak.md](api-003.md#source-f3aef6b9eb6b1517) + +- `CT_LastRenderedPageBreak` — `` element, indicating page break inserted by renderer. + +## `docx.oxml.text.paragraph` + +Custom element classes related to paragraphs (CT_P). + +Full contract: [oxml.text.paragraph.md](api-003.md#source-1e76def15bbd8450) + +- `CT_P` — `` element, containing the properties and text for a paragraph. + +## `docx.oxml.text.parfmt` + +Custom element classes related to paragraph properties (CT_PPr). + +Full contract: [oxml.text.parfmt.md](api-003.md#source-ac18acaea7c8b971) + +- `CT_Ind` — ```` element, specifying paragraph indentation. +- `CT_Jc` — ```` element, specifying paragraph justification. +- `CT_PPr` — ```` element, containing the properties for a paragraph. +- `CT_Spacing` — ```` element, specifying paragraph spacing attributes such as space +- `CT_TabStop` — `` element, representing an individual tab stop. +- `CT_TabStops` — ```` element, container for a sorted sequence of tab stops. + +## `docx.oxml.text.run` + +Custom element classes related to text runs (CT_R). + +Full contract: [oxml.text.run.md](api-003.md#source-5569e2e09c4bff18) + +- `CT_Br` — `` element, indicating a line, page, or column break in a run. +- `CT_Cr` — `` element, representing a carriage-return (0x0D) character within a run. +- `CT_NoBreakHyphen` — `` element, a hyphen ineligible for a line-wrap position. +- `CT_PTab` — `` element, representing an absolute-position tab character within a run. +- `CT_R` — `` element, containing the properties and text for a run. +- `CT_Text` — `` element, containing a sequence of characters within a run. + +## `docx.oxml.xmlchemy` + +Enabling declarative definition of lxml custom element classes. + +Full contract: [oxml.xmlchemy.md](api-003.md#source-15800524d904f954) + +- `BaseAttribute` — Base class for OptionalAttribute and RequiredAttribute. +- `BaseOxmlElement` — Effective base class for all custom element classes. +- `Choice` — Defines a child element belonging to a group, only one of which may appear as a child. +- `MetaOxmlElement` — Metaclass for BaseOxmlElement. +- `OneAndOnlyOne` — Defines a required child element for MetaOxmlElement. +- `OneOrMore` — Defines a repeating child element for MetaOxmlElement that must appear at least +- `OptionalAttribute` — Defines an optional attribute on a custom element class. +- `RequiredAttribute` — Defines a required attribute on a custom element class. +- `XmlString` — Provides string comparison override suitable for serialized XML that is useful +- `ZeroOrMore` — Defines an optional repeating child element for MetaOxmlElement. +- `ZeroOrOne` — Defines an optional child element for MetaOxmlElement. +- `ZeroOrOneChoice` — Correspondes to an ``EG_*`` element group where at most one of its members may +- `serialize_for_reading(element)` — Serialize `element` to human-readable XML suitable for tests. + +## `docx.package` + +WordprocessingML Package class and related objects. + +Full contract: [package.md](api-003.md#source-85bd5a055971b2f8) + +- `CompareFinding` — One difference compare REPORTS instead of redlining (declared limit). +- `CompareResult` — The redlined document plus everything compare could not redline. +- `ImageParts` — Collection of `ImagePart` objects corresponding to images in the package. +- `Package` — Customizations specific to a WordprocessingML package. +- `PackageDiagnosis` — Typed triage for a file `docx.Document()` may refuse or crash on. +- `PackageDiff` — Part-by-part comparison of two OPC packages. +- `PartDiff` — One byte-changed part in a package comparison. +- `PatchSaveResult` — Outcome of a `patch_save` call. +- `StoryTextDiff` +- `TextDiff` — Per-story unified diffs of visible block text. +- `compare(original, revised, *, author, date=None, granularity='word', materialize=None) -> CompareResult` — A `CompareResult`: `original` plus tracked changes producing `revised`. +- `diagnose(path) -> PackageDiagnosis` — Why the file at `path` can or cannot be opened, as a `PackageDiagnosis`. +- `diff_package(path_a, path_b) -> PackageDiff` — Part-by-part diff of the OPC packages at `path_a` and `path_b`. +- `patch_save(original_path, document, out_path) -> PatchSaveResult` — Save `document` to `out_path`, restoring original bytes wherever possible. +- `pending_changes(path) -> TextDiff` — What the document's pending revisions would change if all were accepted. +- `text_diff(path_a, path_b, *, view='current') -> TextDiff` — What changed, textually, between the documents at `path_a` and `path_b`. +- `xml_equivalent(a, b) -> bool` — True when `a` and `b` are structurally identical XML documents. + +## `docx.parts.comments` + +Contains comments added to the document. + +Full contract: [parts.comments.md](api-003.md#source-d07f59ec6b6091ab) + +- `CommentsPart` — Container part for comments added to the document. + +## `docx.parts.document` + +`DocumentPart` and closely related objects. + +Full contract: [parts.document.md](api-003.md#source-feecabc5676a282a) + +- `DocumentPart` — Main document part of a WordprocessingML (WML) package, aka a .docx file. + +## `docx.parts.endnotes` + +`EndnotesPart`, the story part containing a document's endnotes. + +Full contract: [parts.endnotes.md](api-003.md#source-9fd9de78cb108dd6) + +- `EndnotesPart` — Proxy for the endnotes part (`word/endnotes.xml`) of a document. + +## `docx.parts.footnotes` + +`FootnotesPart`, the story part containing a document's footnotes. + +Full contract: [parts.footnotes.md](api-003.md#source-449e9230d2b2ea6f) + +- `FootnotesPart` — Proxy for the footnotes part (`word/footnotes.xml`) of a document. + +## `docx.parts.hdrftr` + +Header and footer part objects. + +Full contract: [parts.hdrftr.md](api-003.md#source-52daf888ea897871) + +- `FooterPart` — Definition of a section footer. +- `HeaderPart` — Definition of a section header. + +## `docx.parts.image` + +The proxy class for an image part, and related objects. + +Full contract: [parts.image.md](api-003.md#source-a83c3679f718c78a) + +- `ImagePart` — An image part. + +## `docx.parts.numbering` + +`NumberingPart` and closely related objects. + +Full contract: [parts.numbering.md](api-003.md#source-dd7e507740c186b6) + +- `NumberingPart` — Proxy for the numbering.xml part containing numbering definitions for a document + +## `docx.parts.settings` + +`SettingsPart` and closely related objects. + +Full contract: [parts.settings.md](api-003.md#source-56e5dd859ff03e89) + +- `SettingsPart` — Document-level settings part of a WordprocessingML (WML) package. + +## `docx.parts.story` + +`StoryPart` and related objects. + +Full contract: [parts.story.md](api-003.md#source-926a44a16e867f59) + +- `StoryPart` — Base class for story parts. + +## `docx.parts.styles` + +Provides StylesPart and related objects. + +Full contract: [parts.styles.md](api-003.md#source-bae14dee2b7024de) + +- `StylesPart` — Proxy for the styles.xml part containing style definitions for a document or + +## `docx.protection` + +Document-protection awareness (paper-docx). + +Full contract: [protection.md](api-003.md#source-dc198d86f07b14e6) + +- `OPERATION_CLASSES = (OP_COMMENT, OP_FORM_FIELD, OP_BODY)` +- `OP_BODY = 'body-content'` +- `OP_COMMENT = 'comment'` +- `OP_FORM_FIELD = 'form-field-value'` +- `ProtectionStatus` — What `w:documentProtection` declares, read-only. +- `acknowledge_protection(document) -> ProtectionStatus` — Explicitly override protection for this open package (in-memory only). +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `protection_status(document) -> ProtectionStatus` — The document's `w:documentProtection` state (report-only). +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. +- `set_protection(document, *, edit) -> ProtectionStatus` — Turn Restrict Editing on for delivery (`w:documentProtection`). + +## `docx.revision` + +Revision enumeration and resolution (paper-docx, `Document.revisions`). + +Full contract: [revision.md](api-003.md#source-3d87bbe7684c1331) + +- `RESOLVABLE_TYPES = frozenset({'insertion', 'deletion', 'format_change', 'row_insertion', 'row_deletion', 'move_from', 'move_to'})` +- `Revision` — One tracked change, addressable — and resolvable when supported. +- `Revisions` — All tracked changes in a document, across every story part. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.search` + +Exact and normalized text search over visibility-complete traversal. + +Full contract: [search.md](api-003.md#source-678e9875a3fa1ca8) + +- `ReplaceAllResult` — Outcome of a `replace_all` call: per-match results, never silent. +- `ReplaceResult` — Outcome of a `Span.replace` call. +- `Span` — A visible-text interval mapped back to its concrete text atoms. +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `find_one(document, needle, *, nth=None, story=None, view='current', match='exact') -> Span` — The single span matching `needle`, or a typed refusal. +- `find_text(document, needle, *, nth=None, near=None, story=None, view='current', match='exact') -> 'List[Span]'` — Every span of `needle` in `document` under the selected match policy. +- `normalize_text(value) -> str` — `value` normalized for matching: folded punctuation, collapsed +- `replace_all(document, needle, new_text, *, story=None, view='current', match='exact', tracked=False, author=None, date=None, preserve_revision=False) -> ReplaceAllResult` — Replace every match of `needle` in one pass, and return a `ReplaceAllResult`. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.section` + +The `Section` object and related proxy classes. + +Full contract: [section.md](api-003.md#source-eee4067844e2f8df) + +- `Section` — Document section, providing access to section and page setup settings. +- `Sections` — Sequence of `Section` objects corresponding to the sections in the document. + +## `docx.settings` + +Settings object, providing access to document-level settings. + +Full contract: [settings.md](api-003.md#source-532a135b0b75ed2c) + +- `Settings` — Provides access to document-level settings for a document. + +## `docx.shape` + +Objects related to shapes. + +Full contract: [shape.md](api-003.md#source-1de2aab13071562e) + +- `InlineShape` — Proxy for an ```` element, representing the container for an inline +- `InlineShapes` — Sequence of `InlineShape` instances, supporting len(), iteration, and indexed access. + +## `docx.shared` + +Objects shared by docx modules. + +Full contract: [shared.md](api-003.md#source-09c5113e562f432e) + +- `Cm` — Convenience constructor for length in centimeters, e.g. ``height = Cm(12)``. +- `ElementProxy` — Base class for lxml element proxy classes. +- `Emu` — Convenience constructor for length in English Metric Units, e.g. ``width = +- `Inches` — Convenience constructor for length in inches, e.g. ``width = Inches(0.5)``. +- `Length` — Base class for length constructor classes Inches, Cm, Mm, Px, and Emu. +- `Mm` — Convenience constructor for length in millimeters, e.g. ``width = Mm(240.5)``. +- `Parented` — Provides common services for document elements that occur below a part but may +- `Pt` — Convenience value class for specifying a length in points. +- `RGBColor` — Immutable value object defining a particular RGB color. +- `StoryChild` — A document element within a story part. +- `T = TypeVar('T')` +- `TextAccumulator` — Accepts `str` fragments and joins them together, in order, on `.pop(). +- `Twips` — Convenience constructor for length in twips, e.g. ``width = Twips(42)``. +- `lazyproperty` — Decorator like @property, but evaluated only on first access. +- `write_only_property(f)` — @write_only_property decorator. + +## `docx.story` + +Visibility-complete story traversal and inspection (paper-docx, opt-in). + +Full contract: [story.md](api-003.md#source-6248ea8bd2e0c910) + +- `Anchor` — Legacy, inert location evidence: story part + index + content hash. +- `BLIND_REGION_KEYS = ('tracked_insertions', 'tracked_deletions', 'moves', 'format_changes', 'content_controls', 'text_boxes', 'fields', 'math', 'embedded_objects', 'alt_chunks', 'hidden_text')` +- `Block` — One live, owner-bound paragraph or table observed during traversal. +- `Outline` — Inspection snapshot of a document: every block in every story part. +- `TableShape` +- `VIEWS = ('current', 'original', 'all')` +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `content_hash(text) -> str` — First 8 hex chars of SHA-256 over the block's normalized text. +- `iter_blocks(document, *, view='current') -> Iterator[Block]` — Every block in every story part of `document`, in document order. +- `normalize_text(value) -> str` — `value` normalized for matching: folded punctuation, collapsed +- `outline(document, *, view='current') -> Outline` — Inspection snapshot: story parts, all blocks, blind-region counts. +- `story_parts(document) -> Tuple[str, ...]` — Every story part present in `document`, in traversal order. + +## `docx.styles` + +Sub-package module for docx.styles sub-package. + +Full contract: [styles.md](api-003.md#source-9047785bdc7a3919) + +- `BabelFish` — Translates special-case style names from UI name (e.g. Heading 1) to + +## `docx.styles.latent` + +Latent style-related objects. + +Full contract: [styles.latent.md](api-003.md#source-d3ea04d7bb4f510e) + +- `LatentStyles` — Provides access to the default behaviors for latent styles in this document and + +## `docx.styles.style` + +Style object hierarchy. + +Full contract: [styles.style.md](api-003.md#source-382c966f01959966) + +- `BaseStyle` — Base class for the various types of style object, paragraph, character, table, +- `CharacterStyle` — A character style. +- `ParagraphStyle` — A paragraph style. +- `StyleFactory(style_elm) -> BaseStyle` — Return `Style` object of appropriate `BaseStyle` subclass for `style_elm`. + +## `docx.styles.styles` + +Styles object, container for all objects in the styles part. + +Full contract: [styles.styles.md](api-003.md#source-28eb6ea5b5023bcb) + +- `Styles` — Provides access to the styles defined in a document. + +## `docx.table` + +The `Table` object and related proxy classes. + +Full contract: [table.md](api-003.md#source-ce74a9bf2d749312) + +- `Table` — Proxy class for a WordprocessingML ```` element. +- `TableParent = 'Table | _Columns | _Rows'` + +## `docx.tableops` + +Narrow, guarded table operations (paper-docx). + +Full contract: [tableops.md](api-004.md#source-32cd0a2c56006650) + +- `check_install() -> None` — Refuse when paper-docx and python-docx are both installed. +- `delete_row(table, row) -> None` — Delete row `row` (0-based). +- `find_table(document, *, near_text, match='exact') -> 'Table'` — The table with one physical cell containing `near_text`. +- `insert_row_after(table, row, values, *, copy_format_from=None) -> None` — Insert a row after `row` (0-based), copying formatting from `copy_format_from` and +- `update_cell(table, row, column, new_text, *, tracked=False, author=None, date=None) -> ReplaceResult` — Replace one cell's visible text and return a `ReplaceResult` (0-based `row`, + +## `docx.text.font` + +Font-related proxy objects. + +Full contract: [text.font.md](api-004.md#source-c00c94b81e29f2ef) + +- `Font` — Proxy object for parent of a `` element and providing access to + +## `docx.text.hyperlink` + +Hyperlink-related proxy objects for python-docx, Hyperlink in particular. + +Full contract: [text.hyperlink.md](api-004.md#source-4214660cb391bec9) + +- `Hyperlink` — Proxy object wrapping a `` element. +- `rollback_on_error(document, *participants) -> Generator[None, None, None]` — Restore the live package and named mutable proxies after an error. + +## `docx.text.pagebreak` + +Proxy objects related to rendered page-breaks. + +Full contract: [text.pagebreak.md](api-004.md#source-44dfc592f980e410) + +- `RenderedPageBreak` — A page-break inserted by Word during page-layout for print or display purposes. + +## `docx.text.paragraph` + +Paragraph-related proxy types. + +Full contract: [text.paragraph.md](api-004.md#source-2c1d902c346c5cdd) + +- `Paragraph` — Proxy object wrapping a `` element. + +## `docx.text.parfmt` + +Paragraph-related proxy types. + +Full contract: [text.parfmt.md](api-004.md#source-79ff58c0fb93748a) + +- `ParagraphFormat` — Provides access to paragraph formatting such as justification, indentation, line + +## `docx.text.run` + +Run-related proxy objects for python-docx, Run in particular. + +Full contract: [text.run.md](api-004.md#source-1b9a14c58e608abf) + +- `Run` — Proxy object wrapping `` element. +- `rollback_xml_on_error(root) -> Generator[None, None, None]` — Restore one live XML tree after an error in a local compound edit. + +## `docx.text.tabstops` + +Tabstop-related proxy types. + +Full contract: [text.tabstops.md](api-004.md#source-eeaa259c323fdf65) + +- `TabStop` — An individual tab stop applying to a paragraph or style. +- `TabStops` — A sequence of `TabStop` objects providing access to the tab stops of a paragraph + +## `docx.types` + +Abstract types used by `python-docx`. + +Full contract: [types.md](api-004.md#source-b2a7210fa4b39232) + +- `ProvidesStoryPart` — An object that provides access to the StoryPart. +- `ProvidesXmlPart` — An object that provides access to its XmlPart. + + + + + +# `docx.links` + +Create and retarget hyperlinks on existing text. + +## `add_hyperlink` + +```python +add_hyperlink(document: 'Document', span: 'Span', address: str) -> Hyperlink +``` + +Wrap `span`'s runs in a hyperlink pointing at `address`. + +Visible text stays; Word shows it in the Hyperlink character style, which this defines +when the document lacks it. Refuses a protected document, a stale or foreign span, a span +crossing paragraphs, a field result, an existing hyperlink, and a data-bound, locked or +plain-text control surface. + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `require_span_owner` + +```python +require_span_owner(document: 'Document', span: 'Span', *, argument: str = 'span') -> None +``` + +Refuse a live span captured from a different document package. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.notes` + +Create footnotes and endnotes, including the note body and the mark. + +## `add_endnote` + +```python +add_endnote(document: 'Document', span: 'Span', text: str) -> int +``` + +Attach an endnote to `span` and return its note id. + +Creates the endnotes part on first use. Same refusals as `add_footnote`: protection, a +stale or foreign span, a span outside the main body, and one inside a text box, a field +result, or a data-bound, locked or plain-text control. + +## `add_footnote` + +```python +add_footnote(document: 'Document', span: 'Span', text: str) -> int +``` + +Attach a footnote to `span` and return its note id. + +Creates the footnotes part on first use. Refuses a protected document, a stale or foreign +span, a span outside the main body, and one inside a text box, a field result, or a +data-bound, locked or plain-text control. + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `require_span_owner` + +```python +require_span_owner(document: 'Document', span: 'Span', *, argument: str = 'span') -> None +``` + +Refuse a live span captured from a different document package. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.numbering` + +Numbering enumeration, application, and minimal authoring (paper-docx). + +## `NumberedParagraph` + +```python +NumberedParagraph(story: str, index: int, num_id: int, level: int, text: str, table_cell: 'Optional[Tuple[int, int, int]]' = None) -> None +``` + +### `index` + +```python +index: int +``` + +### `level` + +```python +level: int +``` + +### `num_id` + +```python +num_id: int +``` + +### `story` + +```python +story: str +``` + +### `table_cell` + +```python +table_cell: 'Optional[Tuple[int, int, int]]' = None +``` + +### `text` + +```python +text: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `NumberingDefinition` + +```python +NumberingDefinition(num_id: int, abstract_num_id: int, levels: Tuple[NumberingLevel, ...]) -> None +``` + +### `abstract_num_id` + +```python +abstract_num_id: int +``` + +### `levels` + +```python +levels: Tuple[NumberingLevel, ...] +``` + +### `num_id` + +```python +num_id: int +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `NumberingLevel` + +```python +NumberingLevel(level: int, num_fmt: Optional[str], lvl_text: Optional[str]) -> None +``` + +### `level` + +```python +level: int +``` + +### `lvl_text` + +```python +lvl_text: Optional[str] +``` + +### `num_fmt` + +```python +num_fmt: Optional[str] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `NumberingReport` + +```python +NumberingReport(definitions: Tuple[NumberingDefinition, ...], numbered_paragraphs: Tuple[NumberedParagraph, ...]) -> None +``` + +### `definitions` + +```python +definitions: Tuple[NumberingDefinition, ...] +``` + +### `numbered_paragraphs` + +```python +numbered_paragraphs: Tuple[NumberedParagraph, ...] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `apply_list_style` + +```python +apply_list_style(paragraph: 'Paragraph', style_name: str) -> None +``` + +Apply the existing paragraph style `style_name` to `paragraph`. + +Refuses a protected document, a style the document does not define, and a style whose +numbering binding does not resolve. + +## `apply_numbering` + +```python +apply_numbering(paragraph: 'Paragraph', *, num_id: int, level: int = 0) -> None +``` + +Give `paragraph` the existing numbering definition `num_id` at `level`. + +Writes `w:numPr` into the paragraph's `w:pPr`. This never fabricates a definition; create +one deliberately with `ensure_bullet_definition` or `ensure_decimal_definition`. Refuses a +protected document, and a numId or level the document does not define. + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `ensure_bullet_definition` + +```python +ensure_bullet_definition(document: 'Document') -> int +``` + +The numId of a canonical bullet-list definition, creating it when absent. + +Creates `/word/numbering.xml` and its relationship on first use. Reuse requires an exactly +canonical definition, so a hand-edited one of the same name is left alone and a new +definition is appended. Refuses a protected document. + +## `ensure_decimal_definition` + +```python +ensure_decimal_definition(document: 'Document') -> int +``` + +The numId of a canonical decimal-list definition, creating it when absent. + +Same creation and exact-shape reuse rules as `ensure_bullet_definition`. Refuses a +protected document. + +## `list_numbering` + +```python +list_numbering(document: 'Document') -> NumberingReport +``` + +Every numbering definition and every numbered paragraph in `document`. + +Walks all story parts and reports text in the "current" view. Refuses when a paragraph +resolves to a definition the document does not define, or to a level that definition +omits. + +## `restart_numbering` + +```python +restart_numbering(document: 'Document', *, num_id: int) -> int +``` + +A NEW numId continuing `num_id`'s formatting but restarting the count at 1. + +Paragraphs are not re-pointed; re-point them yourself with `apply_numbering`. Refuses a +protected document, an unknown numId, a malformed `w:numId`, and a definition carrying +`w:lvlOverride`. + + + + + +# `docx.opc.constants` + +Constant values related to the Open Packaging Convention. + +## `CONTENT_TYPE` + +Content type URIs (like MIME-types) that specify a part's format. + +### `BMP` + +```python +BMP = 'image/bmp' +``` + +### `DML_CHART` + +```python +DML_CHART = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml' +``` + +### `DML_CHARTSHAPES` + +```python +DML_CHARTSHAPES = 'application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml' +``` + +### `DML_DIAGRAM_COLORS` + +```python +DML_DIAGRAM_COLORS = 'application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml' +``` + +### `DML_DIAGRAM_DATA` + +```python +DML_DIAGRAM_DATA = 'application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml' +``` + +### `DML_DIAGRAM_LAYOUT` + +```python +DML_DIAGRAM_LAYOUT = 'application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml' +``` + +### `DML_DIAGRAM_STYLE` + +```python +DML_DIAGRAM_STYLE = 'application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml' +``` + +### `GIF` + +```python +GIF = 'image/gif' +``` + +### `JPEG` + +```python +JPEG = 'image/jpeg' +``` + +### `MS_PHOTO` + +```python +MS_PHOTO = 'image/vnd.ms-photo' +``` + +### `OFC_CUSTOM_PROPERTIES` + +```python +OFC_CUSTOM_PROPERTIES = 'application/vnd.openxmlformats-officedocument.custom-properties+xml' +``` + +### `OFC_CUSTOM_XML_PROPERTIES` + +```python +OFC_CUSTOM_XML_PROPERTIES = 'application/vnd.openxmlformats-officedocument.customXmlProperties+xml' +``` + +### `OFC_DRAWING` + +```python +OFC_DRAWING = 'application/vnd.openxmlformats-officedocument.drawing+xml' +``` + +### `OFC_EXTENDED_PROPERTIES` + +```python +OFC_EXTENDED_PROPERTIES = 'application/vnd.openxmlformats-officedocument.extended-properties+xml' +``` + +### `OFC_OLE_OBJECT` + +```python +OFC_OLE_OBJECT = 'application/vnd.openxmlformats-officedocument.oleObject' +``` + +### `OFC_PACKAGE` + +```python +OFC_PACKAGE = 'application/vnd.openxmlformats-officedocument.package' +``` + +### `OFC_THEME` + +```python +OFC_THEME = 'application/vnd.openxmlformats-officedocument.theme+xml' +``` + +### `OFC_THEME_OVERRIDE` + +```python +OFC_THEME_OVERRIDE = 'application/vnd.openxmlformats-officedocument.themeOverride+xml' +``` + +### `OFC_VML_DRAWING` + +```python +OFC_VML_DRAWING = 'application/vnd.openxmlformats-officedocument.vmlDrawing' +``` + +### `OPC_CORE_PROPERTIES` + +```python +OPC_CORE_PROPERTIES = 'application/vnd.openxmlformats-package.core-properties+xml' +``` + +### `OPC_DIGITAL_SIGNATURE_CERTIFICATE` + +```python +OPC_DIGITAL_SIGNATURE_CERTIFICATE = 'application/vnd.openxmlformats-package.digital-signature-certificate' +``` + +### `OPC_DIGITAL_SIGNATURE_ORIGIN` + +```python +OPC_DIGITAL_SIGNATURE_ORIGIN = 'application/vnd.openxmlformats-package.digital-signature-origin' +``` + +### `OPC_DIGITAL_SIGNATURE_XMLSIGNATURE` + +```python +OPC_DIGITAL_SIGNATURE_XMLSIGNATURE = 'application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml' +``` + +### `OPC_RELATIONSHIPS` + +```python +OPC_RELATIONSHIPS = 'application/vnd.openxmlformats-package.relationships+xml' +``` + +### `PML_COMMENTS` + +```python +PML_COMMENTS = 'application/vnd.openxmlformats-officedocument.presentationml.comments+xml' +``` + +### `PML_COMMENT_AUTHORS` + +```python +PML_COMMENT_AUTHORS = 'application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml' +``` + +### `PML_HANDOUT_MASTER` + +```python +PML_HANDOUT_MASTER = 'application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml' +``` + +### `PML_NOTES_MASTER` + +```python +PML_NOTES_MASTER = 'application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml' +``` + +### `PML_NOTES_SLIDE` + +```python +PML_NOTES_SLIDE = 'application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml' +``` + +### `PML_PRESENTATION_MAIN` + +```python +PML_PRESENTATION_MAIN = 'application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml' +``` + +### `PML_PRES_PROPS` + +```python +PML_PRES_PROPS = 'application/vnd.openxmlformats-officedocument.presentationml.presProps+xml' +``` + +### `PML_PRINTER_SETTINGS` + +```python +PML_PRINTER_SETTINGS = 'application/vnd.openxmlformats-officedocument.presentationml.printerSettings' +``` + +### `PML_SLIDE` + +```python +PML_SLIDE = 'application/vnd.openxmlformats-officedocument.presentationml.slide+xml' +``` + +### `PML_SLIDESHOW_MAIN` + +```python +PML_SLIDESHOW_MAIN = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml' +``` + +### `PML_SLIDE_LAYOUT` + +```python +PML_SLIDE_LAYOUT = 'application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml' +``` + +### `PML_SLIDE_MASTER` + +```python +PML_SLIDE_MASTER = 'application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml' +``` + +### `PML_SLIDE_UPDATE_INFO` + +```python +PML_SLIDE_UPDATE_INFO = 'application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml' +``` + +### `PML_TABLE_STYLES` + +```python +PML_TABLE_STYLES = 'application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml' +``` + +### `PML_TAGS` + +```python +PML_TAGS = 'application/vnd.openxmlformats-officedocument.presentationml.tags+xml' +``` + +### `PML_TEMPLATE_MAIN` + +```python +PML_TEMPLATE_MAIN = 'application/vnd.openxmlformats-officedocument.presentationml.template.main+xml' +``` + +### `PML_VIEW_PROPS` + +```python +PML_VIEW_PROPS = 'application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml' +``` + +### `PNG` + +```python +PNG = 'image/png' +``` + +### `SML_CALC_CHAIN` + +```python +SML_CALC_CHAIN = 'application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml' +``` + +### `SML_CHARTSHEET` + +```python +SML_CHARTSHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml' +``` + +### `SML_COMMENTS` + +```python +SML_COMMENTS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml' +``` + +### `SML_CONNECTIONS` + +```python +SML_CONNECTIONS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml' +``` + +### `SML_CUSTOM_PROPERTY` + +```python +SML_CUSTOM_PROPERTY = 'application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty' +``` + +### `SML_DIALOGSHEET` + +```python +SML_DIALOGSHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml' +``` + +### `SML_EXTERNAL_LINK` + +```python +SML_EXTERNAL_LINK = 'application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml' +``` + +### `SML_PIVOT_CACHE_DEFINITION` + +```python +SML_PIVOT_CACHE_DEFINITION = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml' +``` + +### `SML_PIVOT_CACHE_RECORDS` + +```python +SML_PIVOT_CACHE_RECORDS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml' +``` + +### `SML_PIVOT_TABLE` + +```python +SML_PIVOT_TABLE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml' +``` + +### `SML_PRINTER_SETTINGS` + +```python +SML_PRINTER_SETTINGS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings' +``` + +### `SML_QUERY_TABLE` + +```python +SML_QUERY_TABLE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml' +``` + +### `SML_REVISION_HEADERS` + +```python +SML_REVISION_HEADERS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml' +``` + +### `SML_REVISION_LOG` + +```python +SML_REVISION_LOG = 'application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml' +``` + +### `SML_SHARED_STRINGS` + +```python +SML_SHARED_STRINGS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml' +``` + +### `SML_SHEET` + +```python +SML_SHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' +``` + +### `SML_SHEET_MAIN` + +```python +SML_SHEET_MAIN = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml' +``` + +### `SML_SHEET_METADATA` + +```python +SML_SHEET_METADATA = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml' +``` + +### `SML_STYLES` + +```python +SML_STYLES = 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml' +``` + +### `SML_TABLE` + +```python +SML_TABLE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml' +``` + +### `SML_TABLE_SINGLE_CELLS` + +```python +SML_TABLE_SINGLE_CELLS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml' +``` + +### `SML_TEMPLATE_MAIN` + +```python +SML_TEMPLATE_MAIN = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml' +``` + +### `SML_USER_NAMES` + +```python +SML_USER_NAMES = 'application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml' +``` + +### `SML_VOLATILE_DEPENDENCIES` + +```python +SML_VOLATILE_DEPENDENCIES = 'application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml' +``` + +### `SML_WORKSHEET` + +```python +SML_WORKSHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml' +``` + +### `TIFF` + +```python +TIFF = 'image/tiff' +``` + +### `WML_COMMENTS` + +```python +WML_COMMENTS = 'application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml' +``` + +### `WML_DOCUMENT` + +```python +WML_DOCUMENT = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' +``` + +### `WML_DOCUMENT_GLOSSARY` + +```python +WML_DOCUMENT_GLOSSARY = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml' +``` + +### `WML_DOCUMENT_MAIN` + +```python +WML_DOCUMENT_MAIN = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml' +``` + +### `WML_ENDNOTES` + +```python +WML_ENDNOTES = 'application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml' +``` + +### `WML_FONT_TABLE` + +```python +WML_FONT_TABLE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml' +``` + +### `WML_FOOTER` + +```python +WML_FOOTER = 'application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml' +``` + +### `WML_FOOTNOTES` + +```python +WML_FOOTNOTES = 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml' +``` + +### `WML_HEADER` + +```python +WML_HEADER = 'application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml' +``` + +### `WML_NUMBERING` + +```python +WML_NUMBERING = 'application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml' +``` + +### `WML_PRINTER_SETTINGS` + +```python +WML_PRINTER_SETTINGS = 'application/vnd.openxmlformats-officedocument.wordprocessingml.printerSettings' +``` + +### `WML_SETTINGS` + +```python +WML_SETTINGS = 'application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml' +``` + +### `WML_STYLES` + +```python +WML_STYLES = 'application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml' +``` + +### `WML_WEB_SETTINGS` + +```python +WML_WEB_SETTINGS = 'application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml' +``` + +### `XML` + +```python +XML = 'application/xml' +``` + +### `X_EMF` + +```python +X_EMF = 'image/x-emf' +``` + +### `X_FONTDATA` + +```python +X_FONTDATA = 'application/x-fontdata' +``` + +### `X_FONT_TTF` + +```python +X_FONT_TTF = 'application/x-font-ttf' +``` + +### `X_WMF` + +```python +X_WMF = 'image/x-wmf' +``` + +## `NAMESPACE` + +Constant values for OPC XML namespaces. + +### `DML_WORDPROCESSING_DRAWING` + +```python +DML_WORDPROCESSING_DRAWING = 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing' +``` + +### `OFC_RELATIONSHIPS` + +```python +OFC_RELATIONSHIPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships' +``` + +### `OPC_CONTENT_TYPES` + +```python +OPC_CONTENT_TYPES = 'http://schemas.openxmlformats.org/package/2006/content-types' +``` + +### `OPC_RELATIONSHIPS` + +```python +OPC_RELATIONSHIPS = 'http://schemas.openxmlformats.org/package/2006/relationships' +``` + +### `WML_MAIN` + +```python +WML_MAIN = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main' +``` + +## `RELATIONSHIP_TARGET_MODE` + +Open XML relationship target modes. + +### `EXTERNAL` + +```python +EXTERNAL = 'External' +``` + +### `INTERNAL` + +```python +INTERNAL = 'Internal' +``` + +## `RELATIONSHIP_TYPE` + +### `AUDIO` + +```python +AUDIO = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio' +``` + +### `A_F_CHUNK` + +```python +A_F_CHUNK = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk' +``` + +### `CALC_CHAIN` + +```python +CALC_CHAIN = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain' +``` + +### `CERTIFICATE` + +```python +CERTIFICATE = 'http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/certificate' +``` + +### `CHART` + +```python +CHART = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart' +``` + +### `CHARTSHEET` + +```python +CHARTSHEET = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet' +``` + +### `CHART_USER_SHAPES` + +```python +CHART_USER_SHAPES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes' +``` + +### `COMMENTS` + +```python +COMMENTS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments' +``` + +### `COMMENT_AUTHORS` + +```python +COMMENT_AUTHORS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors' +``` + +### `CONNECTIONS` + +```python +CONNECTIONS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections' +``` + +### `CONTROL` + +```python +CONTROL = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/control' +``` + +### `CORE_PROPERTIES` + +```python +CORE_PROPERTIES = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties' +``` + +### `CUSTOM_PROPERTIES` + +```python +CUSTOM_PROPERTIES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties' +``` + +### `CUSTOM_PROPERTY` + +```python +CUSTOM_PROPERTY = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/customProperty' +``` + +### `CUSTOM_XML` + +```python +CUSTOM_XML = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml' +``` + +### `CUSTOM_XML_PROPS` + +```python +CUSTOM_XML_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps' +``` + +### `DIAGRAM_COLORS` + +```python +DIAGRAM_COLORS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors' +``` + +### `DIAGRAM_DATA` + +```python +DIAGRAM_DATA = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData' +``` + +### `DIAGRAM_LAYOUT` + +```python +DIAGRAM_LAYOUT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout' +``` + +### `DIAGRAM_QUICK_STYLE` + +```python +DIAGRAM_QUICK_STYLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle' +``` + +### `DIALOGSHEET` + +```python +DIALOGSHEET = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet' +``` + +### `DRAWING` + +```python +DRAWING = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing' +``` + +### `ENDNOTES` + +```python +ENDNOTES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes' +``` + +### `EXTENDED_PROPERTIES` + +```python +EXTENDED_PROPERTIES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties' +``` + +### `EXTERNAL_LINK` + +```python +EXTERNAL_LINK = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink' +``` + +### `FONT` + +```python +FONT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/font' +``` + +### `FONT_TABLE` + +```python +FONT_TABLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable' +``` + +### `FOOTER` + +```python +FOOTER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer' +``` + +### `FOOTNOTES` + +```python +FOOTNOTES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes' +``` + +### `GLOSSARY_DOCUMENT` + +```python +GLOSSARY_DOCUMENT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument' +``` + +### `HANDOUT_MASTER` + +```python +HANDOUT_MASTER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/handoutMaster' +``` + +### `HEADER` + +```python +HEADER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/header' +``` + +### `HYPERLINK` + +```python +HYPERLINK = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink' +``` + +### `IMAGE` + +```python +IMAGE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image' +``` + +### `NOTES_MASTER` + +```python +NOTES_MASTER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster' +``` + +### `NOTES_SLIDE` + +```python +NOTES_SLIDE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide' +``` + +### `NUMBERING` + +```python +NUMBERING = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering' +``` + +### `OFFICE_DOCUMENT` + +```python +OFFICE_DOCUMENT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument' +``` + +### `OLE_OBJECT` + +```python +OLE_OBJECT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject' +``` + +### `ORIGIN` + +```python +ORIGIN = 'http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin' +``` + +### `PACKAGE` + +```python +PACKAGE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/package' +``` + +### `PIVOT_CACHE_DEFINITION` + +```python +PIVOT_CACHE_DEFINITION = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition' +``` + +### `PIVOT_CACHE_RECORDS` + +```python +PIVOT_CACHE_RECORDS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/spreadsheetml/pivotCacheRecords' +``` + +### `PIVOT_TABLE` + +```python +PIVOT_TABLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable' +``` + +### `PRES_PROPS` + +```python +PRES_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps' +``` + +### `PRINTER_SETTINGS` + +```python +PRINTER_SETTINGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings' +``` + +### `QUERY_TABLE` + +```python +QUERY_TABLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/queryTable' +``` + +### `REVISION_HEADERS` + +```python +REVISION_HEADERS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionHeaders' +``` + +### `REVISION_LOG` + +```python +REVISION_LOG = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionLog' +``` + +### `SETTINGS` + +```python +SETTINGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings' +``` + +### `SHARED_STRINGS` + +```python +SHARED_STRINGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings' +``` + +### `SHEET_METADATA` + +```python +SHEET_METADATA = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata' +``` + +### `SIGNATURE` + +```python +SIGNATURE = 'http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/signature' +``` + +### `SLIDE` + +```python +SLIDE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide' +``` + +### `SLIDE_LAYOUT` + +```python +SLIDE_LAYOUT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout' +``` + +### `SLIDE_MASTER` + +```python +SLIDE_MASTER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster' +``` + +### `SLIDE_UPDATE_INFO` + +```python +SLIDE_UPDATE_INFO = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideUpdateInfo' +``` + +### `STYLES` + +```python +STYLES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles' +``` + +### `TABLE` + +```python +TABLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/table' +``` + +### `TABLE_SINGLE_CELLS` + +```python +TABLE_SINGLE_CELLS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableSingleCells' +``` + +### `TABLE_STYLES` + +```python +TABLE_STYLES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles' +``` + +### `TAGS` + +```python +TAGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/tags' +``` + +### `THEME` + +```python +THEME = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme' +``` + +### `THEME_OVERRIDE` + +```python +THEME_OVERRIDE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/themeOverride' +``` + +### `THUMBNAIL` + +```python +THUMBNAIL = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail' +``` + +### `USERNAMES` + +```python +USERNAMES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/usernames' +``` + +### `VIDEO` + +```python +VIDEO = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/video' +``` + +### `VIEW_PROPS` + +```python +VIEW_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps' +``` + +### `VML_DRAWING` + +```python +VML_DRAWING = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing' +``` + +### `VOLATILE_DEPENDENCIES` + +```python +VOLATILE_DEPENDENCIES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/volatileDependencies' +``` + +### `WEB_SETTINGS` + +```python +WEB_SETTINGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings' +``` + +### `WORKSHEET_SOURCE` + +```python +WORKSHEET_SOURCE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheetSource' +``` + +### `XML_MAPS` + +```python +XML_MAPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/xmlMaps' +``` + + + + + +# `docx.opc.coreprops` + +Provides CoreProperties, Dublin-Core attributes of the document. + +## `CoreProperties` + +```python +CoreProperties(element: CT_CoreProperties) +``` + +Corresponds to part named ``/docProps/core.xml``, containing the core document +properties for this document package. + +### `author` + +```python +author +``` + +### `category` + +```python +category +``` + +### `comments` + +```python +comments +``` + +### `content_status` + +```python +content_status +``` + +### `created` + +```python +created +``` + +### `identifier` + +```python +identifier +``` + +### `keywords` + +```python +keywords +``` + +### `language` + +```python +language +``` + +### `last_modified_by` + +```python +last_modified_by +``` + +### `last_printed` + +```python +last_printed +``` + +### `modified` + +```python +modified +``` + +### `revision` + +```python +revision +``` + +### `subject` + +```python +subject +``` + +### `title` + +```python +title +``` + +### `version` + +```python +version +``` + + + + + +# `docx.opc.exceptions` + +Exceptions specific to python-opc. + +## `OpcError` + +Bases: `Exception` + +Base error class for python-opc. + +## `PackageNotFoundError` + +Bases: `OpcError` + +Raised when a package cannot be found at the specified path. + + + + + +# `docx.opc.oxml` + +Temporary stand-in for main oxml module. + +## `BaseOxmlElement` + +Bases: `ElementBase` + +Base class for all custom element classes, to add standardized behavior to all +classes in one place. + +### `xml` + +```python +xml: str +``` + +Return XML string for this element, suitable for testing purposes. + +Pretty printed for readability and without an XML declaration at the top. + +## `CT_Default` + +Bases: `BaseOxmlElement` + +`` element that appears in `[Content_Types].xml` part. + +Used to specify a default content type to be applied to any part with the specified extension. + +### `content_type` + +```python +content_type +``` + +String held in the ``ContentType`` attribute of this ```` +element. + +### `extension` + +```python +extension +``` + +String held in the ``Extension`` attribute of this ```` element. + +### `new` + +```python +new(ext: str, content_type: str) +``` + +Return a new ```` element with attributes set to parameter values. + +## `CT_Override` + +Bases: `BaseOxmlElement` + +```` element, specifying the content type to be applied for a part with +the specified partname. + +### `content_type` + +```python +content_type +``` + +String held in the ``ContentType`` attribute of this ```` +element. + +### `new` + +```python +new(partname, content_type) +``` + +Return a new ```` element with attributes set to parameter values. + +### `partname` + +```python +partname +``` + +String held in the ``PartName`` attribute of this ```` element. + +## `CT_Relationship` + +Bases: `BaseOxmlElement` + +`` element, representing a single relationship from source to target part. + +### `new` + +```python +new(rId: str, reltype: str, target: str, target_mode: str = RTM.INTERNAL) +``` + +Return a new ```` element. + +### `rId` + +```python +rId +``` + +String held in the ``Id`` attribute of this ```` element. + +### `reltype` + +```python +reltype +``` + +String held in the ``Type`` attribute of this ```` element. + +### `target_mode` + +```python +target_mode +``` + +String held in the ``TargetMode`` attribute of this ```` +element, either ``Internal`` or ``External``. + +Defaults to ``Internal``. + +### `target_ref` + +```python +target_ref +``` + +String held in the ``Target`` attribute of this ```` +element. + +## `CT_Relationships` + +Bases: `BaseOxmlElement` + +```` element, the root element in a .rels file. + +### `Relationship_lst` + +```python +Relationship_lst +``` + +Return a list containing all the ```` child elements. + +### `add_rel` + +```python +add_rel(rId: str, reltype: str, target: str, is_external: bool = False) +``` + +Add a child ```` element with attributes set according to +parameter values. + +### `new` + +```python +new() -> CT_Relationships +``` + +Return a new ```` element. + +### `xml` + +```python +xml +``` + +Return XML string for this element, suitable for saving in a .rels stream, +not pretty printed and with an XML declaration at the top. + +## `CT_Types` + +Bases: `BaseOxmlElement` + +```` element, the container element for Default and Override elements in +[Content_Types].xml. + +### `add_default` + +```python +add_default(ext, content_type) +``` + +Add a child ```` element with attributes set to parameter values. + +### `add_override` + +```python +add_override(partname, content_type) +``` + +Add a child ```` element with attributes set to parameter +values. + +### `defaults` + +```python +defaults +``` + +### `new` + +```python +new() +``` + +Return a new ```` element. + +### `overrides` + +```python +overrides +``` + +## `ct_namespace` + +```python +ct_namespace = element_class_lookup.get_namespace(nsmap['ct']) +``` + +## `element_class_lookup` + +```python +element_class_lookup = etree.ElementNamespaceClassLookup() +``` + +## `nsmap` + +```python +nsmap = {'ct': NS.OPC_CONTENT_TYPES, 'pr': NS.OPC_RELATIONSHIPS, 'r': NS.OFC_RELATIONSHIPS} +``` + +## `oxml_parser` + +```python +oxml_parser = etree.XMLParser(remove_blank_text=True, resolve_entities=False) +``` + +## `parse_xml` + +```python +parse_xml(text: str) -> etree._Element +``` + +`etree.fromstring()` replacement that uses oxml parser. + +## `pr_namespace` + +```python +pr_namespace = element_class_lookup.get_namespace(nsmap['pr']) +``` + +## `qn` + +```python +qn(tag: str) -> str +``` + +Stands for "qualified name", a utility function to turn a namespace prefixed tag +name into a Clark-notation qualified tag name for lxml. + +For +example, ``qn('p:cSld')`` returns ``'{http://schemas.../main}cSld'``. + +## `serialize_for_reading` + +```python +serialize_for_reading(element: etree._Element) -> str +``` + +Serialize `element` to human-readable XML suitable for tests. + +No XML declaration. + +## `serialize_part_xml` + +```python +serialize_part_xml(part_elm: etree._Element) -> bytes +``` + +Serialize `part_elm` etree element to XML suitable for storage as an XML part. + +That is to say, no insignificant whitespace added for readability, and an +appropriate XML declaration added with UTF-8 encoding specified. + + + + + +# `docx.opc.package` + +Objects that implement reading and writing OPC packages. + +## `OpcPackage` + +Main API class for `python-opc`. + +A new instance is constructed by calling the `open` class method with a path +to a package file or file-like object containing one. + +### `after_unmarshal` + +```python +after_unmarshal() +``` + +Entry point for any post-unmarshaling processing. + +May be overridden by subclasses without forwarding call to super. + +### `core_properties` + +```python +core_properties: CoreProperties +``` + +`CoreProperties` object providing read/write access to the Dublin Core +properties for this document. + +### `iter_parts` + +```python +iter_parts() -> Iterator[Part] +``` + +Generate exactly one reference to each of the parts in the package by +performing a depth-first traversal of the rels graph. + +### `iter_rels` + +```python +iter_rels() -> Iterator[_Relationship] +``` + +Generate exactly one reference to each relationship in the package by +performing a depth-first traversal of the rels graph. + +### `load_rel` + +```python +load_rel(reltype: str, target: Part | str, rId: str, is_external: bool = False) +``` + +Return newly added `_Relationship` instance of `reltype` between this part +and `target` with key `rId`. + +Target mode is set to ``RTM.EXTERNAL`` if `is_external` is `True`. Intended for +use during load from a serialized package, where the rId is well known. Other +methods exist for adding a new relationship to the package during processing. + +### `main_document_part` + +```python +main_document_part +``` + +Return a reference to the main document part for this package. + +Examples include a document part for a WordprocessingML package, a presentation +part for a PresentationML package, or a workbook part for a SpreadsheetML +package. + +### `next_partname` + +```python +next_partname(template: str) -> PackURI +``` + +Return a `PackURI` instance representing partname matching `template`. + +The returned part-name has the next available numeric suffix to distinguish it +from other parts of its type. `template` is a printf (%)-style template string +containing a single replacement item, a '%d' to be used to insert the integer +portion of the partname. Example: "/word/header%d.xml" + +### `open` + +```python +open(pkg_file: str | IO[bytes]) -> Self +``` + +Return an `OpcPackage` instance loaded with the contents of `pkg_file`. + +### `part_related_by` + +```python +part_related_by(reltype: str) -> Part +``` + +Return part to which this package has a relationship of `reltype`. + +Raises `KeyError` if no such relationship is found and `ValueError` if more than +one such relationship is found. + +### `parts` + +```python +parts: list[Part] +``` + +Return a list containing a reference to each of the parts in this package. + +### `relate_to` + +```python +relate_to(part: Part, reltype: str) +``` + +Return rId key of new or existing relationship to `part`. + +If a relationship of `reltype` to `part` already exists, its rId is returned. Otherwise a +new relationship is created and that rId is returned. + +### `rels` + +```python +rels() +``` + +Return a reference to the `Relationships` instance holding the collection of +relationships for this package. + +### `save` + +```python +save(pkg_file: str | IO[bytes]) +``` + +Save this package to `pkg_file`, a path or a stream positioned at byte zero. + +Serializes to a sibling temp file, reparses it to confirm it opens, then replaces the +destination. A failed save leaves the original untouched and never leaves behind a +package Word cannot open. An existing destination keeps its permission bits. A symlink +destination is followed and its target replaced. + +Raises `MalformedPackageError` when the serialized output will not reparse, and +`OSError` for a stream in append mode, a stream positioned past byte zero, or a +destination symlink that moves mid-save. + +## `Unmarshaller` + +Hosts static methods for unmarshalling a package from a `PackageReader`. + +### `unmarshal` + +```python +unmarshal(pkg_reader, package, part_factory) +``` + +Construct graph of parts and realized relationships based on the contents of +`pkg_reader`, delegating construction of each part to `part_factory`. + +Package relationships are added to `pkg`. + + + + + +# `docx.opc.packuri` + +Provides the PackURI value type. + +## `CONTENT_TYPES_URI` + +```python +CONTENT_TYPES_URI = PackURI('/[Content_Types].xml') +``` + +## `PACKAGE_URI` + +```python +PACKAGE_URI = PackURI('/') +``` + +## `PackURI` + +Bases: `str` + +Provides access to pack URI components such as the baseURI and the filename slice. + +Behaves as `str` otherwise. + +### `baseURI` + +```python +baseURI: str +``` + +The base URI of this pack URI, the directory portion, roughly speaking. + +E.g. ``'/ppt/slides'`` for ``'/ppt/slides/slide1.xml'``. For the package pseudo- +partname '/', baseURI is '/'. + +### `ext` + +```python +ext: str +``` + +The extension portion of this pack URI, e.g. ``'xml'`` for ``'/word/document.xml'``. + +Note the period is not included. + +### `filename` + +```python +filename +``` + +The "filename" portion of this pack URI, e.g. ``'slide1.xml'`` for +``'/ppt/slides/slide1.xml'``. + +For the package pseudo-partname '/', filename is ''. + +### `from_rel_ref` + +```python +from_rel_ref(baseURI: str, relative_ref: str) -> PackURI +``` + +The absolute PackURI formed by translating `relative_ref` onto `baseURI`. + +### `idx` + +```python +idx +``` + +Return partname index as integer for tuple partname or None for singleton +partname, e.g. ``21`` for ``'/ppt/slides/slide21.xml'`` and `None` for +``'/ppt/presentation.xml'``. + +### `membername` + +```python +membername +``` + +The pack URI with the leading slash stripped off, the form used as the Zip +file membername for the package item. + +Returns '' for the package pseudo-partname '/'. + +### `relative_ref` + +```python +relative_ref(baseURI: str) +``` + +Return string containing relative reference to package item from `baseURI`. + +E.g. PackURI('/ppt/slideLayouts/slideLayout1.xml') would return +'../slideLayouts/slideLayout1.xml' for baseURI '/ppt/slides'. + +### `rels_uri` + +```python +rels_uri +``` + +The pack URI of the .rels part corresponding to the current pack URI. + +Only produces sensible output if the pack URI is a partname or the package +pseudo-partname '/'. + + + + + +# `docx.opc.part` + +Open Packaging Convention (OPC) objects related to package parts. + +## `Part` + +```python +Part(partname: PackURI, content_type: str, blob: bytes | None = None, package: Package | None = None) +``` + +Base class for package parts. + +Provides common properties and methods, but intended to be subclassed in client code +to implement specific part behaviors. + +### `after_unmarshal` + +```python +after_unmarshal() +``` + +Entry point for post-unmarshaling processing, for example to parse the part +XML. + +May be overridden by subclasses without forwarding call to super. + +### `before_marshal` + +```python +before_marshal() +``` + +Entry point for pre-serialization processing, for example to finalize part +naming if necessary. + +May be overridden by subclasses without forwarding call to super. + +### `blob` + +```python +blob: bytes +``` + +Contents of this package part as a sequence of bytes. + +May be text or binary. Intended to be overridden by subclasses. Default behavior +is to return load blob. + +### `content_type` + +```python +content_type +``` + +Content type of this part. + +### `drop_rel` + +```python +drop_rel(rId: str) +``` + +Remove the relationship identified by `rId` if its reference count is less +than 2. + +Relationships with a reference count of 0 are implicit relationships. + +### `load` + +```python +load(partname: PackURI, content_type: str, blob: bytes, package: Package) +``` + +### `load_rel` + +```python +load_rel(reltype: str, target: Part | str, rId: str, is_external: bool = False) +``` + +Return newly added `_Relationship` instance of `reltype`. + +The new relationship relates the `target` part to this part with key `rId`. + +Target mode is set to ``RTM.EXTERNAL`` if `is_external` is `True`. Intended for +use during load from a serialized package, where the rId is well-known. Other +methods exist for adding a new relationship to a part when manipulating a part. + +### `package` + +```python +package +``` + +`OpcPackage` instance this part belongs to. + +### `part_related_by` + +```python +part_related_by(reltype: str) -> Part +``` + +Return part to which this part has a relationship of `reltype`. + +Raises `KeyError` if no such relationship is found and `ValueError` if more than +one such relationship is found. Provides ability to resolve implicitly related +part, such as Slide -> SlideLayout. + +### `partname` + +```python +partname +``` + +`PackURI` instance holding partname of this part, e.g. +'/ppt/slides/slide1.xml'. + +### `relate_to` + +```python +relate_to(target: Part | str, reltype: str, is_external: bool = False) -> str +``` + +Return rId key of relationship of `reltype` to `target`. + +The returned `rId` is from an existing relationship if there is one, otherwise a +new relationship is created. + +### `related_parts` + +```python +related_parts +``` + +Dictionary mapping related parts by rId, so child objects can resolve +explicit relationships present in the part XML, e.g. sldIdLst to a specific +`Slide` instance. + +### `rels` + +```python +rels() +``` + +`Relationships` instance holding the relationships for this part. + +### `target_ref` + +```python +target_ref(rId: str) -> str +``` + +Return URL contained in target ref of relationship identified by `rId`. + +## `PartFactory` + +Provides a way for client code to specify a subclass of `Part` to be constructed +by `Unmarshaller` based on its content type and/or a custom callable. + +Setting ``PartFactory.part_class_selector`` to a callable object will cause that +object to be called with the parameters ``content_type, reltype``, once for each +part in the package. If the callable returns an object, it is used as the class for +that part. If it returns `None`, part class selection falls back to the content type +map defined in ``PartFactory.part_type_for``. If no class is returned from either of +these, the class contained in ``PartFactory.default_part_type`` is used to construct +the part, which is by default ``opc.package.Part``. + +### `default_part_type` + +```python +default_part_type = Part +``` + +### `part_class_selector` + +```python +part_class_selector: Callable[[str, str], Type[Part] | None] | None +``` + +### `part_type_for` + +```python +part_type_for: dict[str, Type[Part]] = {} +``` + +## `XmlPart` + +```python +XmlPart(partname: PackURI, content_type: str, element: BaseOxmlElement, package: Package) +``` + +Bases: `Part` + +Base class for package parts containing an XML payload, which is most of them. + +Provides additional methods to the `Part` base class that take care of parsing and +reserializing the XML payload and managing relationships to other parts. + +### `blob` + +```python +blob +``` + +### `element` + +```python +element +``` + +The root XML element of this XML part. + +### `load` + +```python +load(partname: PackURI, content_type: str, blob: bytes, package: Package) +``` + +### `part` + +```python +part +``` + +Part of the parent protocol, "children" of the document will not know the +part that contains them so must ask their parent object. + +That chain of delegation ends here for child objects. + + + + + +# `docx.opc.parts.coreprops` + +Core properties part, corresponds to ``/docProps/core.xml`` part in package. + +## `CorePropertiesPart` + +Bases: `XmlPart` + +Corresponds to part named ``/docProps/core.xml``. + +The "core" is short for "Dublin Core" and contains document metadata relatively common across +documents of all types, not just DOCX. + +### `core_properties` + +```python +core_properties +``` + +A `CoreProperties` object providing read/write access to the core properties +contained in this core properties part. + +### `default` + +```python +default(package: OpcPackage) +``` + +Return a new `CorePropertiesPart` object initialized with default values for +its base properties. + + + + + +# `docx.opc.phys_pkg` + +Provides a general interface to a `physical` OPC package, such as a zip file. + +## `GuardedZipReader` + +```python +GuardedZipReader(zip_file: ZipFile) +``` + +Validate and stream every member of an already-open ``ZipFile``. + +Construction fully validates the archive and caches member bytes. +This makes ordinary ``Document()`` opens and package-kernel reads share the +same validation, including for members not reachable from OPC relationships. + +### `order` + +```python +order: Tuple[str, ...] +``` + +Member names in central-directory order. + +### `read` + +```python +read(name: str) -> bytes +``` + +Return validated bytes for member `name`. + +### `read_all` + +```python +read_all() -> Tuple[Dict[str, bytes], List[str]] +``` + +Return a copy of validated parts and their archive order. + +## `PhysPkgReader` + +Factory for physical package reader objects. + +## `PhysPkgWriter` + +Factory for physical package writer objects. + +## `preflight_zip` + +```python +preflight_zip(source: object) -> None +``` + +Validate central-directory metadata before ``ZipFile`` opens. + +This preflight reads only fixed-size records and skips variable fields +without retaining them. + + + + + +# `docx.opc.pkgreader` + +Low-level, read-only API to a serialized Open Packaging Convention (OPC) package. + +## `PackageReader` + +```python +PackageReader(content_types, pkg_srels, sparts) +``` + +Provides access to the contents of a zip-format OPC package via its +`serialized_parts` and `pkg_srels` attributes. + +### `from_file` + +```python +from_file(pkg_file) +``` + +A `PackageReader` loaded from `pkg_file`, with the package graph already validated. + +This is the read path behind `Document()`, so a malformed file is caught here rather +than carried into the object model. Raises `MalformedPackageError` for a corrupt or +ambiguous archive, a relationship targeting a missing part, a part with no declared +content type, or a content type that contradicts its relationship. + +### `iter_sparts` + +```python +iter_sparts() +``` + +Generate a 4-tuple `(partname, content_type, reltype, blob)` for each of the +serialized parts in the package. + +### `iter_srels` + +```python +iter_srels() +``` + +Generate a 2-tuple `(source_uri, srel)` for each of the relationships in the +package. + +## `content_type_matches` + +```python +content_type_matches(actual: str, expected: str) -> bool +``` + +## `is_relationship_type` + +```python +is_relationship_type(actual: str, expected: str) -> bool +``` + +## `is_xml_id` + +```python +is_xml_id(value: object) -> bool +``` + +Whether ``value`` has the XML Schema ID/NCName lexical form. + + + + + +# `docx.opc.pkgwriter` + +Provides low-level, write-only API to serialized (OPC) package. + +## `PackageWriter` + +Writes a zip-format OPC package to `pkg_file`, where `pkg_file` can be either a +path to a zip file (a string) or a file-like object. + +Its single API method, `write`, is static, so this class is not intended to be +instantiated. + +### `write` + +```python +write(pkg_file, pkg_rels, parts) +``` + +Write `parts` and `pkg_rels` to `pkg_file` as a .docx package, with a content-types +stream derived from the parts. + + + + + +# `docx.opc.rel` + +Relationship-related objects. + +## `Relationships` + +```python +Relationships(baseURI: str) +``` + +Bases: `Dict[str, '_Relationship']` + +Collection object for `_Relationship` instances, having list semantics. + +### `add_relationship` + +```python +add_relationship(reltype: str, target: Part | str, rId: str, is_external: bool = False) -> '_Relationship' +``` + +Return a newly added `_Relationship` instance. + +### `get_or_add` + +```python +get_or_add(reltype: str, target_part: Part) -> _Relationship +``` + +Return relationship of `reltype` to `target_part`, newly added if not already +present in collection. + +### `get_or_add_ext_rel` + +```python +get_or_add_ext_rel(reltype: str, target_ref: str) -> str +``` + +Return rId of external relationship of `reltype` to `target_ref`, newly added +if not already present in collection. + +### `part_with_reltype` + +```python +part_with_reltype(reltype: str) -> Part +``` + +Return target part of rel with matching `reltype`, raising `KeyError` if not +found and `ValueError` if more than one matching relationship is found. + +### `related_parts` + +```python +related_parts +``` + +Dict mapping rIds to target parts for all the internal relationships in the +collection. + +### `xml` + +```python +xml: str +``` + +Serialize this relationship collection into XML suitable for storage as a +.rels file in an OPC package. + + + + + +# `docx.opc.shared` + +Objects shared by opc modules. + +## `CaseInsensitiveDict` + +Bases: `Dict[str, Any]` + +Mapping type that behaves like dict except that it matches without respect to the +case of the key. + +E.g. cid['A'] == cid['a']. Note this is not general-purpose, just complete enough to +satisfy opc package needs. It assumes str keys, and that it is created empty; keys +passed in constructor are not accounted for + +## `cls_method_fn` + +```python +cls_method_fn(cls: type, method_name: str) +``` + +Return method of `cls` having `method_name`. + + + + + +# `docx.opc.spec` + +Provides mappings that embody aspects of the Open XML spec ISO/IEC 29500. + +## `default_content_types` + +```python +default_content_types = (('bin', CT.PML_PRINTER_SETTINGS), ('bin', CT.SML_PRINTER_SETTINGS), ('bin', CT.WML_PRINTER_SETTINGS), ('bmp', CT.BMP), ('emf', CT.X_EMF), ('fntdata', CT.X_FONTDATA), ('gif', CT.GIF), ('jpe', CT.JPEG), ('jpeg', CT.JPEG), ('jpg', CT.JPEG), ('png', CT.PNG), ('rels', CT.OPC_RELATIONSHIPS), ('tif', CT.TIFF), ('tiff', CT.TIFF), ('wdp', CT.MS_PHOTO), ('wmf', CT.X_WMF), ('xlsx', CT.SML_SHEET), ('xml', CT.XML)) +``` + + + + + +# `docx.oxml.comments` + +Custom element classes related to document comments. + +## `CT_Comment` + +Bases: `BaseOxmlElement` + +`w:comment` element, representing a single comment. + +A comment is a so-called "story" and can contain paragraphs and tables much like a table-cell. +While probably most often used for a single sentence or phrase, a comment can contain rich +content, including multiple rich-text paragraphs, hyperlinks, images, and tables. + +### `add_p` + +```python +add_p: Callable[[], CT_P] +``` + +### `author` + +```python +author: str = RequiredAttribute('w:author', ST_String) +``` + +### `date` + +```python +date: dt.datetime | None = OptionalAttribute('w:date', ST_DateTime) +``` + +### `id` + +```python +id: int = RequiredAttribute('w:id', ST_DecimalNumber) +``` + +### `initials` + +```python +initials: str | None = OptionalAttribute('w:initials', ST_String) +``` + +### `inner_content_elements` + +```python +inner_content_elements: list[CT_P | CT_Tbl] +``` + +Generate all `w:p` and `w:tbl` elements in this comment. + +### `p` + +```python +p = ZeroOrMore('w:p', successors=()) +``` + +### `p_lst` + +```python +p_lst: list[CT_P] +``` + +### `tbl` + +```python +tbl = ZeroOrMore('w:tbl', successors=()) +``` + +### `tbl_lst` + +```python +tbl_lst: list[CT_Tbl] +``` + +## `CT_Comments` + +Bases: `BaseOxmlElement` + +`w:comments` element, the root element for the comments part. + +Simply contains a collection of `w:comment` elements, each representing a single comment. Each +contained comment is identified by a unique `w:id` attribute, used to reference the comment +from the document text. The offset of the comment in this collection is arbitrary; it is +essentially a _set_ implemented as a list. + +### `add_comment` + +```python +add_comment() -> CT_Comment +``` + +Return newly added `w:comment` child of this `w:comments`. + +The returned `w:comment` element is the minimum valid value, having a `w:id` value unique +within the existing comments and the required `w:author` attribute present but set to the +empty string. It's content is limited to a single run containing the necessary annotation +reference but no text. Content is added by adding runs to this first paragraph and by +adding additional paragraphs as needed. + +### `comment` + +```python +comment = ZeroOrMore('w:comment') +``` + +### `comment_lst` + +```python +comment_lst: list[CT_Comment] +``` + +### `get_comment_by_id` + +```python +get_comment_by_id(comment_id: int) -> CT_Comment | None +``` + +Return the `w:comment` element identified by `comment_id`, or `None` if not found. + + + + + +# `docx.oxml.coreprops` + +Custom element classes for core properties-related XML elements. + +## `CT_CoreProperties` + +Bases: `BaseOxmlElement` + +`` 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` + +```python +author_text: str +``` + +The text in the `dc:creator` child element. + +### `category` + +```python +category = ZeroOrOne('cp:category', successors=()) +``` + +### `category_text` + +```python +category_text: str +``` + +### `comments_text` + +```python +comments_text: str +``` + +### `contentStatus` + +```python +contentStatus = ZeroOrOne('cp:contentStatus', successors=()) +``` + +### `contentStatus_text` + +```python +contentStatus_text: str +``` + +### `created` + +```python +created = ZeroOrOne('dcterms:created', successors=()) +``` + +### `created_datetime` + +```python +created_datetime: dt.datetime | None +``` + +### `creator` + +```python +creator = ZeroOrOne('dc:creator', successors=()) +``` + +### `description` + +```python +description = ZeroOrOne('dc:description', successors=()) +``` + +### `get_or_add_revision` + +```python +get_or_add_revision: Callable[[], etree_Element] +``` + +### `identifier` + +```python +identifier = ZeroOrOne('dc:identifier', successors=()) +``` + +### `identifier_text` + +```python +identifier_text: str +``` + +### `keywords` + +```python +keywords = ZeroOrOne('cp:keywords', successors=()) +``` + +### `keywords_text` + +```python +keywords_text: str +``` + +### `language` + +```python +language = ZeroOrOne('dc:language', successors=()) +``` + +### `language_text` + +```python +language_text: str +``` + +### `lastModifiedBy` + +```python +lastModifiedBy = ZeroOrOne('cp:lastModifiedBy', successors=()) +``` + +### `lastModifiedBy_text` + +```python +lastModifiedBy_text: str +``` + +### `lastPrinted` + +```python +lastPrinted = ZeroOrOne('cp:lastPrinted', successors=()) +``` + +### `lastPrinted_datetime` + +```python +lastPrinted_datetime: dt.datetime | None +``` + +### `modified` + +```python +modified = ZeroOrOne('dcterms:modified', successors=()) +``` + +### `modified_datetime` + +```python +modified_datetime: dt.datetime | None +``` + +### `new` + +```python +new() -> CT_CoreProperties +``` + +Return a new `` element. + +### `revision` + +```python +revision: etree_Element | None = ZeroOrOne('cp:revision', successors=()) +``` + +### `revision_number` + +```python +revision_number: int +``` + +Integer value of revision property. + +### `subject` + +```python +subject = ZeroOrOne('dc:subject', successors=()) +``` + +### `subject_text` + +```python +subject_text: str +``` + +### `title` + +```python +title = ZeroOrOne('dc:title', successors=()) +``` + +### `title_text` + +```python +title_text: str +``` + +### `version` + +```python +version = ZeroOrOne('cp:version', successors=()) +``` + +### `version_text` + +```python +version_text: str +``` + + + + + +# `docx.oxml.document` + +Custom element classes that correspond to the document part, e.g. . + +## `CT_Body` + +Bases: `BaseOxmlElement` + +`w:body`, the container element for the main document story in `document.xml`. + +### `add_p` + +```python +add_p: Callable[[], CT_P] +``` + +### `add_section_break` + +```python +add_section_break() -> CT_SectPr +``` + +Return `w:sectPr` element for new section added at end of document. + +The last `w:sectPr` becomes the second-to-last, with the new `w:sectPr` being an +exact clone of the previous one, except that all header and footer references +are removed (and are therefore now "inherited" from the prior section). + +A copy of the previously-last `w:sectPr` will now appear in a new `w:p` at the +end of the document. The returned `w:sectPr` is the sentinel `w:sectPr` for the +document (and as implemented, `is` the prior sentinel `w:sectPr` with headers +and footers removed). + +### `clear_content` + +```python +clear_content() +``` + +Remove all content child elements from this element. + +Leave the element if it is present. + +### `get_or_add_sectPr` + +```python +get_or_add_sectPr: Callable[[], CT_SectPr] +``` + +### `inner_content_elements` + +```python +inner_content_elements: List[CT_P | CT_Tbl] +``` + +Generate all `w:p` and `w:tbl` elements in this document-body. + +Elements appear in document order. Elements shaded by nesting in a `w:ins` or +other "wrapper" element will not be included. + +### `p` + +```python +p = ZeroOrMore('w:p', successors=('w:sectPr',)) +``` + +### `p_lst` + +```python +p_lst: List[CT_P] +``` + +### `sectPr` + +```python +sectPr: CT_SectPr | None = ZeroOrOne('w:sectPr', successors=()) +``` + +### `tbl` + +```python +tbl = ZeroOrMore('w:tbl', successors=('w:sectPr',)) +``` + +### `tbl_lst` + +```python +tbl_lst: List[CT_Tbl] +``` + +## `CT_Document` + +Bases: `BaseOxmlElement` + +```` element, the root element of a document.xml file. + +### `body` + +```python +body: CT_Body = ZeroOrOne('w:body') +``` + +### `sectPr_lst` + +```python +sectPr_lst: List[CT_SectPr] +``` + +All `w:sectPr` elements directly accessible from document element. + +Note this does not include a `sectPr` child in a paragraphs wrapped in +revision marks or other intervening layer, perhaps `w:sdt` or customXml +elements. + +`w:sectPr` elements appear in document order. The last one is always +`w:body/w:sectPr`, all preceding are `w:p/w:pPr/w:sectPr`. + + + + + +# `docx.oxml.drawing` + +Custom element-classes for DrawingML-related elements like ``. + +## `CT_Drawing` + +Bases: `BaseOxmlElement` + +`` element, containing a DrawingML object like a picture or chart. + + + + + +# `docx.oxml.exceptions` + +Exceptions for oxml sub-package. + +## `InvalidXmlError` + +Bases: `XmlchemyError` + +Raised when invalid XML is encountered, such as on attempt to access a missing +required child element. + +## `XmlchemyError` + +Bases: `Exception` + +Generic error class. + + + + + +# `docx.oxml.ns` + +Namespace-related objects. + +## `NamespacePrefixedTag` + +```python +NamespacePrefixedTag(nstag: str) +``` + +Bases: `str` + +Value object that knows the semantics of an XML tag having a namespace prefix. + +### `clark_name` + +```python +clark_name: str +``` + +### `from_clark_name` + +```python +from_clark_name(clark_name: str) -> NamespacePrefixedTag +``` + +### `local_part` + +```python +local_part: str +``` + +The local part of this tag. + +E.g. "foobar" is returned for tag "f:foobar". + +### `nsmap` + +```python +nsmap: Dict[str, str] +``` + +Single-member dict mapping prefix of this tag to it's namespace name. + +Example: `{"f": "http://foo/bar"}`. This is handy for passing to xpath calls +and other uses. + +### `nspfx` + +```python +nspfx: str +``` + +The namespace-prefix for this tag. + +For example, "f" is returned for tag "f:foobar". + +### `nsuri` + +```python +nsuri: str +``` + +The namespace URI for this tag. + +For example, "http://foo/bar" would be returned for tag "f:foobar" if the "f" +prefix maps to "http://foo/bar" in nsmap. + +## `nsdecls` + +```python +nsdecls(*prefixes: str) -> str +``` + +Namespace declaration including each namespace-prefix in `prefixes`. + +Handy for adding required namespace declarations to a tree root element. + +## `nsmap` + +```python +nsmap = {'a': 'http://schemas.openxmlformats.org/drawingml/2006/main', 'c': 'http://schemas.openxmlformats.org/drawingml/2006/chart', 'cp': 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties', 'dc': 'http://purl.org/dc/elements/1.1/', 'dcmitype': 'http://purl.org/dc/dcmitype/', 'dcterms': 'http://purl.org/dc/terms/', 'dgm': 'http://schemas.openxmlformats.org/drawingml/2006/diagram', 'm': 'http://schemas.openxmlformats.org/officeDocument/2006/math', 'pic': 'http://schemas.openxmlformats.org/drawingml/2006/picture', 'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships', 'sl': 'http://schemas.openxmlformats.org/schemaLibrary/2006/main', 'w': 'http://schemas.openxmlformats.org/wordprocessingml/2006/main', 'w14': 'http://schemas.microsoft.com/office/word/2010/wordml', 'wp': 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing', 'xml': 'http://www.w3.org/XML/1998/namespace', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'} +``` + +## `nspfxmap` + +```python +nspfxmap(*nspfxs: str) -> Dict[str, str] +``` + +Subset namespace-prefix mappings specified by *nspfxs*. + +Any number of namespace prefixes can be supplied, e.g. namespaces("a", "r", "p"). + +## `pfxmap` + +```python +pfxmap = {value: key for key, value in nsmap.items()} +``` + +## `qn` + +```python +qn(tag: str) -> str +``` + +Stands for "qualified name". + +This utility function converts a familiar namespace-prefixed tag name like "w:p" +into a Clark-notation qualified tag name for lxml. For example, `qn("w:p")` returns +"{http://schemas.openxmlformats.org/wordprocessingml/2006/main}p". + + + + + +# `docx.oxml.numbering` + +Custom element classes related to the numbering part. + +## `CT_Num` + +Bases: `BaseOxmlElement` + +```` element, which represents a concrete list definition instance, having +a required child that references an abstract numbering definition +that defines most of the formatting details. + +### `abstractNumId` + +```python +abstractNumId = OneAndOnlyOne('w:abstractNumId') +``` + +### `add_lvlOverride` + +```python +add_lvlOverride(ilvl) +``` + +Return a newly added CT_NumLvl () element having its ``ilvl`` +attribute set to `ilvl`. + +### `lvlOverride` + +```python +lvlOverride = ZeroOrMore('w:lvlOverride') +``` + +### `new` + +```python +new(num_id, abstractNum_id) +``` + +Return a new ```` element having numId of `num_id` and having a +```` child with val attribute set to `abstractNum_id`. + +### `numId` + +```python +numId = RequiredAttribute('w:numId', ST_DecimalNumber) +``` + +## `CT_NumLvl` + +Bases: `BaseOxmlElement` + +```` element, which identifies a level in a list definition to +override with settings it contains. + +### `add_startOverride` + +```python +add_startOverride(val) +``` + +Return a newly added CT_DecimalNumber element having tagname +``w:startOverride`` and ``val`` attribute set to `val`. + +### `ilvl` + +```python +ilvl = RequiredAttribute('w:ilvl', ST_DecimalNumber) +``` + +### `startOverride` + +```python +startOverride = ZeroOrOne('w:startOverride', successors=('w:lvl',)) +``` + +## `CT_NumPr` + +Bases: `BaseOxmlElement` + +A ```` element, a container for numbering properties applied to a +paragraph. + +### `ilvl` + +```python +ilvl = ZeroOrOne('w:ilvl', successors=('w:numId', 'w:numberingChange', 'w:ins')) +``` + +### `numId` + +```python +numId = ZeroOrOne('w:numId', successors=('w:numberingChange', 'w:ins')) +``` + +## `CT_Numbering` + +Bases: `BaseOxmlElement` + +```` element, the root element of a numbering part, i.e. +numbering.xml. + +### `add_num` + +```python +add_num(abstractNum_id) +``` + +Return a newly added CT_Num () element referencing the abstract +numbering definition identified by `abstractNum_id`. + +### `num` + +```python +num = ZeroOrMore('w:num', successors=('w:numIdMacAtCleanup',)) +``` + +### `num_having_numId` + +```python +num_having_numId(numId) +``` + +Return the ```` child element having ``numId`` attribute matching +`numId`. + + + + + +# `docx.oxml.parser` + +XML parser for python-docx. + +## `OxmlElement` + +```python +OxmlElement(nsptag_str: str, attrs: Dict[str, str] | None = None, nsdecls: Dict[str, str] | None = None) -> BaseOxmlElement | etree._Element +``` + +Return a 'loose' lxml element having the tag specified by `nsptag_str`. + +The tag in `nsptag_str` must contain the standard namespace prefix, e.g. `a:tbl`. +The resulting element is an instance of the custom element class for this tag name +if one is defined. A dictionary of attribute values may be provided as `attrs`; they +are set if present. All namespaces defined in the dict `nsdecls` are declared in the +element using the key as the prefix and the value as the namespace name. If +`nsdecls` is not provided, a single namespace declaration is added based on the +prefix on `nsptag_str`. + +## `element_class_lookup` + +```python +element_class_lookup = etree.ElementNamespaceClassLookup() +``` + +## `oxml_parser` + +```python +oxml_parser = etree.XMLParser(remove_blank_text=True, resolve_entities=False) +``` + +## `parse_xml` + +```python +parse_xml(xml: str | bytes) -> 'BaseOxmlElement' +``` + +Root lxml element obtained by parsing XML character string `xml`. + +The custom parser is used, so custom element classes are produced for elements in +`xml` that have them. + +## `register_element_cls` + +```python +register_element_cls(tag: str, cls: Type['BaseOxmlElement']) +``` + +Register an lxml custom element-class to use for `tag`. + +A instance of `cls` to be constructed when the oxml parser encounters an element +with matching `tag`. `tag` is a string of the form `nspfx:tagroot`, e.g. +`'w:document'`. + + + + + +# `docx.oxml.revision` + +Custom element classes for the tracked-change (revision) vocabulary. + +## `CT_RunTrackChange` + +Bases: `BaseOxmlElement` + +`w:ins` and `w:del` elements: a tracked run-level change. + +Both tags share this shape (ECMA-376 CT_RunTrackChange): required unique +`w:id`, required `w:author`, optional `w:date`, containing the changed +runs. `w:del` also appears childless inside `w:pPr/w:rPr` to mark a +paragraph mark as deleted; ``ZeroOrMore`` runs covers that use too. + +### `add_tracked_run` + +```python +add_tracked_run(text: str, rpr: 'Optional[_Element]', *, deleted: bool) -> 'CT_R' +``` + +Append a run holding `text`, with `rpr` cloned in when given. + +Deleted text goes into `w:delText` (never live `w:t` inside `w:del`); +inserted text into `w:t`. Edge whitespace gets `xml:space="preserve"`. + +### `author` + +```python +author = RequiredAttribute('w:author', ST_String) +``` + +### `date` + +```python +date = OptionalAttribute('w:date', ST_DateTime) +``` + +### `id` + +```python +id = RequiredAttribute('w:id', ST_DecimalNumber) +``` + +### `new` + +```python +new(tag: str, revision_id: int, author: str, date: Optional[dt.datetime]) -> 'CT_RunTrackChange' +``` + +A new `w:ins` or `w:del` element with its identity attributes set. + +### `r` + +```python +r = ZeroOrMore('w:r') +``` + + + + + +# `docx.oxml.section` + +Section-related custom element classes. + +## `BlockElement` + +```python +BlockElement: TypeAlias = 'CT_P | CT_Tbl' +``` + +## `CT_HdrFtr` + +Bases: `BaseOxmlElement` + +`w:hdr` and `w:ftr`, the root element for header and footer part respectively. + +### `add_p` + +```python +add_p: Callable[[], CT_P] +``` + +### `inner_content_elements` + +```python +inner_content_elements: List[CT_P | CT_Tbl] +``` + +Generate all `w:p` and `w:tbl` elements in this header or footer. + +Elements appear in document order. Elements shaded by nesting in a `w:ins` or +other "wrapper" element will not be included. + +### `p` + +```python +p = ZeroOrMore('w:p', successors=()) +``` + +### `p_lst` + +```python +p_lst: List[CT_P] +``` + +### `tbl` + +```python +tbl = ZeroOrMore('w:tbl', successors=()) +``` + +### `tbl_lst` + +```python +tbl_lst: List[CT_Tbl] +``` + +## `CT_HdrFtrRef` + +Bases: `BaseOxmlElement` + +`w:headerReference` and `w:footerReference` elements. + +### `rId` + +```python +rId: str = RequiredAttribute('r:id', XsdString) +``` + +### `type_` + +```python +type_: WD_HEADER_FOOTER = RequiredAttribute('w:type', WD_HEADER_FOOTER) +``` + +## `CT_PageMar` + +Bases: `BaseOxmlElement` + +```` element, defining page margins. + +### `bottom` + +```python +bottom: Length | None = OptionalAttribute('w:bottom', ST_SignedTwipsMeasure) +``` + +### `footer` + +```python +footer: Length | None = OptionalAttribute('w:footer', ST_TwipsMeasure) +``` + +### `gutter` + +```python +gutter: Length | None = OptionalAttribute('w:gutter', ST_TwipsMeasure) +``` + +### `header` + +```python +header: Length | None = OptionalAttribute('w:header', ST_TwipsMeasure) +``` + +### `left` + +```python +left: Length | None = OptionalAttribute('w:left', ST_TwipsMeasure) +``` + +### `right` + +```python +right: Length | None = OptionalAttribute('w:right', ST_TwipsMeasure) +``` + +### `top` + +```python +top: Length | None = OptionalAttribute('w:top', ST_SignedTwipsMeasure) +``` + +## `CT_PageSz` + +Bases: `BaseOxmlElement` + +```` element, defining page dimensions and orientation. + +### `h` + +```python +h: Length | None = OptionalAttribute('w:h', ST_TwipsMeasure) +``` + +### `orient` + +```python +orient: WD_ORIENTATION = OptionalAttribute('w:orient', WD_ORIENTATION, default=WD_ORIENTATION.PORTRAIT) +``` + +### `w` + +```python +w: Length | None = OptionalAttribute('w:w', ST_TwipsMeasure) +``` + +## `CT_SectPr` + +Bases: `BaseOxmlElement` + +`w:sectPr` element, the container element for section properties. + +### `add_footerReference` + +```python +add_footerReference(type_: WD_HEADER_FOOTER, rId: str) -> CT_HdrFtrRef +``` + +Return newly added CT_HdrFtrRef element of `type_` with `rId`. + +The element tag is `w:footerReference`. + +### `add_headerReference` + +```python +add_headerReference(type_: WD_HEADER_FOOTER, rId: str) -> CT_HdrFtrRef +``` + +Return newly added CT_HdrFtrRef element of `type_` with `rId`. + +The element tag is `w:headerReference`. + +### `bottom_margin` + +```python +bottom_margin: Length | None +``` + +Value of the `w:bottom` attr of `` child element, as `Length`. + +`None` when either the element or the attribute is not present. + +### `clone` + +```python +clone() -> CT_SectPr +``` + +Return an exact duplicate of this ```` element tree suitable for +use in adding a section break. + +All rsid* attributes are removed from the root ```` element. + +### `footer` + +```python +footer: Length | None +``` + +Distance from bottom edge of page to bottom edge of the footer. + +This is the value of the `w:footer` attribute in the `w:pgMar` child element, +as a `Length` object, or `None` if either the element or the attribute is not +present. + +### `footerReference` + +```python +footerReference = ZeroOrMore('w:footerReference', successors=_tag_seq) +``` + +### `get_footerReference` + +```python +get_footerReference(type_: WD_HEADER_FOOTER) -> CT_HdrFtrRef | None +``` + +Return footerReference element of `type_` or None if not present. + +### `get_headerReference` + +```python +get_headerReference(type_: WD_HEADER_FOOTER) -> CT_HdrFtrRef | None +``` + +Return headerReference element of `type_` or None if not present. + +### `get_or_add_pgMar` + +```python +get_or_add_pgMar: Callable[[], CT_PageMar] +``` + +### `get_or_add_pgSz` + +```python +get_or_add_pgSz: Callable[[], CT_PageSz] +``` + +### `get_or_add_titlePg` + +```python +get_or_add_titlePg: Callable[[], CT_OnOff] +``` + +### `get_or_add_type` + +```python +get_or_add_type: Callable[[], CT_SectType] +``` + +### `gutter` + +```python +gutter: Length | None +``` + +The value of the ``w:gutter`` attribute in the ```` child element, +as a `Length` object, or `None` if either the element or the attribute is not +present. + +### `header` + +```python +header: Length | None +``` + +Distance from top edge of page to top edge of header. + +This value comes from the `w:header` attribute on the `w:pgMar` child element. +`None` if either the element or the attribute is not present. + +### `headerReference` + +```python +headerReference = ZeroOrMore('w:headerReference', successors=_tag_seq) +``` + +### `iter_inner_content` + +```python +iter_inner_content() -> Iterator[CT_P | CT_Tbl] +``` + +Generate all `w:p` and `w:tbl` elements in this section. + +Elements appear in document order. Elements shaded by nesting in a `w:ins` or +other "wrapper" element will not be included. + +### `left_margin` + +```python +left_margin: Length | None +``` + +The value of the ``w:left`` attribute in the ```` child element, as +a `Length` object, or `None` if either the element or the attribute is not +present. + +### `orientation` + +```python +orientation: WD_ORIENTATION +``` + +`WD_ORIENTATION` member indicating page-orientation for this section. + +This is the value of the `orient` attribute on the `w:pgSz` child, or +`WD_ORIENTATION.PORTRAIT` if not present. + +### `page_height` + +```python +page_height: Length | None +``` + +Value in EMU of the `h` attribute of the `w:pgSz` child element. + +`None` if not present. + +### `page_width` + +```python +page_width: Length | None +``` + +Value in EMU of the ``w`` attribute of the ```` child element. + +`None` if not present. + +### `pgMar` + +```python +pgMar: CT_PageMar | None = ZeroOrOne('w:pgMar', successors=_tag_seq[5:]) +``` + +### `pgSz` + +```python +pgSz: CT_PageSz | None = ZeroOrOne('w:pgSz', successors=_tag_seq[4:]) +``` + +### `preceding_sectPr` + +```python +preceding_sectPr: CT_SectPr | None +``` + +SectPr immediately preceding this one or None if this is the first. + +### `remove_footerReference` + +```python +remove_footerReference(type_: WD_HEADER_FOOTER) -> str +``` + +Return rId of w:footerReference child of `type_` after removing it. + +### `remove_headerReference` + +```python +remove_headerReference(type_: WD_HEADER_FOOTER) +``` + +Return rId of w:headerReference child of `type_` after removing it. + +### `right_margin` + +```python +right_margin: Length | None +``` + +The value of the ``w:right`` attribute in the ```` child element, as +a `Length` object, or `None` if either the element or the attribute is not +present. + +### `start_type` + +```python +start_type: WD_SECTION_START +``` + +The member of the ``WD_SECTION_START`` enumeration corresponding to the value +of the ``val`` attribute of the ```` child element, or +``WD_SECTION_START.NEW_PAGE`` if not present. + +### `titlePg` + +```python +titlePg: CT_OnOff | None = ZeroOrOne('w:titlePg', successors=_tag_seq[14:]) +``` + +### `titlePg_val` + +```python +titlePg_val: bool +``` + +Value of `w:titlePg/@val` or `False` if `./w:titlePg` is not present. + +### `top_margin` + +```python +top_margin: Length | None +``` + +The value of the ``w:top`` attribute in the ```` child element, as a +`Length` object, or `None` if either the element or the attribute is not +present. + +### `type` + +```python +type: CT_SectType | None = ZeroOrOne('w:type', successors=_tag_seq[3:]) +``` + +## `CT_SectType` + +Bases: `BaseOxmlElement` + +```` element, defining the section start type. + +### `val` + +```python +val: WD_SECTION_START | None = OptionalAttribute('w:val', WD_SECTION_START) +``` + + + + + +# `docx.oxml.settings` + +Custom element classes related to document settings. + +## `CT_Settings` + +Bases: `BaseOxmlElement` + +`w:settings` element, root element for the settings part. + +### `evenAndOddHeaders` + +```python +evenAndOddHeaders: CT_OnOff | None = ZeroOrOne('w:evenAndOddHeaders', successors=_tag_seq[48:]) +``` + +### `evenAndOddHeaders_val` + +```python +evenAndOddHeaders_val: bool +``` + +Value of `w:evenAndOddHeaders/@w:val` or `None` if not present. + +### `get_or_add_evenAndOddHeaders` + +```python +get_or_add_evenAndOddHeaders: Callable[[], CT_OnOff] +``` diff --git a/addons/sandbox/skills/docx/references/api-003.md b/addons/sandbox/skills/docx/references/api-003.md new file mode 100644 index 000000000..bea7d8d4c --- /dev/null +++ b/addons/sandbox/skills/docx/references/api-003.md @@ -0,0 +1,6449 @@ + + + + +# `docx.oxml.shape` + +Custom element classes for shape-related elements like ``. + +## `CT_Anchor` + +Bases: `BaseOxmlElement` + +`` element, container for a "floating" shape. + +## `CT_Blip` + +Bases: `BaseOxmlElement` + +```` element, specifies image source and adjustments such as alpha and +tint. + +### `embed` + +```python +embed: str | None = OptionalAttribute('r:embed', ST_RelationshipId) +``` + +### `link` + +```python +link: str | None = OptionalAttribute('r:link', ST_RelationshipId) +``` + +## `CT_BlipFillProperties` + +Bases: `BaseOxmlElement` + +```` element, specifies picture properties. + +### `blip` + +```python +blip: CT_Blip = ZeroOrOne('a:blip', successors=('a:srcRect', 'a:tile', 'a:stretch')) +``` + +## `CT_GraphicalObject` + +Bases: `BaseOxmlElement` + +```` element, container for a DrawingML object. + +### `graphicData` + +```python +graphicData: CT_GraphicalObjectData = OneAndOnlyOne('a:graphicData') +``` + +## `CT_GraphicalObjectData` + +Bases: `BaseOxmlElement` + +```` element, container for the XML of a DrawingML object. + +### `pic` + +```python +pic: CT_Picture = ZeroOrOne('pic:pic') +``` + +### `uri` + +```python +uri: str = RequiredAttribute('uri', XsdToken) +``` + +## `CT_Inline` + +Bases: `BaseOxmlElement` + +`` element, container for an inline shape. + +### `docPr` + +```python +docPr: CT_NonVisualDrawingProps = OneAndOnlyOne('wp:docPr') +``` + +### `extent` + +```python +extent: CT_PositiveSize2D = OneAndOnlyOne('wp:extent') +``` + +### `graphic` + +```python +graphic: CT_GraphicalObject = OneAndOnlyOne('a:graphic') +``` + +### `new` + +```python +new(cx: Length, cy: Length, shape_id: int, pic: CT_Picture) -> CT_Inline +``` + +Return a new ```` element populated with the values passed as +parameters. + +### `new_pic_inline` + +```python +new_pic_inline(shape_id: int, rId: str, filename: str, cx: Length, cy: Length) -> CT_Inline +``` + +Create `wp:inline` element containing a `pic:pic` element. + +The contents of the `pic:pic` element is taken from the argument values. + +## `CT_NonVisualDrawingProps` + +Bases: `BaseOxmlElement` + +Used for ```` element, and perhaps others. + +Specifies the id and name of a DrawingML drawing. + +### `id` + +```python +id = RequiredAttribute('id', ST_DrawingElementId) +``` + +### `name` + +```python +name = RequiredAttribute('name', XsdString) +``` + +## `CT_NonVisualPictureProperties` + +Bases: `BaseOxmlElement` + +```` element, specifies picture locking and resize behaviors. + +## `CT_Picture` + +Bases: `BaseOxmlElement` + +```` element, a DrawingML picture. + +### `blipFill` + +```python +blipFill: CT_BlipFillProperties = OneAndOnlyOne('pic:blipFill') +``` + +### `new` + +```python +new(pic_id: int, filename: str, rId: str, cx: Length, cy: Length) -> CT_Picture +``` + +A new minimum viable `` (picture) element. + +### `nvPicPr` + +```python +nvPicPr: CT_PictureNonVisual = OneAndOnlyOne('pic:nvPicPr') +``` + +### `spPr` + +```python +spPr: CT_ShapeProperties = OneAndOnlyOne('pic:spPr') +``` + +## `CT_PictureNonVisual` + +Bases: `BaseOxmlElement` + +```` element, non-visual picture properties. + +### `cNvPr` + +```python +cNvPr = OneAndOnlyOne('pic:cNvPr') +``` + +## `CT_Point2D` + +Bases: `BaseOxmlElement` + +Used for ```` element, and perhaps others. + +Specifies an x, y coordinate (point). + +### `x` + +```python +x = RequiredAttribute('x', ST_Coordinate) +``` + +### `y` + +```python +y = RequiredAttribute('y', ST_Coordinate) +``` + +## `CT_PositiveSize2D` + +Bases: `BaseOxmlElement` + +Used for ```` element, and perhaps others later. + +Specifies the size of a DrawingML drawing. + +### `cx` + +```python +cx: Length = RequiredAttribute('cx', ST_PositiveCoordinate) +``` + +### `cy` + +```python +cy: Length = RequiredAttribute('cy', ST_PositiveCoordinate) +``` + +## `CT_PresetGeometry2D` + +Bases: `BaseOxmlElement` + +```` element, specifies an preset autoshape geometry, such as +``rect``. + +## `CT_RelativeRect` + +Bases: `BaseOxmlElement` + +```` element, specifying picture should fill containing rectangle +shape. + +## `CT_ShapeProperties` + +Bases: `BaseOxmlElement` + +```` element, specifies size and shape of picture container. + +### `cx` + +```python +cx +``` + +Shape width as an instance of Emu, or None if not present. + +### `cy` + +```python +cy +``` + +Shape height as an instance of Emu, or None if not present. + +### `xfrm` + +```python +xfrm = ZeroOrOne('a:xfrm', successors=('a:custGeom', 'a:prstGeom', 'a:ln', 'a:effectLst', 'a:effectDag', 'a:scene3d', 'a:sp3d', 'a:extLst')) +``` + +## `CT_StretchInfoProperties` + +Bases: `BaseOxmlElement` + +```` element, specifies how picture should fill its containing +shape. + +## `CT_Transform2D` + +Bases: `BaseOxmlElement` + +```` element, specifies size and shape of picture container. + +### `cx` + +```python +cx +``` + +### `cy` + +```python +cy +``` + +### `ext` + +```python +ext = ZeroOrOne('a:ext', successors=()) +``` + +### `off` + +```python +off = ZeroOrOne('a:off', successors=('a:ext',)) +``` + + + + + +# `docx.oxml.shared` + +Objects shared by modules in the docx.oxml subpackage. + +## `CT_DecimalNumber` + +Bases: `BaseOxmlElement` + +Used for ````, ````, ```` and several others, +containing a text representation of a decimal number (e.g. 42) in its ``val`` +attribute. + +### `new` + +```python +new(nsptagname: str, val: int) +``` + +Return a new ``CT_DecimalNumber`` element having tagname `nsptagname` and +``val`` attribute set to `val`. + +### `val` + +```python +val: int = RequiredAttribute('w:val', ST_DecimalNumber) +``` + +## `CT_OnOff` + +Bases: `BaseOxmlElement` + +Used for `w:b`, `w:i` elements and others. + +Contains a bool-ish string in its `val` attribute, xsd:boolean plus "on" and +"off". Defaults to `True`, so `` for example means "bold is turned on". + +### `val` + +```python +val: bool = OptionalAttribute('w:val', ST_OnOff, default=True) +``` + +## `CT_String` + +Bases: `BaseOxmlElement` + +Used for `w:pStyle` and `w:tblStyle` elements and others. + +In those cases, it containing a style name in its `val` attribute. + +### `new` + +```python +new(nsptagname: str, val: str) +``` + +A new `CT_String`` element with tagname `nsptagname` and `val` attribute set to `val`. + +### `val` + +```python +val: str = RequiredAttribute('w:val', ST_String) +``` + + + + + +# `docx.oxml.simpletypes` + +Simple-type classes, corresponding to ST_* schema items. + +## `BaseIntType` + +Bases: `BaseSimpleType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> int +``` + +### `convert_to_xml` + +```python +convert_to_xml(value: int) -> str +``` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `BaseSimpleType` + +Base class for simple-types. + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> Any +``` + +### `convert_to_xml` + +```python +convert_to_xml(value: Any) -> str +``` + +### `from_xml` + +```python +from_xml(xml_value: str) -> Any +``` + +### `to_xml` + +```python +to_xml(value: Any) -> str +``` + +### `validate` + +```python +validate(value: Any) -> None +``` + +### `validate_int` + +```python +validate_int(value: object) +``` + +### `validate_int_in_range` + +```python +validate_int_in_range(value: int, min_inclusive: int, max_inclusive: int) -> None +``` + +### `validate_string` + +```python +validate_string(value: Any) -> str +``` + +## `BaseStringEnumerationType` + +Bases: `BaseStringType` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `BaseStringType` + +Bases: `BaseSimpleType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> str +``` + +### `convert_to_xml` + +```python +convert_to_xml(value: str) -> str +``` + +### `validate` + +```python +validate(value: str) +``` + +## `ST_BrClear` + +Bases: `XsdString` + +### `validate` + +```python +validate(value: str) -> None +``` + +## `ST_BrType` + +Bases: `XsdString` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `ST_Coordinate` + +Bases: `BaseIntType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> Length +``` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `ST_CoordinateUnqualified` + +Bases: `XsdLong` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `ST_DateTime` + +Bases: `BaseSimpleType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> dt.datetime +``` + +Convert an xsd:dateTime string to a datetime object. + +### `convert_to_xml` + +```python +convert_to_xml(value: dt.datetime) -> str +``` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `ST_DecimalNumber` + +Bases: `XsdInt` + +## `ST_DrawingElementId` + +Bases: `XsdUnsignedInt` + +## `ST_HexColor` + +Bases: `BaseStringType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> RGBColor | str +``` + +### `convert_to_xml` + +```python +convert_to_xml(value: RGBColor) -> str +``` + +Keep alpha hex numerals all uppercase just for consistency. + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `ST_HexColorAuto` + +Bases: `XsdStringEnumeration` + +Value for `w:color/[@val="auto"] attribute setting. + +### `AUTO` + +```python +AUTO = 'auto' +``` + +## `ST_HpsMeasure` + +Bases: `XsdUnsignedLong` + +Half-point measure, e.g. 24.0 represents 12.0 points. + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> Length +``` + +### `convert_to_xml` + +```python +convert_to_xml(value: int | Length) -> str +``` + +## `ST_Merge` + +Bases: `XsdStringEnumeration` + +Valid values for attribute. + +### `CONTINUE` + +```python +CONTINUE = 'continue' +``` + +### `RESTART` + +```python +RESTART = 'restart' +``` + +## `ST_OnOff` + +Bases: `XsdBoolean` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> bool +``` + +## `ST_PositiveCoordinate` + +Bases: `XsdLong` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> Length +``` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `ST_RelationshipId` + +Bases: `XsdString` + +## `ST_SignedTwipsMeasure` + +Bases: `XsdInt` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> Length +``` + +### `convert_to_xml` + +```python +convert_to_xml(value: int | Length) -> str +``` + +## `ST_String` + +Bases: `XsdString` + +## `ST_TblLayoutType` + +Bases: `XsdString` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `ST_TblWidth` + +Bases: `XsdString` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `ST_TwipsMeasure` + +Bases: `XsdUnsignedLong` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> Length +``` + +### `convert_to_xml` + +```python +convert_to_xml(value: int | Length) -> str +``` + +## `ST_UniversalMeasure` + +Bases: `BaseSimpleType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> Emu +``` + +## `ST_VerticalAlignRun` + +Bases: `XsdStringEnumeration` + +Valid values for `w:vertAlign/@val`. + +### `BASELINE` + +```python +BASELINE = 'baseline' +``` + +### `SUBSCRIPT` + +```python +SUBSCRIPT = 'subscript' +``` + +### `SUPERSCRIPT` + +```python +SUPERSCRIPT = 'superscript' +``` + +## `XsdAnyUri` + +Bases: `BaseStringType` + +There's a regex in the spec this is supposed to meet... + +but current assessment is that spending cycles on validating wouldn't be worth it +for the number of programming errors it would catch. + +## `XsdBoolean` + +Bases: `BaseSimpleType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> bool +``` + +### `convert_to_xml` + +```python +convert_to_xml(value: bool) -> str +``` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `XsdId` + +Bases: `BaseStringType` + +String that must begin with a letter or underscore and cannot contain any colons. + +Not fully validated because not used in external API. + +## `XsdInt` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `XsdLong` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `XsdString` + +Bases: `BaseStringType` + +## `XsdStringEnumeration` + +Bases: `BaseStringEnumerationType` + +Set of enumerated xsd:string values. + +## `XsdToken` + +Bases: `BaseStringType` + +Xsd:string with whitespace collapsing, e.g. multiple spaces reduced to one, +leading and trailing space stripped. + +## `XsdUnsignedInt` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value: Any) -> None +``` + +## `XsdUnsignedLong` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value: Any) -> None +``` + + + + + +# `docx.oxml.styles` + +Custom element classes related to the styles part. + +## `CT_LatentStyles` + +Bases: `BaseOxmlElement` + +`w:latentStyles` element, defining behavior defaults for latent styles and +containing `w:lsdException` child elements that each override those defaults for a +named latent style. + +### `bool_prop` + +```python +bool_prop(attr_name) +``` + +Return the boolean value of the attribute having `attr_name`, or `False` if +not present. + +### `count` + +```python +count = OptionalAttribute('w:count', ST_DecimalNumber) +``` + +### `defLockedState` + +```python +defLockedState = OptionalAttribute('w:defLockedState', ST_OnOff) +``` + +### `defQFormat` + +```python +defQFormat = OptionalAttribute('w:defQFormat', ST_OnOff) +``` + +### `defSemiHidden` + +```python +defSemiHidden = OptionalAttribute('w:defSemiHidden', ST_OnOff) +``` + +### `defUIPriority` + +```python +defUIPriority = OptionalAttribute('w:defUIPriority', ST_DecimalNumber) +``` + +### `defUnhideWhenUsed` + +```python +defUnhideWhenUsed = OptionalAttribute('w:defUnhideWhenUsed', ST_OnOff) +``` + +### `get_by_name` + +```python +get_by_name(name) +``` + +Return the `w:lsdException` child having `name`, or `None` if not found. + +### `lsdException` + +```python +lsdException = ZeroOrMore('w:lsdException', successors=()) +``` + +### `set_bool_prop` + +```python +set_bool_prop(attr_name, value) +``` + +Set the on/off attribute having `attr_name` to `value`. + +## `CT_LsdException` + +Bases: `BaseOxmlElement` + +```` element, defining override visibility behaviors for a named +latent style. + +### `delete` + +```python +delete() +``` + +Remove this `w:lsdException` element from the XML document. + +### `locked` + +```python +locked = OptionalAttribute('w:locked', ST_OnOff) +``` + +### `name` + +```python +name = RequiredAttribute('w:name', ST_String) +``` + +### `on_off_prop` + +```python +on_off_prop(attr_name) +``` + +Return the boolean value of the attribute having `attr_name`, or `None` if +not present. + +### `qFormat` + +```python +qFormat = OptionalAttribute('w:qFormat', ST_OnOff) +``` + +### `semiHidden` + +```python +semiHidden = OptionalAttribute('w:semiHidden', ST_OnOff) +``` + +### `set_on_off_prop` + +```python +set_on_off_prop(attr_name, value) +``` + +Set the on/off attribute having `attr_name` to `value`. + +### `uiPriority` + +```python +uiPriority = OptionalAttribute('w:uiPriority', ST_DecimalNumber) +``` + +### `unhideWhenUsed` + +```python +unhideWhenUsed = OptionalAttribute('w:unhideWhenUsed', ST_OnOff) +``` + +## `CT_Style` + +Bases: `BaseOxmlElement` + +A ```` element, representing a style definition. + +### `base_style` + +```python +base_style +``` + +Sibling CT_Style element this style is based on or `None` if no base style or +base style not found. + +### `basedOn` + +```python +basedOn = ZeroOrOne('w:basedOn', successors=_tag_seq[3:]) +``` + +### `basedOn_val` + +```python +basedOn_val +``` + +Value of `w:basedOn/@w:val` or `None` if not present. + +### `customStyle` + +```python +customStyle = OptionalAttribute('w:customStyle', ST_OnOff) +``` + +### `default` + +```python +default = OptionalAttribute('w:default', ST_OnOff) +``` + +### `delete` + +```python +delete() +``` + +Remove this `w:style` element from its parent `w:styles` element. + +### `locked` + +```python +locked = ZeroOrOne('w:locked', successors=_tag_seq[12:]) +``` + +### `locked_val` + +```python +locked_val +``` + +Value of `w:locked/@w:val` or `False` if not present. + +### `name` + +```python +name = ZeroOrOne('w:name', successors=_tag_seq[1:]) +``` + +### `name_val` + +```python +name_val +``` + +Value of ```` child or `None` if not present. + +### `next` + +```python +next = ZeroOrOne('w:next', successors=_tag_seq[4:]) +``` + +### `next_style` + +```python +next_style +``` + +Sibling CT_Style element identified by the value of `w:name/@w:val` or `None` +if no value is present or no style with that style id is found. + +### `pPr` + +```python +pPr = ZeroOrOne('w:pPr', successors=_tag_seq[17:]) +``` + +### `qFormat` + +```python +qFormat = ZeroOrOne('w:qFormat', successors=_tag_seq[11:]) +``` + +### `qFormat_val` + +```python +qFormat_val +``` + +Value of `w:qFormat/@w:val` or `False` if not present. + +### `rPr` + +```python +rPr = ZeroOrOne('w:rPr', successors=_tag_seq[18:]) +``` + +### `semiHidden` + +```python +semiHidden = ZeroOrOne('w:semiHidden', successors=_tag_seq[9:]) +``` + +### `semiHidden_val` + +```python +semiHidden_val +``` + +Value of ```` child or `False` if not present. + +### `styleId` + +```python +styleId: str | None = OptionalAttribute('w:styleId', ST_String) +``` + +### `type` + +```python +type: WD_STYLE_TYPE | None = OptionalAttribute('w:type', WD_STYLE_TYPE) +``` + +### `uiPriority` + +```python +uiPriority = ZeroOrOne('w:uiPriority', successors=_tag_seq[8:]) +``` + +### `uiPriority_val` + +```python +uiPriority_val +``` + +Value of ```` child or `None` if not present. + +### `unhideWhenUsed` + +```python +unhideWhenUsed = ZeroOrOne('w:unhideWhenUsed', successors=_tag_seq[10:]) +``` + +### `unhideWhenUsed_val` + +```python +unhideWhenUsed_val +``` + +Value of `w:unhideWhenUsed/@w:val` or `False` if not present. + +## `CT_Styles` + +Bases: `BaseOxmlElement` + +```` element, the root element of a styles part, i.e. styles.xml. + +### `add_style_of_type` + +```python +add_style_of_type(name, style_type, builtin) +``` + +Return a newly added `w:style` element having `name` and `style_type`. + +`w:style/@customStyle` is set based on the value of `builtin`. + +### `default_for` + +```python +default_for(style_type) +``` + +Return `w:style[@w:type="*{style_type}*][-1]` or `None` if not found. + +### `get_by_id` + +```python +get_by_id(styleId: str) -> CT_Style | None +``` + +`w:style` child where @styleId = `styleId`. + +`None` if not found. + +### `get_by_name` + +```python +get_by_name(name: str) -> CT_Style | None +``` + +`w:style` child with `w:name` grandchild having value `name`. + +`None` if not found. + +### `latentStyles` + +```python +latentStyles = ZeroOrOne('w:latentStyles', successors=_tag_seq[2:]) +``` + +### `style` + +```python +style = ZeroOrMore('w:style', successors=()) +``` + +## `styleId_from_name` + +```python +styleId_from_name(name) +``` + +Return the style id corresponding to `name`, taking into account special-case +names such as 'Heading 1'. + + + + + +# `docx.oxml.table` + +Custom element classes for tables. + +## `CT_Height` + +Bases: `BaseOxmlElement` + +Used for `w:trHeight` to specify a row height and row height rule. + +### `hRule` + +```python +hRule: WD_ROW_HEIGHT_RULE | None = OptionalAttribute('w:hRule', WD_ROW_HEIGHT_RULE) +``` + +### `val` + +```python +val: Length | None = OptionalAttribute('w:val', ST_TwipsMeasure) +``` + +## `CT_Row` + +Bases: `BaseOxmlElement` + +```` element. + +### `add_tc` + +```python +add_tc: Callable[[], CT_Tc] +``` + +### `get_or_add_trPr` + +```python +get_or_add_trPr: Callable[[], CT_TrPr] +``` + +### `grid_after` + +```python +grid_after: int +``` + +The number of unpopulated layout-grid cells at the end of this row. + +### `grid_before` + +```python +grid_before: int +``` + +The number of unpopulated layout-grid cells at the start of this row. + +### `tblPrEx` + +```python +tblPrEx: CT_TblPrEx | None = ZeroOrOne('w:tblPrEx') +``` + +### `tc` + +```python +tc = ZeroOrMore('w:tc') +``` + +### `tc_at_grid_offset` + +```python +tc_at_grid_offset(grid_offset: int) -> CT_Tc +``` + +The `tc` element in this tr at exact `grid offset`. + +Raises ValueError when this `w:tr` contains no `w:tc` with exact starting `grid_offset`. + +### `tc_lst` + +```python +tc_lst: list[CT_Tc] +``` + +### `trHeight_hRule` + +```python +trHeight_hRule: WD_ROW_HEIGHT_RULE | None +``` + +The value of `./w:trPr/w:trHeight/@w:hRule`, or `None` if not present. + +### `trHeight_val` + +```python +trHeight_val +``` + +Return the value of `w:trPr/w:trHeight@w:val`, or `None` if not present. + +### `trPr` + +```python +trPr: CT_TrPr | None = ZeroOrOne('w:trPr') +``` + +### `tr_idx` + +```python +tr_idx: int +``` + +Index of this `w:tr` element within its parent `w:tbl` element. + +## `CT_Tbl` + +Bases: `BaseOxmlElement` + +```` element. + +### `add_tr` + +```python +add_tr: Callable[[], CT_Row] +``` + +### `bidiVisual_val` + +```python +bidiVisual_val: bool | None +``` + +Value of `./w:tblPr/w:bidiVisual/@w:val` or `None` if not present. + +Controls whether table cells are displayed right-to-left or left-to-right. + +### `col_count` + +```python +col_count +``` + +The number of grid columns in this table. + +### `iter_tcs` + +```python +iter_tcs() +``` + +Generate each of the `w:tc` elements in this table, left to right and top to +bottom. + +Each cell in the first row is generated, followed by each cell in the second +row, etc. + +### `new_tbl` + +```python +new_tbl(rows: int, cols: int, width: Length) -> CT_Tbl +``` + +Return a new `w:tbl` element having `rows` rows and `cols` columns. + +`width` is distributed evenly between the columns. + +### `tblGrid` + +```python +tblGrid: CT_TblGrid = OneAndOnlyOne('w:tblGrid') +``` + +### `tblPr` + +```python +tblPr: CT_TblPr = OneAndOnlyOne('w:tblPr') +``` + +### `tblStyle_val` + +```python +tblStyle_val: str | None +``` + +`w:tblPr/w:tblStyle/@w:val` (a table style id) or `None` if not present. + +### `tr` + +```python +tr = ZeroOrMore('w:tr') +``` + +### `tr_lst` + +```python +tr_lst: list[CT_Row] +``` + +## `CT_TblGrid` + +Bases: `BaseOxmlElement` + +`w:tblGrid` element. + +Child of `w:tbl`, holds `w:gridCol> elements that define column count, width, etc. + +### `add_gridCol` + +```python +add_gridCol: Callable[[], CT_TblGridCol] +``` + +### `gridCol` + +```python +gridCol = ZeroOrMore('w:gridCol', successors=('w:tblGridChange',)) +``` + +### `gridCol_lst` + +```python +gridCol_lst: list[CT_TblGridCol] +``` + +## `CT_TblGridCol` + +Bases: `BaseOxmlElement` + +`w:gridCol` element, child of `w:tblGrid`, defines a table column. + +### `gridCol_idx` + +```python +gridCol_idx: int +``` + +Index of this `w:gridCol` element within its parent `w:tblGrid` element. + +### `w` + +```python +w: Length | None = OptionalAttribute('w:w', ST_TwipsMeasure) +``` + +## `CT_TblLayoutType` + +Bases: `BaseOxmlElement` + +`w:tblLayout` element. + +Specifies whether column widths are fixed or can be automatically adjusted based on +content. + +### `type` + +```python +type: str | None = OptionalAttribute('w:type', ST_TblLayoutType) +``` + +## `CT_TblPr` + +Bases: `BaseOxmlElement` + +```` element, child of ````, holds child elements that define +table properties such as style and borders. + +### `alignment` + +```python +alignment: WD_TABLE_ALIGNMENT | None +``` + +Horizontal alignment of table, `None` if `./w:jc` is not present. + +### `autofit` + +```python +autofit: bool +``` + +`False` when there is a `w:tblLayout` child with `@w:type="fixed"`. + +Otherwise `True`. + +### `bidiVisual` + +```python +bidiVisual: CT_OnOff | None = ZeroOrOne('w:bidiVisual', successors=_tag_seq[4:]) +``` + +### `get_or_add_bidiVisual` + +```python +get_or_add_bidiVisual: Callable[[], CT_OnOff] +``` + +### `get_or_add_jc` + +```python +get_or_add_jc: Callable[[], CT_Jc] +``` + +### `get_or_add_tblLayout` + +```python +get_or_add_tblLayout: Callable[[], CT_TblLayoutType] +``` + +### `jc` + +```python +jc: CT_Jc | None = ZeroOrOne('w:jc', successors=_tag_seq[8:]) +``` + +### `style` + +```python +style +``` + +Return the value of the ``val`` attribute of the ```` child or +`None` if not present. + +### `tblLayout` + +```python +tblLayout: CT_TblLayoutType | None = ZeroOrOne('w:tblLayout', successors=_tag_seq[13:]) +``` + +### `tblStyle` + +```python +tblStyle: CT_String | None = ZeroOrOne('w:tblStyle', successors=_tag_seq[1:]) +``` + +## `CT_TblPrEx` + +Bases: `BaseOxmlElement` + +`w:tblPrEx` element, exceptions to table-properties. + +Applied at a lower level, like a `w:tr` to modify the appearance. Possibly used when +two tables are merged. For more see: +http://officeopenxml.com/WPtablePropertyExceptions.php + +## `CT_TblWidth` + +Bases: `BaseOxmlElement` + +Used for `w:tblW` and `w:tcW` and others, specifies a table-related width. + +### `type` + +```python +type = RequiredAttribute('w:type', ST_TblWidth) +``` + +### `w` + +```python +w: int = RequiredAttribute('w:w', XsdInt) +``` + +### `width` + +```python +width: Length | None +``` + +EMU length indicated by the combined `w:w` and `w:type` attrs. + +## `CT_Tc` + +Bases: `BaseOxmlElement` + +`w:tc` table cell element. + +### `add_p` + +```python +add_p: Callable[[], CT_P] +``` + +### `bottom` + +```python +bottom: int +``` + +The row index that marks the bottom extent of the vertical span of this cell. + +This is one greater than the index of the bottom-most row of the span, similar +to how a slice of the cell's rows would be specified. + +### `clear_content` + +```python +clear_content() +``` + +Remove all content elements, preserving `w:tcPr` element if present. + +Note that this leaves the `w:tc` element in an invalid state because it doesn't +contain at least one block-level element. It's up to the caller to add a +`w:p`child element as the last content element. + +### `get_or_add_tcPr` + +```python +get_or_add_tcPr: Callable[[], CT_TcPr] +``` + +### `grid_offset` + +```python +grid_offset: int +``` + +Starting offset of `tc` in the layout-grid columns of its table. + +A cell in the leftmost grid-column has offset 0. + +### `grid_span` + +```python +grid_span: int +``` + +The integer number of columns this cell spans. + +Determined by ./w:tcPr/w:gridSpan/@val, it defaults to 1. + +### `inner_content_elements` + +```python +inner_content_elements: list[CT_P | CT_Tbl] +``` + +Generate all `w:p` and `w:tbl` elements in this document-body. + +Elements appear in document order. Elements shaded by nesting in a `w:ins` or +other "wrapper" element will not be included. + +### `iter_block_items` + +```python +iter_block_items() +``` + +Generate a reference to each of the block-level content elements in this +cell, in the order they appear. + +### `left` + +```python +left: int +``` + +The grid column index at which this ```` element appears. + +### `merge` + +```python +merge(other_tc: CT_Tc) -> CT_Tc +``` + +Return top-left `w:tc` element of a new span. + +Span is formed by merging the rectangular region defined by using this tc +element and `other_tc` as diagonal corners. + +### `new` + +```python +new() -> CT_Tc +``` + +A new `w:tc` element, containing an empty paragraph as the required EG_BlockLevelElt. + +### `p` + +```python +p = OneOrMore('w:p') +``` + +### `p_lst` + +```python +p_lst: list[CT_P] +``` + +### `right` + +```python +right: int +``` + +The grid column index that marks the right-side extent of the horizontal span +of this cell. + +This is one greater than the index of the right-most column of the span, similar +to how a slice of the cell's columns would be specified. + +### `tbl` + +```python +tbl = OneOrMore('w:tbl') +``` + +### `tbl_lst` + +```python +tbl_lst: list[CT_Tbl] +``` + +### `tcPr` + +```python +tcPr: CT_TcPr | None = ZeroOrOne('w:tcPr') +``` + +### `top` + +```python +top: int +``` + +The top-most row index in the vertical span of this cell. + +### `vMerge` + +```python +vMerge: str | None +``` + +Value of ./w:tcPr/w:vMerge/@val, `None` if w:vMerge is not present. + +### `width` + +```python +width: Length | None +``` + +EMU length represented in `./w:tcPr/w:tcW` or `None` if not present. + +## `CT_TcPr` + +Bases: `BaseOxmlElement` + +```` element, defining table cell properties. + +### `get_or_add_gridSpan` + +```python +get_or_add_gridSpan: Callable[[], CT_DecimalNumber] +``` + +### `get_or_add_tcW` + +```python +get_or_add_tcW: Callable[[], CT_TblWidth] +``` + +### `get_or_add_vAlign` + +```python +get_or_add_vAlign: Callable[[], CT_VerticalJc] +``` + +### `gridSpan` + +```python +gridSpan: CT_DecimalNumber | None = ZeroOrOne('w:gridSpan', successors=_tag_seq[3:]) +``` + +### `grid_span` + +```python +grid_span: int +``` + +The integer number of columns this cell spans. + +Determined by ./w:gridSpan/@val, it defaults to 1. + +### `tcW` + +```python +tcW: CT_TblWidth | None = ZeroOrOne('w:tcW', successors=_tag_seq[2:]) +``` + +### `vAlign` + +```python +vAlign: CT_VerticalJc | None = ZeroOrOne('w:vAlign', successors=_tag_seq[12:]) +``` + +### `vAlign_val` + +```python +vAlign_val +``` + +Value of `w:val` attribute on `w:vAlign` child. + +Value is `None` if `w:vAlign` child is not present. The `w:val` attribute on +`w:vAlign` is required. + +### `vMerge` + +```python +vMerge: CT_VMerge | None = ZeroOrOne('w:vMerge', successors=_tag_seq[5:]) +``` + +### `vMerge_val` + +```python +vMerge_val +``` + +The value of the ./w:vMerge/@val attribute, or `None` if the w:vMerge element +is not present. + +### `width` + +```python +width: Length | None +``` + +EMU length in `./w:tcW` or `None` if not present or its type is not 'dxa'. + +## `CT_TrPr` + +Bases: `BaseOxmlElement` + +```` element, defining table row properties. + +### `get_or_add_trHeight` + +```python +get_or_add_trHeight: Callable[[], CT_Height] +``` + +### `gridAfter` + +```python +gridAfter: CT_DecimalNumber | None = ZeroOrOne('w:gridAfter', successors=_tag_seq[4:]) +``` + +### `gridBefore` + +```python +gridBefore: CT_DecimalNumber | None = ZeroOrOne('w:gridBefore', successors=_tag_seq[3:]) +``` + +### `grid_after` + +```python +grid_after: int +``` + +The number of unpopulated layout-grid cells at the end of this row. + +### `grid_before` + +```python +grid_before: int +``` + +The number of unpopulated layout-grid cells at the start of this row. + +### `trHeight` + +```python +trHeight: CT_Height | None = ZeroOrOne('w:trHeight', successors=_tag_seq[8:]) +``` + +### `trHeight_hRule` + +```python +trHeight_hRule: WD_ROW_HEIGHT_RULE | None +``` + +Return the value of `w:trHeight@w:hRule`, or `None` if not present. + +### `trHeight_val` + +```python +trHeight_val +``` + +Return the value of `w:trHeight@w:val`, or `None` if not present. + +## `CT_VMerge` + +Bases: `BaseOxmlElement` + +```` element, specifying vertical merging behavior of a cell. + +### `val` + +```python +val: str | None = OptionalAttribute('w:val', ST_Merge, default=ST_Merge.CONTINUE) +``` + +## `CT_VerticalJc` + +Bases: `BaseOxmlElement` + +`w:vAlign` element, specifying vertical alignment of cell. + +### `val` + +```python +val: WD_CELL_VERTICAL_ALIGNMENT = RequiredAttribute('w:val', WD_CELL_VERTICAL_ALIGNMENT) +``` + + + + + +# `docx.oxml.text.font` + +Custom element classes related to run properties (font). + +## `CT_Color` + +Bases: `BaseOxmlElement` + +`w:color` element, specifying the color of a font and perhaps other objects. + +### `themeColor` + +```python +themeColor: MSO_THEME_COLOR | None = OptionalAttribute('w:themeColor', MSO_THEME_COLOR) +``` + +### `val` + +```python +val: RGBColor | str = RequiredAttribute('w:val', ST_HexColor) +``` + +## `CT_Fonts` + +Bases: `BaseOxmlElement` + +`` element. + +Specifies typeface name for the various language types. + +### `ascii` + +```python +ascii: str | None = OptionalAttribute('w:ascii', ST_String) +``` + +### `hAnsi` + +```python +hAnsi: str | None = OptionalAttribute('w:hAnsi', ST_String) +``` + +## `CT_Highlight` + +Bases: `BaseOxmlElement` + +`w:highlight` element, specifying font highlighting/background color. + +### `val` + +```python +val: WD_COLOR_INDEX = RequiredAttribute('w:val', WD_COLOR_INDEX) +``` + +## `CT_HpsMeasure` + +Bases: `BaseOxmlElement` + +Used for `` element and others, specifying font size in half-points. + +### `val` + +```python +val: Length = RequiredAttribute('w:val', ST_HpsMeasure) +``` + +## `CT_RPr` + +Bases: `BaseOxmlElement` + +`` element, containing the properties for a run. + +### `b` + +```python +b: CT_OnOff | None = ZeroOrOne('w:b', successors=_tag_seq[3:]) +``` + +### `bCs` + +```python +bCs = ZeroOrOne('w:bCs', successors=_tag_seq[4:]) +``` + +### `caps` + +```python +caps = ZeroOrOne('w:caps', successors=_tag_seq[7:]) +``` + +### `color` + +```python +color: CT_Color | None = ZeroOrOne('w:color', successors=_tag_seq[19:]) +``` + +### `cs` + +```python +cs = ZeroOrOne('w:cs', successors=_tag_seq[34:]) +``` + +### `dstrike` + +```python +dstrike = ZeroOrOne('w:dstrike', successors=_tag_seq[10:]) +``` + +### `emboss` + +```python +emboss = ZeroOrOne('w:emboss', successors=_tag_seq[13:]) +``` + +### `get_or_add_color` + +```python +get_or_add_color: Callable[[], CT_Color] +``` + +### `get_or_add_highlight` + +```python +get_or_add_highlight: Callable[[], CT_Highlight] +``` + +### `get_or_add_rFonts` + +```python +get_or_add_rFonts: Callable[[], CT_Fonts] +``` + +### `get_or_add_sz` + +```python +get_or_add_sz: Callable[[], CT_HpsMeasure] +``` + +### `get_or_add_vertAlign` + +```python +get_or_add_vertAlign: Callable[[], CT_VerticalAlignRun] +``` + +### `highlight` + +```python +highlight: CT_Highlight | None = ZeroOrOne('w:highlight', successors=_tag_seq[26:]) +``` + +### `highlight_val` + +```python +highlight_val: WD_COLOR_INDEX | None +``` + +Value of `./w:highlight/@val`. + +Specifies font's highlight color, or `None` if the text is not highlighted. + +### `i` + +```python +i = ZeroOrOne('w:i', successors=_tag_seq[5:]) +``` + +### `iCs` + +```python +iCs = ZeroOrOne('w:iCs', successors=_tag_seq[6:]) +``` + +### `imprint` + +```python +imprint = ZeroOrOne('w:imprint', successors=_tag_seq[14:]) +``` + +### `noProof` + +```python +noProof = ZeroOrOne('w:noProof', successors=_tag_seq[15:]) +``` + +### `oMath` + +```python +oMath = ZeroOrOne('w:oMath', successors=_tag_seq[39:]) +``` + +### `outline` + +```python +outline = ZeroOrOne('w:outline', successors=_tag_seq[11:]) +``` + +### `rFonts` + +```python +rFonts: CT_Fonts | None = ZeroOrOne('w:rFonts', successors=_tag_seq[2:]) +``` + +### `rFonts_ascii` + +```python +rFonts_ascii: str | None +``` + +The value of `w:rFonts/@w:ascii` or `None` if not present. + +Represents the assigned typeface name. The rFonts element also specifies other +special-case typeface names; this method handles the case where just the common +name is required. + +### `rFonts_hAnsi` + +```python +rFonts_hAnsi: str | None +``` + +The value of `w:rFonts/@w:hAnsi` or `None` if not present. + +### `rStyle` + +```python +rStyle: CT_String | None = ZeroOrOne('w:rStyle', successors=_tag_seq[1:]) +``` + +### `rtl` + +```python +rtl = ZeroOrOne('w:rtl', successors=_tag_seq[33:]) +``` + +### `shadow` + +```python +shadow = ZeroOrOne('w:shadow', successors=_tag_seq[12:]) +``` + +### `smallCaps` + +```python +smallCaps = ZeroOrOne('w:smallCaps', successors=_tag_seq[8:]) +``` + +### `snapToGrid` + +```python +snapToGrid = ZeroOrOne('w:snapToGrid', successors=_tag_seq[16:]) +``` + +### `specVanish` + +```python +specVanish = ZeroOrOne('w:specVanish', successors=_tag_seq[38:]) +``` + +### `strike` + +```python +strike = ZeroOrOne('w:strike', successors=_tag_seq[9:]) +``` + +### `style` + +```python +style: str | None +``` + +String in `./w:rStyle/@val`, or None if `w:rStyle` is not present. + +### `subscript` + +```python +subscript: bool | None +``` + +`True` if `./w:vertAlign/@w:val` is "subscript". + +`False` if `w:vertAlign/@w:val` contains any other value. `None` if +`w:vertAlign` is not present. + +### `superscript` + +```python +superscript: bool | None +``` + +`True` if `w:vertAlign/@w:val` is 'superscript'. + +`False` if `w:vertAlign/@w:val` contains any other value. `None` if +`w:vertAlign` is not present. + +### `sz` + +```python +sz: CT_HpsMeasure | None = ZeroOrOne('w:sz', successors=_tag_seq[24:]) +``` + +### `sz_val` + +```python +sz_val: Length | None +``` + +The value of `w:sz/@w:val` or `None` if not present. + +### `u` + +```python +u: CT_Underline | None = ZeroOrOne('w:u', successors=_tag_seq[27:]) +``` + +### `u_val` + +```python +u_val: WD_UNDERLINE | None +``` + +Value of `w:u/@val`, or None if not present. + +Values `WD_UNDERLINE.SINGLE` and `WD_UNDERLINE.NONE` are mapped to `True` and +`False` respectively. + +### `vanish` + +```python +vanish = ZeroOrOne('w:vanish', successors=_tag_seq[17:]) +``` + +### `vertAlign` + +```python +vertAlign: CT_VerticalAlignRun | None = ZeroOrOne('w:vertAlign', successors=_tag_seq[32:]) +``` + +### `webHidden` + +```python +webHidden = ZeroOrOne('w:webHidden', successors=_tag_seq[18:]) +``` + +## `CT_Underline` + +Bases: `BaseOxmlElement` + +`` element, specifying the underlining style for a run. + +### `val` + +```python +val: WD_UNDERLINE | None = OptionalAttribute('w:val', WD_UNDERLINE) +``` + +## `CT_VerticalAlignRun` + +Bases: `BaseOxmlElement` + +`` element, specifying subscript or superscript. + +### `val` + +```python +val: str = RequiredAttribute('w:val', ST_VerticalAlignRun) +``` + + + + + +# `docx.oxml.text.hyperlink` + +Custom element classes related to hyperlinks (CT_Hyperlink). + +## `CT_Hyperlink` + +Bases: `BaseOxmlElement` + +`` element, containing the text and address for a hyperlink. + +### `anchor` + +```python +anchor: str | None = OptionalAttribute('w:anchor', ST_String) +``` + +### `history` + +```python +history: bool = OptionalAttribute('w:history', ST_OnOff, default=True) +``` + +### `lastRenderedPageBreaks` + +```python +lastRenderedPageBreaks: List[CT_LastRenderedPageBreak] +``` + +All `w:lastRenderedPageBreak` descendants of this hyperlink. + +### `r` + +```python +r = ZeroOrMore('w:r') +``` + +### `rId` + +```python +rId: str | None = OptionalAttribute('r:id', XsdString) +``` + +### `r_lst` + +```python +r_lst: List[CT_R] +``` + +### `text` + +```python +text: str +``` + +The textual content of this hyperlink. + +`CT_Hyperlink` stores the hyperlink-text as one or more `w:r` children. + + + + + +# `docx.oxml.text.pagebreak` + +Custom element class for rendered page-break (CT_LastRenderedPageBreak). + +## `CT_LastRenderedPageBreak` + +Bases: `BaseOxmlElement` + +`` element, indicating page break inserted by renderer. + +A rendered page-break is one inserted by the renderer when it runs out of room on a +page. It is an empty element (no attrs or children) and is a child of CT_R, peer to +CT_Text. + +NOTE: this complex-type name does not exist in the schema, where +`w:lastRenderedPageBreak` maps to `CT_Empty`. This name was added to give it +distinguished behavior. CT_Empty is used for many elements. + +### `following_fragment_p` + +```python +following_fragment_p: CT_P +``` + +A "loose" `CT_P` containing only the paragraph content before this break. + +Raises `ValueError` if this `w:lastRenderedPageBreak` is not the first rendered +page-break in its paragraph. + +The returned `CT_P` is a "clone" (deepcopy) of the `w:p` ancestor of this +page-break with this `w:lastRenderedPageBreak` element and all content preceding +it removed. + +NOTE: this `w:p` can itself contain one or more `w:renderedPageBreak` elements +(when the paragraph contained more than one). While this is rare, the caller +should treat this paragraph the same as other paragraphs and split it if +necessary in a folloing step or recursion. + +### `follows_all_content` + +```python +follows_all_content: bool +``` + +True when this page-break element is the last "content" in the paragraph. + +This is very uncommon case and may only occur in contrived or cases where the +XML is edited by hand, but it is not precluded by the spec. + +### `precedes_all_content` + +```python +precedes_all_content: bool +``` + +True when a `w:lastRenderedPageBreak` precedes all paragraph content. + +This is a common case; it occurs whenever the page breaks on an even paragraph +boundary. + +### `preceding_fragment_p` + +```python +preceding_fragment_p: CT_P +``` + +A "loose" `CT_P` containing only the paragraph content before this break. + +Raises `ValueError` if this `w:lastRenderedPageBreak` is not the first rendered +paragraph in its paragraph. + +The returned `CT_P` is a "clone" (deepcopy) of the `w:p` ancestor of this +page-break with this `w:lastRenderedPageBreak` element and all its following +siblings removed. + + + + + +# `docx.oxml.text.paragraph` + +Custom element classes related to paragraphs (CT_P). + +## `CT_P` + +Bases: `BaseOxmlElement` + +`` element, containing the properties and text for a paragraph. + +### `add_p_before` + +```python +add_p_before() -> CT_P +``` + +Return a new `` element inserted directly prior to this one. + +### `add_r` + +```python +add_r: Callable[[], CT_R] +``` + +### `alignment` + +```python +alignment: WD_PARAGRAPH_ALIGNMENT | None +``` + +The value of the `` grandchild element or `None` if not present. + +### `clear_content` + +```python +clear_content() +``` + +Remove all child elements, except the `` element if present. + +### `get_or_add_pPr` + +```python +get_or_add_pPr: Callable[[], CT_PPr] +``` + +### `hyperlink` + +```python +hyperlink = ZeroOrMore('w:hyperlink') +``` + +### `hyperlink_lst` + +```python +hyperlink_lst: List[CT_Hyperlink] +``` + +### `inner_content_elements` + +```python +inner_content_elements: List[CT_R | CT_Hyperlink] +``` + +Run and hyperlink children of the `w:p` element, in document order. + +### `lastRenderedPageBreaks` + +```python +lastRenderedPageBreaks: List[CT_LastRenderedPageBreak] +``` + +All `w:lastRenderedPageBreak` descendants of this paragraph. + +Rendered page-breaks commonly occur in a run but can also occur in a run inside +a hyperlink. This returns both. + +### `pPr` + +```python +pPr: CT_PPr | None = ZeroOrOne('w:pPr') +``` + +### `r` + +```python +r = ZeroOrMore('w:r') +``` + +### `r_lst` + +```python +r_lst: List[CT_R] +``` + +### `set_sectPr` + +```python +set_sectPr(sectPr: CT_SectPr) +``` + +Unconditionally replace or add `sectPr` as grandchild in correct sequence. + +### `style` + +```python +style: str | None +``` + +String contained in `w:val` attribute of `./w:pPr/w:pStyle` grandchild. + +`None` if not present. + +### `text` + +```python +text +``` + +The textual content of this paragraph. + +Inner-content child elements like `w:r` and `w:hyperlink` are translated to +their text equivalent. + + + + + +# `docx.oxml.text.parfmt` + +Custom element classes related to paragraph properties (CT_PPr). + +## `CT_Ind` + +Bases: `BaseOxmlElement` + +```` element, specifying paragraph indentation. + +### `firstLine` + +```python +firstLine: Length | None = OptionalAttribute('w:firstLine', ST_TwipsMeasure) +``` + +### `hanging` + +```python +hanging: Length | None = OptionalAttribute('w:hanging', ST_TwipsMeasure) +``` + +### `left` + +```python +left: Length | None = OptionalAttribute('w:left', ST_SignedTwipsMeasure) +``` + +### `right` + +```python +right: Length | None = OptionalAttribute('w:right', ST_SignedTwipsMeasure) +``` + +## `CT_Jc` + +Bases: `BaseOxmlElement` + +```` element, specifying paragraph justification. + +### `val` + +```python +val: WD_ALIGN_PARAGRAPH = RequiredAttribute('w:val', WD_ALIGN_PARAGRAPH) +``` + +## `CT_PPr` + +Bases: `BaseOxmlElement` + +```` element, containing the properties for a paragraph. + +### `first_line_indent` + +```python +first_line_indent: Length | None +``` + +A `Length` value calculated from the values of `w:ind/@w:firstLine` and +`w:ind/@w:hanging`. + +Returns `None` if the `w:ind` child is not present. + +### `get_or_add_ind` + +```python +get_or_add_ind: Callable[[], CT_Ind] +``` + +### `get_or_add_pStyle` + +```python +get_or_add_pStyle: Callable[[], CT_String] +``` + +### `get_or_add_sectPr` + +```python +get_or_add_sectPr: Callable[[], CT_SectPr] +``` + +### `ind` + +```python +ind: CT_Ind | None = ZeroOrOne('w:ind', successors=_tag_seq[23:]) +``` + +### `ind_left` + +```python +ind_left: Length | None +``` + +The value of `w:ind/@w:left` or `None` if not present. + +### `ind_right` + +```python +ind_right: Length | None +``` + +The value of `w:ind/@w:right` or `None` if not present. + +### `jc` + +```python +jc = ZeroOrOne('w:jc', successors=_tag_seq[27:]) +``` + +### `jc_val` + +```python +jc_val: WD_ALIGN_PARAGRAPH | None +``` + +Value of the `` child element or `None` if not present. + +### `keepLines` + +```python +keepLines = ZeroOrOne('w:keepLines', successors=_tag_seq[3:]) +``` + +### `keepLines_val` + +```python +keepLines_val +``` + +The value of `keepLines/@val` or `None` if not present. + +### `keepNext` + +```python +keepNext = ZeroOrOne('w:keepNext', successors=_tag_seq[2:]) +``` + +### `keepNext_val` + +```python +keepNext_val +``` + +The value of `keepNext/@val` or `None` if not present. + +### `numPr` + +```python +numPr = ZeroOrOne('w:numPr', successors=_tag_seq[7:]) +``` + +### `outlineLvl` + +```python +outlineLvl: CT_DecimalNumber = ZeroOrOne('w:outlineLvl', successors=_tag_seq[31:]) +``` + +### `pStyle` + +```python +pStyle: CT_String | None = ZeroOrOne('w:pStyle', successors=_tag_seq[1:]) +``` + +### `pageBreakBefore` + +```python +pageBreakBefore = ZeroOrOne('w:pageBreakBefore', successors=_tag_seq[4:]) +``` + +### `pageBreakBefore_val` + +```python +pageBreakBefore_val +``` + +The value of `pageBreakBefore/@val` or `None` if not present. + +### `sectPr` + +```python +sectPr = ZeroOrOne('w:sectPr', successors=_tag_seq[35:]) +``` + +### `spacing` + +```python +spacing = ZeroOrOne('w:spacing', successors=_tag_seq[22:]) +``` + +### `spacing_after` + +```python +spacing_after +``` + +The value of `w:spacing/@w:after` or `None` if not present. + +### `spacing_before` + +```python +spacing_before +``` + +The value of `w:spacing/@w:before` or `None` if not present. + +### `spacing_line` + +```python +spacing_line +``` + +The value of `w:spacing/@w:line` or `None` if not present. + +### `spacing_lineRule` + +```python +spacing_lineRule +``` + +The value of `w:spacing/@w:lineRule` as a member of the `WdLineSpacing` +enumeration. + +Only the `MULTIPLE`, `EXACTLY`, and `AT_LEAST` members are used. It is the +responsibility of the client to calculate the use of `SINGLE`, `DOUBLE`, and +`MULTIPLE` based on the value of `w:spacing/@w:line` if that behavior is +desired. + +### `style` + +```python +style: str | None +``` + +String contained in `./w:pStyle/@val`, or None if child is not present. + +### `tabs` + +```python +tabs = ZeroOrOne('w:tabs', successors=_tag_seq[11:]) +``` + +### `widowControl` + +```python +widowControl = ZeroOrOne('w:widowControl', successors=_tag_seq[6:]) +``` + +### `widowControl_val` + +```python +widowControl_val +``` + +The value of `widowControl/@val` or `None` if not present. + +## `CT_Spacing` + +Bases: `BaseOxmlElement` + +```` element, specifying paragraph spacing attributes such as space +before and line spacing. + +### `after` + +```python +after = OptionalAttribute('w:after', ST_TwipsMeasure) +``` + +### `before` + +```python +before = OptionalAttribute('w:before', ST_TwipsMeasure) +``` + +### `line` + +```python +line = OptionalAttribute('w:line', ST_SignedTwipsMeasure) +``` + +### `lineRule` + +```python +lineRule = OptionalAttribute('w:lineRule', WD_LINE_SPACING) +``` + +## `CT_TabStop` + +Bases: `BaseOxmlElement` + +`` element, representing an individual tab stop. + +Overloaded to use for a tab-character in a run, which also uses the w:tab tag but +only needs a __str__ method. + +### `leader` + +```python +leader: WD_TAB_LEADER | None = OptionalAttribute('w:leader', WD_TAB_LEADER, default=WD_TAB_LEADER.SPACES) +``` + +### `pos` + +```python +pos: Length = RequiredAttribute('w:pos', ST_SignedTwipsMeasure) +``` + +### `val` + +```python +val: WD_TAB_ALIGNMENT = RequiredAttribute('w:val', WD_TAB_ALIGNMENT) +``` + +## `CT_TabStops` + +Bases: `BaseOxmlElement` + +```` element, container for a sorted sequence of tab stops. + +### `insert_tab_in_order` + +```python +insert_tab_in_order(pos, align, leader) +``` + +Insert a newly created `w:tab` child element in `pos` order. + +### `tab` + +```python +tab = OneOrMore('w:tab', successors=()) +``` + + + + + +# `docx.oxml.text.run` + +Custom element classes related to text runs (CT_R). + +## `CT_Br` + +Bases: `BaseOxmlElement` + +`` element, indicating a line, page, or column break in a run. + +### `clear` + +```python +clear: str | None = OptionalAttribute('w:clear', ST_BrClear) +``` + +### `type` + +```python +type: str | None = OptionalAttribute('w:type', ST_BrType, default='textWrapping') +``` + +## `CT_Cr` + +Bases: `BaseOxmlElement` + +`` element, representing a carriage-return (0x0D) character within a run. + + In Word, this represents a "soft carriage-return" in the sense that it does not end + the paragraph the way pressing Enter (aka. Return) on the keyboard does. Here the + text equivalent is considered to be newline (" +") since in plain-text that's the + closest Python equivalent. + + NOTE: this complex-type name does not exist in the schema, where `w:tab` maps to + `CT_Empty`. This name was added to give it distinguished behavior. CT_Empty is used + for many elements. + +## `CT_NoBreakHyphen` + +Bases: `BaseOxmlElement` + +`` element, a hyphen ineligible for a line-wrap position. + +This maps to a plain-text dash ("-"). + +NOTE: this complex-type name does not exist in the schema, where `w:noBreakHyphen` +maps to `CT_Empty`. This name was added to give it behavior distinguished from the +many other elements represented in the schema by CT_Empty. + +## `CT_PTab` + +Bases: `BaseOxmlElement` + +`` element, representing an absolute-position tab character within a run. + +This character advances the rendering position to the specified position regardless +of any tab-stops, perhaps for layout of a table-of-contents (TOC) or similar. + +## `CT_R` + +Bases: `BaseOxmlElement` + +`` element, containing the properties and text for a run. + +### `add_br` + +```python +add_br: Callable[[], CT_Br] +``` + +### `add_drawing` + +```python +add_drawing(inline_or_anchor: CT_Inline | CT_Anchor) -> CT_Drawing +``` + +Return newly appended `CT_Drawing` (`w:drawing`) child element. + +The `w:drawing` element has `inline_or_anchor` as its child. + +### `add_t` + +```python +add_t(text: str) -> CT_Text +``` + +Return a newly added `` element containing `text`. + +### `add_tab` + +```python +add_tab: Callable[[], CT_TabStop] +``` + +### `br` + +```python +br = ZeroOrMore('w:br') +``` + +### `clear_content` + +```python +clear_content() -> None +``` + +Remove all child elements except a `w:rPr` element if present. + +### `cr` + +```python +cr = ZeroOrMore('w:cr') +``` + +### `drawing` + +```python +drawing = ZeroOrMore('w:drawing') +``` + +### `get_or_add_rPr` + +```python +get_or_add_rPr: Callable[[], CT_RPr] +``` + +### `inner_content_items` + +```python +inner_content_items: List[str | CT_Drawing | CT_LastRenderedPageBreak] +``` + +Text of run, possibly punctuated by `w:lastRenderedPageBreak` elements. + +### `insert_comment_range_end_and_reference_below` + +```python +insert_comment_range_end_and_reference_below(comment_id: int) -> None +``` + +Insert a `w:commentRangeEnd` and `w:commentReference` element after this run. + +The `w:commentRangeEnd` element is the immediate sibling of this `w:r` and is followed by +a `w:r` containing the `w:commentReference` element. + +### `insert_comment_range_start_above` + +```python +insert_comment_range_start_above(comment_id: int) -> None +``` + +Insert a `w:commentRangeStart` element with `comment_id` before this run. + +### `lastRenderedPageBreaks` + +```python +lastRenderedPageBreaks: List[CT_LastRenderedPageBreak] +``` + +All `w:lastRenderedPageBreaks` descendants of this run. + +### `rPr` + +```python +rPr: CT_RPr | None = ZeroOrOne('w:rPr') +``` + +### `style` + +```python +style: str | None +``` + +String contained in `w:val` attribute of `w:rStyle` grandchild. + +`None` if that element is not present. + +### `t` + +```python +t = ZeroOrMore('w:t') +``` + +### `tab` + +```python +tab = ZeroOrMore('w:tab') +``` + +### `text` + +```python +text: str +``` + +The textual content of this run. + +Inner-content child elements like `w:tab` are translated to their text +equivalent. + +## `CT_Text` + +Bases: `BaseOxmlElement` + +`` element, containing a sequence of characters within a run. + + + + + +# `docx.oxml.xmlchemy` + +Enabling declarative definition of lxml custom element classes. + +## `BaseAttribute` + +```python +BaseAttribute(attr_name: str, simple_type: Type[BaseXmlEnum] | Type[BaseSimpleType]) +``` + +Base class for OptionalAttribute and RequiredAttribute. + +Provides common methods. + +### `populate_class_members` + +```python +populate_class_members(element_cls: MetaOxmlElement, prop_name: str) -> None +``` + +Add the appropriate methods to `element_cls`. + +## `BaseOxmlElement` + +Bases: `ElementBase` + +Effective base class for all custom element classes. + +Adds standardized behavior to all classes in one place. + +### `first_child_found_in` + +```python +first_child_found_in(*tagnames: str) -> _Element | None +``` + +First child with tag in `tagnames`, or None if not found. + +### `insert_element_before` + +```python +insert_element_before(elm: ElementBase, *tagnames: str) +``` + +### `remove_all` + +```python +remove_all(*tagnames: str) -> None +``` + +Remove child elements with tagname (e.g. "a:p") in `tagnames`. + +### `xml` + +```python +xml: str +``` + +XML string for this element, suitable for testing purposes. + +Pretty printed for readability and without an XML declaration at the top. + +### `xpath` + +```python +xpath(xpath_str: str) -> Any +``` + +Override of `lxml` _Element.xpath() method. + +Provides standard Open XML namespace mapping (`nsmap`) in centralized location. + +## `Choice` + +Bases: `_BaseChildElement` + +Defines a child element belonging to a group, only one of which may appear as a child. + +### `nsptagname` + +```python +nsptagname +``` + +### `populate_class_members` + +```python +populate_class_members(element_cls: MetaOxmlElement, group_prop_name: str, successors: tuple[str, ...]) -> None +``` + +Add the appropriate methods to `element_cls`. + +## `MetaOxmlElement` + +```python +MetaOxmlElement(clsname: str, bases: tuple[type, ...], namespace: dict[str, Any]) +``` + +Bases: `type` + +Metaclass for BaseOxmlElement. + +## `OneAndOnlyOne` + +```python +OneAndOnlyOne(nsptagname: str) +``` + +Bases: `_BaseChildElement` + +Defines a required child element for MetaOxmlElement. + +### `populate_class_members` + +```python +populate_class_members(element_cls: MetaOxmlElement, prop_name: str) -> None +``` + +Add the appropriate methods to `element_cls`. + +## `OneOrMore` + +Bases: `_BaseChildElement` + +Defines a repeating child element for MetaOxmlElement that must appear at least +once. + +### `populate_class_members` + +```python +populate_class_members(element_cls: MetaOxmlElement, prop_name: str) -> None +``` + +Add the appropriate methods to `element_cls`. + +## `OptionalAttribute` + +```python +OptionalAttribute(attr_name: str, simple_type: Type[BaseXmlEnum] | Type[BaseSimpleType], default: BaseXmlEnum | BaseSimpleType | str | bool | None = None) +``` + +Bases: `BaseAttribute` + +Defines an optional attribute on a custom element class. + +An optional attribute returns a default value when not present for reading. When +assigned `None`, the attribute is removed, but still returns the default value when +one is specified. + +## `RequiredAttribute` + +Bases: `BaseAttribute` + +Defines a required attribute on a custom element class. + +A required attribute is assumed to be present for reading, so does not have a +default value; its actual value is always used. If missing on read, an +`InvalidXmlError` is raised. It also does not remove the attribute if `None` is +assigned. Assigning `None` raises `TypeError` or `ValueError`, depending on the +simple type of the attribute. + +## `XmlString` + +Bases: `str` + +Provides string comparison override suitable for serialized XML that is useful +for tests. + +## `ZeroOrMore` + +Bases: `_BaseChildElement` + +Defines an optional repeating child element for MetaOxmlElement. + +### `populate_class_members` + +```python +populate_class_members(element_cls: MetaOxmlElement, prop_name: str) -> None +``` + +Add the appropriate methods to `element_cls`. + +## `ZeroOrOne` + +Bases: `_BaseChildElement` + +Defines an optional child element for MetaOxmlElement. + +### `populate_class_members` + +```python +populate_class_members(element_cls: MetaOxmlElement, prop_name: str) -> None +``` + +Add the appropriate methods to `element_cls`. + +## `ZeroOrOneChoice` + +```python +ZeroOrOneChoice(choices: Sequence[Choice], successors: tuple[str, ...] = ()) +``` + +Bases: `_BaseChildElement` + +Correspondes to an ``EG_*`` element group where at most one of its members may +appear as a child. + +### `populate_class_members` + +```python +populate_class_members(element_cls: MetaOxmlElement, prop_name: str) -> None +``` + +Add the appropriate methods to `element_cls`. + +## `serialize_for_reading` + +```python +serialize_for_reading(element: ElementBase) +``` + +Serialize `element` to human-readable XML suitable for tests. + +No XML declaration. + + + + + +# `docx.package` + +WordprocessingML Package class and related objects. + +## `CompareFinding` + +```python +CompareFinding(kind: str, story: str, detail: str) -> None +``` + +One difference compare REPORTS instead of redlining (declared limit). + +### `detail` + +```python +detail: str +``` + +### `kind` + +```python +kind: str +``` + +### `story` + +```python +story: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `CompareResult` + +```python +CompareResult(document: 'Document', findings: List[CompareFinding], revision_count: int, stories: Tuple[str, ...]) -> None +``` + +The redlined document plus everything compare could not redline. + +### `document` + +```python +document: 'Document' +``` + +### `findings` + +```python +findings: List[CompareFinding] +``` + +### `revision_count` + +```python +revision_count: int +``` + +### `stories` + +```python +stories: Tuple[str, ...] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `ImageParts` + +```python +ImageParts() +``` + +Collection of `ImagePart` objects corresponding to images in the package. + +### `append` + +```python +append(item: ImagePart) +``` + +### `get_or_add_image_part` + +```python +get_or_add_image_part(image_descriptor: str | IO[bytes]) -> ImagePart +``` + +Return `ImagePart` object containing image identified by `image_descriptor`. + +The image-part is newly created if a matching one is not present in the +collection. + +## `Package` + +Bases: `OpcPackage` + +Customizations specific to a WordprocessingML package. + +### `after_unmarshal` + +```python +after_unmarshal() +``` + +Called by loading code after all parts and relationships have been loaded. + +This method affords the opportunity for any required post-processing. + +### `get_or_add_image_part` + +```python +get_or_add_image_part(image_descriptor: str | IO[bytes]) -> ImagePart +``` + +Return `ImagePart` containing image specified by `image_descriptor`. + +The image-part is newly created if a matching one is not already present in the +collection. + +### `image_parts` + +```python +image_parts() -> ImageParts +``` + +`ImageParts` collection object for this package. + +## `PackageDiagnosis` + +```python +PackageDiagnosis(path: str, readable: bool, kind: str, problems: Tuple[str, ...]) -> None +``` + +Typed triage for a file `docx.Document()` may refuse or crash on. + +`readable` means "this package can open it as a WordprocessingML +document"; `kind` names what the file actually is; `problems` say why it +is not readable (empty when it is). + +### `kind` + +```python +kind: str +``` + +### `path` + +```python +path: str +``` + +### `problems` + +```python +problems: Tuple[str, ...] +``` + +### `readable` + +```python +readable: bool +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `PackageDiff` + +```python +PackageDiff(added: Tuple[str, ...], removed: Tuple[str, ...], changed: Tuple[PartDiff, ...], byte_identical_count: int) -> None +``` + +Part-by-part comparison of two OPC packages. + +### `added` + +```python +added: Tuple[str, ...] +``` + +### `byte_identical_count` + +```python +byte_identical_count: int +``` + +### `changed` + +```python +changed: Tuple[PartDiff, ...] +``` + +### `is_semantically_empty` + +```python +is_semantically_empty: bool +``` + +True when the packages hold the same parts with the same meaning. + +### `removed` + +```python +removed: Tuple[str, ...] +``` + +### `semantic_changed_parts` + +```python +semantic_changed_parts() -> Tuple[str, ...] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `PartDiff` + +```python +PartDiff(part: str, kind: str, before_sha256: str, after_sha256: str, semantic_change: bool) -> None +``` + +One byte-changed part in a package comparison. + +### `after_sha256` + +```python +after_sha256: str +``` + +### `before_sha256` + +```python +before_sha256: str +``` + +### `kind` + +```python +kind: str +``` + +### `part` + +```python +part: str +``` + +### `semantic_change` + +```python +semantic_change: bool +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `PatchSaveResult` + +```python +PatchSaveResult(restored_parts: Tuple[str, ...], changed_parts: Tuple[str, ...], added_parts: Tuple[str, ...], removed_parts: Tuple[str, ...], verbatim_copy: bool) -> None +``` + +Outcome of a `patch_save` call. + +### `added_parts` + +```python +added_parts: Tuple[str, ...] +``` + +### `changed_parts` + +```python +changed_parts: Tuple[str, ...] +``` + +### `removed_parts` + +```python +removed_parts: Tuple[str, ...] +``` + +### `restored_parts` + +```python +restored_parts: Tuple[str, ...] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +### `verbatim_copy` + +```python +verbatim_copy: bool +``` + +## `StoryTextDiff` + +```python +StoryTextDiff(story: str, diff_lines: Tuple[str, ...]) -> None +``` + +### `diff_lines` + +```python +diff_lines: Tuple[str, ...] +``` + +### `story` + +```python +story: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `TextDiff` + +```python +TextDiff(stories: Tuple[StoryTextDiff, ...]) -> None +``` + +Per-story unified diffs of visible block text. + +### `changed_line_count` + +```python +changed_line_count: int +``` + +### `is_empty` + +```python +is_empty: bool +``` + +### `stories` + +```python +stories: Tuple[StoryTextDiff, ...] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `compare` + +```python +compare(original, revised, *, author: str, date: 'Optional[dt.datetime]' = None, granularity: str = 'word', materialize: Optional[str] = None) -> CompareResult +``` + +A `CompareResult`: `original` plus tracked changes producing `revised`. + +Takes paths or bytes. `granularity` is "word" or "block". Inputs carrying pending +revisions refuse unless `materialize` ("accept" | "reject") resolves them on in-memory +copies, leaving the files on disk untouched. Refuses any edit it cannot express as a +clean redline. + +## `diagnose` + +```python +diagnose(path: _PathLike) -> PackageDiagnosis +``` + +Why the file at `path` can or cannot be opened, as a `PackageDiagnosis`. + +Returns instead of raising, so you can triage untrusted input before opening it. +`Document()` refuses corrupt and encrypted packages with `MalformedPackageError` but +still raises a bare `ValueError` for macro-enabled and template files. + +## `diff_package` + +```python +diff_package(path_a: _PathLike, path_b: _PathLike) -> PackageDiff +``` + +Part-by-part diff of the OPC packages at `path_a` and `path_b`. + +XML parts (`*.xml`, `*.rels`) compare semantically, binary parts by bytes. A +byte-changed XML part that fails to parse counts as semantically changed, never +silently equal. Raises `MalformedPackageError` when either package will not open. + +## `patch_save` + +```python +patch_save(original_path: _PathLike, document: 'Document', out_path: _PathLike) -> PatchSaveResult +``` + +Save `document` to `out_path`, restoring original bytes wherever possible. + +The document is serialized normally, then every XML part semantically identical to its +counterpart in `original_path` gets that counterpart's exact original bytes back, a +narrow save that keeps unrelated parts byte-stable through the open/edit/save cycle. +When nothing changed, `out_path` becomes a verbatim copy of the original. + +`original_path == out_path` is permitted; the original bytes are read up front and the +write is atomic (temp file + rename), so the original survives a mid-write failure. An +existing destination keeps its permission bits; a new one inherits `original_path`'s. +Creates the destination's parent directory when it is missing. + +Returns a `PatchSaveResult` naming what it restored and what it rewrote. Raises +`MalformedPackageError` when `original_path`, the serialized document, or the finished +output fails to reparse, and `OSError` when a destination symlink moves mid-save. + +## `pending_changes` + +```python +pending_changes(path: _PathLike) -> TextDiff +``` + +What the document's pending revisions would change if all were accepted. + +Diffs the "original" view against the "current" view, so an empty `TextDiff` means no +visible TEXT change rather than a clean document: formatting-only, table-structure and +same-place move revisions produce no diff lines. Ask `Document.revisions` whether markup +remains. + +## `text_diff` + +```python +text_diff(path_a: _PathLike, path_b: _PathLike, *, view: str = 'current') -> TextDiff +``` + +What changed, textually, between the documents at `path_a` and `path_b`. + +## `xml_equivalent` + +```python +xml_equivalent(a: bytes, b: bytes) -> bool +``` + +True when `a` and `b` are structurally identical XML documents. + +Tags and attribute names compare in Clark notation, so namespace *prefix* +choices never matter while namespace URIs always do. Attribute order is +insignificant (XML defines attributes as unordered); child order is +significant; text and tail content compare verbatim, whitespace included +(a canonicalizer that trims a meaningful trailing space would corrupt +documents through `patch_save`). Prolog/epilog comments and +processing instructions are compared too. + +Raises `lxml.etree.XMLSyntaxError` on malformed input and +``UnsupportedXmlError`` on DTD-bearing input — this function never guesses. + +Known limit: attribute VALUES holding +QNames compare textually, so a prefix rebound to a different URI while +the QName text stays identical is not detected. OOXML producers keep the +standard prefixes, and the error direction in `diff_package` remains +conservative for everything else. + + + + + +# `docx.parts.comments` + +Contains comments added to the document. + +## `CommentsPart` + +```python +CommentsPart(partname: PackURI, content_type: str, element: CT_Comments, package: Package) +``` + +Bases: `StoryPart` + +Container part for comments added to the document. + +### `comments` + +```python +comments: Comments +``` + +A `Comments` proxy object for the `w:comments` root element of this part. + +### `default` + +```python +default(package: Package) -> Self +``` + +A newly created comments part, containing a default empty `w:comments` element. + + + + + +# `docx.parts.document` + +`DocumentPart` and closely related objects. + +## `DocumentPart` + +Bases: `StoryPart` + +Main document part of a WordprocessingML (WML) package, aka a .docx file. + +Acts as broker to other parts such as image, core properties, and style parts. It +also acts as a convenient delegate when a mid-document object needs a service +involving a remote ancestor. The `Parented.part` property inherited by many content +objects provides access to this part object for that purpose. + +### `add_footer_part` + +```python +add_footer_part() +``` + +Return (footer_part, rId) pair for newly-created footer part. + +### `add_header_part` + +```python +add_header_part() +``` + +Return (header_part, rId) pair for newly-created header part. + +### `comments` + +```python +comments: Comments +``` + +`Comments` object providing access to the comments added to this document. + +### `core_properties` + +```python +core_properties: CoreProperties +``` + +A `CoreProperties` object providing read/write access to the core properties +of this document. + +### `document` + +```python +document +``` + +A `Document` object providing access to the content of this document. + +### `drop_header_part` + +```python +drop_header_part(rId: str) -> None +``` + +Remove related header part identified by `rId`. + +### `footer_part` + +```python +footer_part(rId: str) +``` + +Return `FooterPart` related by `rId`. + +### `get_style` + +```python +get_style(style_id: str | None, style_type: WD_STYLE_TYPE) -> BaseStyle +``` + +Return the style in this document matching `style_id`. + +Returns the default style for `style_type` if `style_id` is `None` or does not +match a defined style of `style_type`. + +### `get_style_id` + +```python +get_style_id(style_or_name, style_type) +``` + +Return the style_id (`str`) of the style of `style_type` matching +`style_or_name`. + +Returns `None` if the style resolves to the default style for `style_type` or if +`style_or_name` is itself `None`. Raises if `style_or_name` is a style of the +wrong type or names a style not present in the document. + +### `header_part` + +```python +header_part(rId: str) +``` + +Return `HeaderPart` related by `rId`. + +### `inline_shapes` + +```python +inline_shapes() +``` + +The `InlineShapes` instance containing the inline shapes in the document. + +### `numbering_part` + +```python +numbering_part() -> NumberingPart +``` + +A `NumberingPart` object providing access to the numbering definitions for this document. + +Creates an empty numbering part if one is not present. + +### `save` + +```python +save(path_or_stream: str | IO[bytes]) +``` + +Save this document to `path_or_stream`, which can be either a path to a +filesystem location (a string) or a file-like object. + +### `settings` + +```python +settings: Settings +``` + +A `Settings` object providing access to the settings in the settings part of +this document. + +### `styles` + +```python +styles +``` + +A `Styles` object providing access to the styles in the styles part of this +document. + + + + + +# `docx.parts.endnotes` + +`EndnotesPart`, the story part containing a document's endnotes. + +## `EndnotesPart` + +Bases: `StoryPart` + +Proxy for the endnotes part (`word/endnotes.xml`) of a document. + +Registered for its content type so endnote content loads as a live XML +part (visible to `docx.story` traversal) instead of an opaque blob. +paper-docx v0 reads endnotes; it does not create the part. + + + + + +# `docx.parts.footnotes` + +`FootnotesPart`, the story part containing a document's footnotes. + +## `FootnotesPart` + +Bases: `StoryPart` + +Proxy for the footnotes part (`word/footnotes.xml`) of a document. + +Registered for its content type so footnote content loads as a live XML +part (visible to `docx.story` traversal) instead of an opaque blob. +paper-docx v0 reads footnotes; it does not create the part. + + + + + +# `docx.parts.hdrftr` + +Header and footer part objects. + +## `FooterPart` + +Bases: `StoryPart` + +Definition of a section footer. + +### `new` + +```python +new(package: Package) +``` + +Return newly created footer part. + +## `HeaderPart` + +Bases: `StoryPart` + +Definition of a section header. + +### `new` + +```python +new(package: Package) +``` + +Return newly created header part. + + + + + +# `docx.parts.image` + +The proxy class for an image part, and related objects. + +## `ImagePart` + +```python +ImagePart(partname: PackURI, content_type: str, blob: bytes, image: Image | None = None) +``` + +Bases: `Part` + +An image part. + +Corresponds to the target part of a relationship with type RELATIONSHIP_TYPE.IMAGE. + +### `default_cx` + +```python +default_cx +``` + +Native width of this image, calculated from its width in pixels and +horizontal dots per inch (dpi). + +### `default_cy` + +```python +default_cy +``` + +Native height of this image, calculated from its height in pixels and +vertical dots per inch (dpi). + +### `filename` + +```python +filename +``` + +Filename from which this image part was originally created. + +A generic name, e.g. 'image.png', is substituted if no name is available, for +example when the image was loaded from an unnamed stream. In that case a default +extension is applied based on the detected MIME type of the image. + +### `from_image` + +```python +from_image(image: Image, partname: PackURI) +``` + +Return an `ImagePart` instance newly created from `image` and assigned +`partname`. + +### `image` + +```python +image: Image +``` + +### `load` + +```python +load(partname: PackURI, content_type: str, blob: bytes, package: OpcPackage) +``` + +Called by ``docx.opc.package.PartFactory`` to load an image part from a +package being opened by ``Document(...)`` call. + +### `sha1` + +```python +sha1 +``` + +SHA1 hash digest of the blob of this image part. + + + + + +# `docx.parts.numbering` + +`NumberingPart` and closely related objects. + +## `NumberingPart` + +Bases: `XmlPart` + +Proxy for the numbering.xml part containing numbering definitions for a document +or glossary. + +### `new` + +```python +new() -> NumberingPart +``` + +Newly created numbering part, containing only the root ```` element. + +### `numbering_definitions` + +```python +numbering_definitions() +``` + +The `_NumberingDefinitions` instance containing the numbering definitions +( element proxies) for this numbering part. + + + + + +# `docx.parts.settings` + +`SettingsPart` and closely related objects. + +## `SettingsPart` + +```python +SettingsPart(partname: PackURI, content_type: str, element: CT_Settings, package: Package) +``` + +Bases: `XmlPart` + +Document-level settings part of a WordprocessingML (WML) package. + +### `default` + +```python +default(package: Package) +``` + +Return a newly created settings part, containing a default `w:settings` element tree. + +### `settings` + +```python +settings: Settings +``` + +A `Settings` proxy object for the `w:settings` element in this part. + +Contains the document-level settings for this document. + + + + + +# `docx.parts.story` + +`StoryPart` and related objects. + +## `StoryPart` + +Bases: `XmlPart` + +Base class for story parts. + +A story part is one that can contain textual content, such as the document-part and +header or footer parts. These all share content behaviors like `.paragraphs`, +`.add_paragraph()`, `.add_table()` etc. + +### `get_or_add_image` + +```python +get_or_add_image(image_descriptor: str | IO[bytes]) -> Tuple[str, Image] +``` + +Return (rId, image) pair for image identified by `image_descriptor`. + +`rId` is the str key (often like "rId7") for the relationship between this story +part and the image part, reused if already present, newly created if not. +`image` is an `Image` instance providing access to the properties of the image, +such as dimensions and image type. + +### `get_style` + +```python +get_style(style_id: str | None, style_type: WD_STYLE_TYPE) -> BaseStyle +``` + +Return the style in this document matching `style_id`. + +Returns the default style for `style_type` if `style_id` is `None` or does not +match a defined style of `style_type`. + +### `get_style_id` + +```python +get_style_id(style_or_name: BaseStyle | str | None, style_type: WD_STYLE_TYPE) -> str | None +``` + +Return str style_id for `style_or_name` of `style_type`. + +Returns `None` if the style resolves to the default style for `style_type` or if +`style_or_name` is itself `None`. Raises if `style_or_name` is a style of the +wrong type or names a style not present in the document. + +### `new_pic_inline` + +```python +new_pic_inline(image_descriptor: str | IO[bytes], width: int | Length | None = None, height: int | Length | None = None) -> CT_Inline +``` + +Return a newly-created `w:inline` element. + +The element contains the image specified by `image_descriptor` and is scaled +based on the values of `width` and `height`. + +### `next_id` + +```python +next_id: int +``` + +Next available positive integer id value in this story XML document. + +The value is determined by incrementing the maximum existing id value. Gaps in +the existing id sequence are not filled. The id attribute value is unique in the +document, without regard to the element type it appears on. + + + + + +# `docx.parts.styles` + +Provides StylesPart and related objects. + +## `StylesPart` + +Bases: `XmlPart` + +Proxy for the styles.xml part containing style definitions for a document or +glossary. + +### `default` + +```python +default(package: OpcPackage) -> StylesPart +``` + +Return a newly created styles part, containing a default set of elements. + +### `styles` + +```python +styles +``` + +The `_Styles` instance containing the styles ( element proxies) for +this styles part. + + + + + +# `docx.protection` + +Document-protection awareness (paper-docx). + +## `OPERATION_CLASSES` + +```python +OPERATION_CLASSES = (OP_COMMENT, OP_FORM_FIELD, OP_BODY) +``` + +## `OP_BODY` + +```python +OP_BODY = 'body-content' +``` + +## `OP_COMMENT` + +```python +OP_COMMENT = 'comment' +``` + +## `OP_FORM_FIELD` + +```python +OP_FORM_FIELD = 'form-field-value' +``` + +## `ProtectionStatus` + +```python +ProtectionStatus(edit: Optional[str], enforced: bool, acknowledged: bool, formatting: bool = False) -> None +``` + +What `w:documentProtection` declares, read-only. + +`edit` is the raw `w:edit` token ("readOnly", "forms", "comments", +"trackedChanges", or unrestricted "none") or None when no edit restriction is declared; +`formatting` reflects the independent format restriction. `enforced` +reports active enforcement of either kind; `acknowledged` is this +package's in-memory override flag (never persisted). + +### `acknowledged` + +```python +acknowledged: bool +``` + +### `blocks_paper_edits` + +```python +blocks_paper_edits: bool +``` + +True when protection is enforced and has not been acknowledged. + +Not a prediction of whether a call will refuse: it ignores the operation class, so it +reports True under trackedChanges or formatting-only protection where the gate still +permits body edits and comments. Call `acknowledge_protection` to proceed deliberately. + +### `edit` + +```python +edit: Optional[str] +``` + +### `enforced` + +```python +enforced: bool +``` + +### `formatting` + +```python +formatting: bool = False +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `acknowledge_protection` + +```python +acknowledge_protection(document: 'Document') -> ProtectionStatus +``` + +Explicitly override protection for this open package (in-memory only). + +The single sanctioned override affordance: after this call, paper-docx +mutating APIs proceed on this document despite `w:documentProtection`. +Nothing is written to the file — the protection setting itself is never +touched. Returns the status being overridden so callers can log it. + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `protection_status` + +```python +protection_status(document: 'Document') -> ProtectionStatus +``` + +The document's `w:documentProtection` state (report-only). + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + +## `set_protection` + +```python +set_protection(document: 'Document', *, edit: str) -> ProtectionStatus +``` + +Turn Restrict Editing on for delivery (`w:documentProtection`). + +`edit` is a Word token: `readOnly`, `comments`, `forms`, or +`trackedChanges`. This writes the setting; it does not strip one. +Paper mutators then refuse until `acknowledge_protection`. + + + + + +# `docx.revision` + +Revision enumeration and resolution (paper-docx, `Document.revisions`). + +## `RESOLVABLE_TYPES` + +```python +RESOLVABLE_TYPES = frozenset({'insertion', 'deletion', 'format_change', 'row_insertion', 'row_deletion', 'move_from', 'move_to'}) +``` + +## `Revision` + +```python +Revision(revision_type: str, author: str, date: Optional[dt.datetime], text: str, story: str, anchor: Anchor, is_paragraph_mark: bool, _element: '_Element', _document: 'Optional[Document]' = None, _snapshot_signature: 'Tuple[_Element, ...]' = ()) -> None +``` + +One tracked change, addressable — and resolvable when supported. + +Resolvable `revision_type`s: "insertion", "deletion", "format_change" +(`w:rPrChange`/`w:pPrChange`, run or paragraph mark), "row_insertion", +"row_deletion" (`w:trPr` row markers), and — as paired units — +"move_from"/"move_to". The exotic remainder ("table_property_change", +"cell_revision", "section_property_change", "numbering_change", +"custom_xml_revision") is enumerated and counted but resolution is +refused by name — claiming to resolve them would report false state. + +### `accept` + +```python +accept() -> None +``` + +Apply this change to the document. + +Tracked moves resolve as a PAIR: accepting either site accepts both. Resolution can +remove paragraphs, rows, tables, comments and note bodies along with the markup. +Refuses a protected document, and revision types this package cannot resolve, leaving +the document untouched. + +### `anchor` + +```python +anchor: Anchor +``` + +### `author` + +```python +author: str +``` + +### `date` + +```python +date: Optional[dt.datetime] +``` + +### `is_paragraph_mark` + +```python +is_paragraph_mark: bool +``` + +### `is_resolvable` + +```python +is_resolvable: bool +``` + +### `reject` + +```python +reject() -> None +``` + +Undo this change, restoring the pre-change content. + +Tracked moves resolve as a PAIR: rejecting either site rejects both. Restores `w:delText` +back to `w:t`. Refuses a protected document, and revision types this package cannot +resolve, leaving the document untouched. + +### `revision_type` + +```python +revision_type: str +``` + +### `story` + +```python +story: str +``` + +### `text` + +```python +text: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `Revisions` + +```python +Revisions(document: 'Document') -> None +``` + +Bases: `Sequence[Revision]` + +All tracked changes in a document, across every story part. + +A fresh snapshot is enumerated on each `Document.revisions` access; +mutation through another snapshot invalidates this snapshot and its +previously-held `Revision` objects. Stale resolution attempts refuse. + +### `accept_all` + +```python +accept_all(*, author: Optional[str] = None) -> int +``` + +Apply every selected revision (optionally only `author`'s) and return the count. + +Validates the whole selected set first, so a set holding types this package cannot +resolve refuses atomically instead of half-resolving and reporting success while Word +still shows changes. Refuses a protected document and a stale snapshot. Check +`remaining_unsupported()` before concluding the document is clean. + +### `reject_all` + +```python +reject_all(*, author: Optional[str] = None) -> int +``` + +Undo every selected revision (optionally only `author`'s) and return the count. + +Same whole-set validation, refusals and census semantics as `accept_all`. + +### `remaining_unsupported` + +```python +remaining_unsupported() -> dict +``` + +{revision_type: count} for enumerated-but-unresolvable revisions. + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.search` + +Exact and normalized text search over visibility-complete traversal. + +## `ReplaceAllResult` + +```python +ReplaceAllResult(replaced_count: int, results: Tuple[ReplaceResult, ...], refused: Tuple[dict, ...]) -> None +``` + +Outcome of a `replace_all` call: per-match results, never silent. + +### `refused` + +```python +refused: Tuple[dict, ...] +``` + +### `replaced_count` + +```python +replaced_count: int +``` + +### `results` + +```python +results: Tuple[ReplaceResult, ...] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +## `ReplaceResult` + +```python +ReplaceResult(story: str, deleted_text: str, inserted_text: str, tracked: bool, revision_ids: Tuple[int, ...], preserved_revision_ids: Tuple[int, ...] = (), preserved_formatting_regions: bool = False) -> None +``` + +Outcome of a `Span.replace` call. + +`deleted_text` and `inserted_text` cover the whole span for an untracked replace but only +the affix-trimmed middle for a tracked one, so comparing them against `Span.text` is +wrong for tracked edits. `preserved_formatting_regions` reports whether an ordinary +replacement kept every changed formatting region rather than intentionally inheriting the +changed interval's starting run properties; for a no-op, it records that no formatting +changed. It is independent of revision evidence. + +### `deleted_text` + +```python +deleted_text: str +``` + +### `inserted_text` + +```python +inserted_text: str +``` + +### `preserved_formatting_regions` + +```python +preserved_formatting_regions: bool = False +``` + +### `preserved_revision_ids` + +```python +preserved_revision_ids: Tuple[int, ...] = () +``` + +### `revision_ids` + +```python +revision_ids: Tuple[int, ...] +``` + +### `story` + +```python +story: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +### `tracked` + +```python +tracked: bool +``` + +## `Span` + +```python +Span(text: str, story: str, anchor: Anchor, in_insert: bool, in_delete: bool, in_content_control: bool, in_text_box: bool, in_field: bool, crosses_paragraphs: bool, _document: 'Document', _atoms: 'List[_Atom]', _start_offset: int, _end_offset: int, _raw_start: int, _match_start: int, _consumed: bool = False) -> None +``` + +A visible-text interval mapped back to its concrete text atoms. + +Spans hold live references into the document tree and go stale when the +underlying text changes; every operation revalidates first and raises +`TargetNotFoundError` on staleness. ``match_policy`` records the policy +that selected a search-produced span, or is ``None`` for a span constructed +from already-known live offsets. + +### `anchor` + +```python +anchor: Anchor +``` + +### `comment` + +```python +comment(text: str, *, author: str, initials: Optional[str] = None, date: Optional[dt.datetime] = None) -> 'object' +``` + +Anchor a new comment to exactly this span's text, and return the upstream `Comment`. + +Reach for this over `Document.add_comment` when the anchor must match exact text rather +than whole runs. Splits boundary runs, and creates `/word/comments.xml` on first use. +Only the main document story carries comments. Refuses a protected document, a stale +span, and a locked or data-bound control surface. + +### `crosses_paragraphs` + +```python +crosses_paragraphs: bool +``` + +### `in_content_control` + +```python +in_content_control: bool +``` + +### `in_delete` + +```python +in_delete: bool +``` + +### `in_field` + +```python +in_field: bool +``` + +### `in_insert` + +```python +in_insert: bool +``` + +### `in_text_box` + +```python +in_text_box: bool +``` + +### `match_policy` + +```python +match_policy: 'Optional[str]' = field(default=None, init=False) +``` + +### `replace` + +```python +replace(new_text: str, *, tracked: bool = False, author: Optional[str] = None, date: Optional[dt.datetime] = None, preserve_revision: bool = False) -> ReplaceResult +``` + +Replace this span's text and return machine-readable change evidence. + +The default is an untracked edit over one proved structural-owner region. +When maximal exact prefix/suffix alignment identifies one changed interval, unchanged +affix text stays in its existing atoms. A nonempty replacement inherits the complete +direct run properties of the changed interval's starting text run; consumed later runs +may therefore collapse intentionally. Distinct inline wrapper owners, semantic-scope +crossings, positional-marker crossings, and ambiguous affix or pure-insertion boundaries +refuse. `tracked=True` uses the same unique localization and formatting inheritance; +tracked deletion pieces retain each source run's properties. +A successful tracked change consumes the span; a direct tracked no-op is refused. + +`preserve_revision=True` explicitly permits a current-view span wholly owned by one +existing `w:ins` to be corrected without changing that insertion's id, author, date, +or accept/reject meaning; outside revision markup it behaves like an ordinary untracked +edit. The corrected text remains attributed to the existing insertion's author and date. +`preserved_formatting_regions` and `preserved_revision_ids` report independent +guarantees; `revision_ids` remains reserved for newly authored tracked revisions. Every +successful text-changing replacement consumes +the supplied span; use the returned result and re-find the text before another operation. +A no-op, refusal, or rolled-back mutation leaves the span reusable. Refuses a protected +document, a stale or foreign span, and unsafe field, +control, revision, bookmark, whitespace, or paragraph-boundary structures before +mutation. + +### `story` + +```python +story: str +``` + +### `text` + +```python +text: str +``` + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `find_one` + +```python +find_one(document: 'Document', needle: str, *, nth: Optional[int] = None, story: Optional[str] = None, view: str = 'current', match: str = 'exact') -> Span +``` + +The single span matching `needle`, or a typed refusal. + +Exact matching is the default; pass ``match="normalized"`` to opt into +folded targeting. Zero matches raise `TargetNotFoundError`. Two or more +raise `AmbiguousTargetError`. `nth` and `story` explicitly narrow the set. + +## `find_text` + +```python +find_text(document: 'Document', needle: str, *, nth: Optional[int] = None, near: Optional[str] = None, story: Optional[str] = None, view: str = 'current', match: str = 'exact') -> 'List[Span]' +``` + +Every span of `needle` in `document` under the selected match policy. + +`story` limits the search to one story part (e.g. "word/document.xml"); +`near` ranks every match by distance to the nearest occurrence of `near`'s +text under the same policy in the same story. Ranking remains complete +when context is missing or tied. `nth` (1-based) instead selects a match +by document position and cannot be combined with `near`. Exact matching is +the default. Normalized matching folds case, typography, and whitespace. +Both assemble across fragmented runs; exact matching represents each +paragraph boundary as one literal ``\n``. + +## `normalize_text` + +```python +normalize_text(value: str) -> str +``` + +`value` normalized for matching: folded punctuation, collapsed +whitespace, casefolded. Never applied to document content on write. + +ANY Unicode whitespace collapses to a single ASCII space (`\s+`, not just +the spaces in the table) so needles and document text normalize +identically no matter which exotic space either side carries. + +## `replace_all` + +```python +replace_all(document: 'Document', needle: str, new_text: str, *, story: Optional[str] = None, view: str = 'current', match: str = 'exact', tracked: bool = False, author: Optional[str] = None, date: Optional[dt.datetime] = None, preserve_revision: bool = False) -> ReplaceAllResult +``` + +Replace every match of `needle` in one pass, and return a `ReplaceAllResult`. + +``match`` defaults to literal exact matching; ``"normalized"`` explicitly +enables folded matching. One scan finds all matches, then replacements +apply in reverse raw document order within each story, so no pending match +shifts. A refusal on one match is recorded in `refused` and the rest +proceed; a stale span aborts the batch instead, rolling back every +replacement already applied. Matches already equal to `new_text` are +skipped. `preserve_revision` has the same contract as `Span` ``.replace`` +and is forwarded to every match without adding a transaction per match. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.section` + +The `Section` object and related proxy classes. + +## `Section` + +```python +Section(sectPr: CT_SectPr, document_part: DocumentPart) +``` + +Document section, providing access to section and page setup settings. + +Also provides access to headers and footers. + +### `bottom_margin` + +```python +bottom_margin: Length | None +``` + +Read/write. Bottom margin for pages in this section, in EMU. + +`None` when no bottom margin has been specified. Assigning `None` removes any +bottom-margin setting. + +### `different_first_page_header_footer` + +```python +different_first_page_header_footer: bool +``` + +True if this section displays a distinct first-page header and footer. + +Read/write. The definition of the first-page header and footer are accessed +using `.first_page_header` and `.first_page_footer` respectively. + +### `even_page_footer` + +```python +even_page_footer: _Footer +``` + +`_Footer` object defining footer content for even pages. + +The content of this footer definition is ignored unless the document setting +`odd_and_even_pages_header_footer` is set True. + +### `even_page_header` + +```python +even_page_header: _Header +``` + +`_Header` object defining header content for even pages. + +The content of this header definition is ignored unless the document setting +`odd_and_even_pages_header_footer` is set True. + +### `first_page_footer` + +```python +first_page_footer: _Footer +``` + +`_Footer` object defining footer content for the first page of this section. + +The content of this footer definition is ignored unless the property +`.different_first_page_header_footer` is set True. + +### `first_page_header` + +```python +first_page_header: _Header +``` + +`_Header` object defining header content for the first page of this section. + +The content of this header definition is ignored unless the property +`.different_first_page_header_footer` is set True. + +### `footer` + +```python +footer() -> _Footer +``` + +`_Footer` object representing default page footer for this section. + +The default footer is used for odd-numbered pages when separate odd/even footers +are enabled. It is used for both odd and even-numbered pages otherwise. + +### `footer_distance` + +```python +footer_distance: Length | None +``` + +Distance from bottom edge of page to bottom edge of the footer. + +Read/write. `None` if no setting is present in the XML. + +### `gutter` + +```python +gutter: Length | None +``` + +`Length` object representing page gutter size in English Metric Units. + +Read/write. The page gutter is extra spacing added to the `inner` margin to +ensure even margins after page binding. Generally only used in book-bound +documents with double-sided and facing pages. + +This setting applies to all pages in this section. + +### `header` + +```python +header() -> _Header +``` + +`_Header` object representing default page header for this section. + +The default header is used for odd-numbered pages when separate odd/even headers +are enabled. It is used for both odd and even-numbered pages otherwise. + +### `header_distance` + +```python +header_distance: Length | None +``` + +Distance from top edge of page to top edge of header. + +Read/write. `None` if no setting is present in the XML. Assigning `None` causes +default value to be used. + +### `iter_inner_content` + +```python +iter_inner_content() -> Iterator[Paragraph | Table] +``` + +Generate each Paragraph or Table object in this `section`. + +Items appear in document order. + +### `left_margin` + +```python +left_margin: Length | None +``` + +`Length` object representing the left margin for all pages in this section in +English Metric Units. + +### `orientation` + +```python +orientation: WD_ORIENTATION +``` + +`WdOrientation` member specifying page orientation for this section. + +One of ``WD_ORIENT.PORTRAIT`` or ``WD_ORIENT.LANDSCAPE``. + +### `page_height` + +```python +page_height: Length | None +``` + +Total page height used for this section. + +This value is inclusive of all edge spacing values such as margins. + +Page orientation is taken into account, so for example, its expected value +would be ``Inches(8.5)`` for letter-sized paper when orientation is landscape. + +### `page_width` + +```python +page_width: Length | None +``` + +Total page width used for this section. + +This value is like "paper size" and includes all edge spacing values such as +margins. + +Page orientation is taken into account, so for example, its expected value +would be ``Inches(11)`` for letter-sized paper when orientation is landscape. + +### `part` + +```python +part: StoryPart +``` + +### `right_margin` + +```python +right_margin: Length | None +``` + +`Length` object representing the right margin for all pages in this section +in English Metric Units. + +### `start_type` + +```python +start_type: WD_SECTION_START +``` + +Type of page-break (if any) inserted at the start of this section. + +For exmple, ``WD_SECTION_START.ODD_PAGE`` if the section should begin on the +next odd page, possibly inserting two page-breaks instead of one. + +### `top_margin` + +```python +top_margin: Length | None +``` + +`Length` object representing the top margin for all pages in this section in +English Metric Units. + +## `Sections` + +```python +Sections(document_elm: CT_Document, document_part: DocumentPart) +``` + +Bases: `Sequence[Section]` + +Sequence of `Section` objects corresponding to the sections in the document. + +Supports ``len()``, iteration, and indexed access. + + + + + +# `docx.settings` + +Settings object, providing access to document-level settings. + +## `Settings` + +```python +Settings(element: BaseOxmlElement, parent: t.ProvidesXmlPart | None = None) +``` + +Bases: `ElementProxy` + +Provides access to document-level settings for a document. + +Accessed using the `.Document.settings` property. + +### `odd_and_even_pages_header_footer` + +```python +odd_and_even_pages_header_footer: bool +``` + +True if this document has distinct odd and even page headers and footers. + +Read/write. + + + + + +# `docx.shape` + +Objects related to shapes. + +## `InlineShape` + +```python +InlineShape(inline: CT_Inline) +``` + +Proxy for an ```` element, representing the container for an inline +graphical object. + +### `height` + +```python +height: Length +``` + +Read/write. + +The display height of this inline shape as an `Emu` instance. + +### `type` + +```python +type +``` + +The type of this inline shape as a member of +``docx.enum.shape.WD_INLINE_SHAPE``, e.g. ``LINKED_PICTURE``. + +Read-only. + +### `width` + +```python +width +``` + +Read/write. + +The display width of this inline shape as an `Emu` instance. + +## `InlineShapes` + +```python +InlineShapes(body_elm: CT_Body, parent: StoryPart) +``` + +Bases: `Parented` + +Sequence of `InlineShape` instances, supporting len(), iteration, and indexed access. + + + + + +# `docx.shared` + +Objects shared by docx modules. + +## `Cm` + +Bases: `Length` + +Convenience constructor for length in centimeters, e.g. ``height = Cm(12)``. + +## `ElementProxy` + +```python +ElementProxy(element: BaseOxmlElement, parent: t.ProvidesXmlPart | None = None) +``` + +Base class for lxml element proxy classes. + +An element proxy class is one whose primary responsibilities are fulfilled by +manipulating the attributes and child elements of an XML element. They are the most +common type of class in python-docx other than custom element (oxml) classes. + +### `element` + +```python +element +``` + +The lxml element proxied by this object. + +### `part` + +```python +part: XmlPart +``` + +The package part containing this object. + +## `Emu` + +Bases: `Length` + +Convenience constructor for length in English Metric Units, e.g. ``width = +Emu(457200)``. + +## `Inches` + +Bases: `Length` + +Convenience constructor for length in inches, e.g. ``width = Inches(0.5)``. + +## `Length` + +Bases: `int` + +Base class for length constructor classes Inches, Cm, Mm, Px, and Emu. + +Behaves as an int count of English Metric Units, 914,400 to the inch, 36,000 to the +mm. Provides convenience unit conversion methods in the form of read-only +properties. Immutable. + +### `cm` + +```python +cm +``` + +The equivalent length expressed in centimeters (float). + +### `emu` + +```python +emu +``` + +The equivalent length expressed in English Metric Units (int). + +### `inches` + +```python +inches +``` + +The equivalent length expressed in inches (float). + +### `mm` + +```python +mm +``` + +The equivalent length expressed in millimeters (float). + +### `pt` + +```python +pt +``` + +Floating point length in points. + +### `twips` + +```python +twips +``` + +The equivalent length expressed in twips (int). + +## `Mm` + +Bases: `Length` + +Convenience constructor for length in millimeters, e.g. ``width = Mm(240.5)``. + +## `Parented` + +```python +Parented(parent: t.ProvidesXmlPart) +``` + +Provides common services for document elements that occur below a part but may +occasionally require an ancestor object to provide a service, such as add or drop a +relationship. + +Provides ``self._parent`` attribute to subclasses. + +### `part` + +```python +part: XmlPart +``` + +The package part containing this object. + +## `Pt` + +Bases: `Length` + +Convenience value class for specifying a length in points. + +## `RGBColor` + +Bases: `Tuple[int, int, int]` + +Immutable value object defining a particular RGB color. + +### `from_string` + +```python +from_string(rgb_hex_str: str) -> RGBColor +``` + +Return a new instance from an RGB color hex string like ``'3C2F80'``. + +## `StoryChild` + +```python +StoryChild(parent: t.ProvidesStoryPart) +``` + +A document element within a story part. + +Story parts include DocumentPart and Header/FooterPart and can contain block items +(paragraphs and tables). Items from the block-item subtree occasionally require an +ancestor object to provide access to part-level or package-level items like styles +or images or to add or drop a relationship. + +Provides `self._parent` attribute to subclasses. + +### `part` + +```python +part: StoryPart +``` + +The package part containing this object. + +## `T` + +```python +T = TypeVar('T') +``` + +## `TextAccumulator` + +```python +TextAccumulator(separator: str = '') +``` + +Accepts `str` fragments and joins them together, in order, on `.pop(). + +Handy when text in a stream is broken up arbitrarily and you want to join it back +together within certain bounds. The optional `separator` argument determines how +the text fragments are punctuated, defaulting to the empty string. + +### `pop` + +```python +pop() -> Iterator[str] +``` + +Generate sero-or-one str from those accumulated. + +Using `yield from accum.pop()` in a generator setting avoids producing an empty +string when no text is in the accumulator. + +### `push` + +```python +push(text: str) -> None +``` + +Add a text fragment to the accumulator. + +## `Twips` + +Bases: `Length` + +Convenience constructor for length in twips, e.g. ``width = Twips(42)``. + +A twip is a twentieth of a point, 635 EMU. + +## `lazyproperty` + +```python +lazyproperty(fget: Callable[..., T]) -> None +``` + +Bases: `Generic[T]` + +Decorator like @property, but evaluated only on first access. + +Like @property, this can only be used to decorate methods having only a `self` +parameter, and is accessed like an attribute on an instance, i.e. trailing +parentheses are not used. Unlike @property, the decorated method is only evaluated +on first access; the resulting value is cached and that same value returned on +second and later access without re-evaluation of the method. + +Like @property, this class produces a *data descriptor* object, which is stored in +the __dict__ of the *class* under the name of the decorated method ('fget' +nominally). The cached value is stored in the __dict__ of the *instance* under that +same name. + +Because it is a data descriptor (as opposed to a *non-data descriptor*), its +`__get__()` method is executed on each access of the decorated attribute; the +__dict__ item of the same name is "shadowed" by the descriptor. + +While this may represent a performance improvement over a property, its greater +benefit may be its other characteristics. One common use is to construct +collaborator objects, removing that "real work" from the constructor, while still +only executing once. It also de-couples client code from any sequencing +considerations; if it's accessed from more than one location, it's assured it will +be ready whenever needed. + +Loosely based on: https://stackoverflow.com/a/6849299/1902513. + +A lazyproperty is read-only. There is no counterpart to the optional "setter" (or +deleter) behavior of an @property. This is critically important to maintaining its +immutability and idempotence guarantees. Attempting to assign to a lazyproperty +raises AttributeError unconditionally. + +The parameter names in the methods below correspond to this usage example:: + + class Obj(object) + + @lazyproperty + def fget(self): + return 'some result' + + obj = Obj() + +Not suitable for wrapping a function (as opposed to a method) because it is not +callable. + +*fget* is the decorated method (a "getter" function). + +A lazyproperty is read-only, so there is only an *fget* function (a regular +@property can also have an fset and fdel function). This name was chosen for +consistency with Python's `property` class which uses this name for the +corresponding parameter. + +## `write_only_property` + +```python +write_only_property(f: Callable[[Any, Any], None]) +``` + +@write_only_property decorator. + +Creates a property (descriptor attribute) that accepts assignment, but not getattr +(use in an expression). + + + + + +# `docx.story` + +Visibility-complete story traversal and inspection (paper-docx, opt-in). + +## `Anchor` + +```python +Anchor(story: str, index: int, content_hash: str) -> None +``` + +Legacy, inert location evidence: story part + index + content hash. + +``Anchor`` remains serializable for historical search and revision result +data. It is not a mutation-capable block target; reacquire a live `Block` +or `Span` instead. + +### `content_hash` + +```python +content_hash: str +``` + +### `index` + +```python +index: int +``` + +### `story` + +```python +story: str +``` + +### `to_dict` + +```python +to_dict() -> 'Dict[str, object]' +``` + +## `BLIND_REGION_KEYS` + +```python +BLIND_REGION_KEYS = ('tracked_insertions', 'tracked_deletions', 'moves', 'format_changes', 'content_controls', 'text_boxes', 'fields', 'math', 'embedded_objects', 'alt_chunks', 'hidden_text') +``` + +## `Block` + +```python +Block(story: str, kind: str, index: int, anchor: Anchor, text: str, style_id: Optional[str], in_insert: bool, in_delete: bool, in_content_control: bool, in_text_box: bool, has_field: bool, table: Optional[TableShape], _document: 'Optional[Document]' = None, _element: 'Optional[_Element]' = None, _story_root: 'Optional[_Element]' = None, _parent: 'Optional[_Element]' = None, _container_elements: 'Tuple[_Element, ...]' = (), _view: str = 'current') -> None +``` + +One live, owner-bound paragraph or table observed during traversal. + +### `anchor` + +```python +anchor: Anchor +``` + +### `has_field` + +```python +has_field: bool +``` + +### `in_content_control` + +```python +in_content_control: bool +``` + +### `in_delete` + +```python +in_delete: bool +``` + +### `in_insert` + +```python +in_insert: bool +``` + +### `in_text_box` + +```python +in_text_box: bool +``` + +### `index` + +```python +index: int +``` + +### `kind` + +```python +kind: str +``` + +### `story` + +```python +story: str +``` + +### `style_id` + +```python +style_id: Optional[str] +``` + +### `table` + +```python +table: Optional[TableShape] +``` + +### `text` + +```python +text: str +``` + +### `to_dict` + +```python +to_dict() -> 'Dict[str, object]' +``` + +## `Outline` + +```python +Outline(story_parts: Tuple[str, ...], blocks: Tuple[Block, ...], blind_region_counts: Dict[str, int]) -> None +``` + +Inspection snapshot of a document: every block in every story part. + +### `blind_region_counts` + +```python +blind_region_counts: Dict[str, int] +``` + +### `blocks` + +```python +blocks: Tuple[Block, ...] +``` + +### `story_parts` + +```python +story_parts: Tuple[str, ...] +``` + +### `to_dict` + +```python +to_dict() -> 'Dict[str, object]' +``` + +## `TableShape` + +```python +TableShape(rows: int, columns: int, has_merges: bool, has_nested_table: bool) -> None +``` + +### `columns` + +```python +columns: int +``` + +### `has_merges` + +```python +has_merges: bool +``` + +### `has_nested_table` + +```python +has_nested_table: bool +``` + +### `rows` + +```python +rows: int +``` + +### `to_dict` + +```python +to_dict() -> 'Dict[str, object]' +``` + +## `VIEWS` + +```python +VIEWS = ('current', 'original', 'all') +``` + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `content_hash` + +```python +content_hash(text: str) -> str +``` + +First 8 hex chars of SHA-256 over the block's normalized text. + +## `iter_blocks` + +```python +iter_blocks(document: 'Document', *, view: str = 'current') -> Iterator[Block] +``` + +Every block in every story part of `document`, in document order. + +`view` selects the text layer: "current" (insertions in, deletions out — +the document if all changes were accepted), "original" (deletions in, +insertions out), or "all" (everything). + +## `normalize_text` + +```python +normalize_text(value: str) -> str +``` + +`value` normalized for matching: folded punctuation, collapsed +whitespace, casefolded. Never applied to document content on write. + +ANY Unicode whitespace collapses to a single ASCII space (`\s+`, not just +the spaces in the table) so needles and document text normalize +identically no matter which exotic space either side carries. + +## `outline` + +```python +outline(document: 'Document', *, view: str = 'current') -> Outline +``` + +Inspection snapshot: story parts, all blocks, blind-region counts. + +Deterministic: the same document yields byte-identical `to_dict()` output +on every call (inspection determinism). + +## `story_parts` + +```python +story_parts(document: 'Document') -> Tuple[str, ...] +``` + +Every story part present in `document`, in traversal order. + + + + + +# `docx.styles.latent` + +Latent style-related objects. + +## `LatentStyles` + +Bases: `ElementProxy` + +Provides access to the default behaviors for latent styles in this document and +to the collection of `_LatentStyle` objects that define overrides of those defaults +for a particular named latent style. + +### `add_latent_style` + +```python +add_latent_style(name) +``` + +Return a newly added `_LatentStyle` object to override the inherited defaults +defined in this latent styles object for the built-in style having `name`. + +### `default_priority` + +```python +default_priority +``` + +Integer between 0 and 99 inclusive specifying the default sort order for +latent styles in style lists and the style gallery. + +`None` if no value is assigned, which causes Word to use the default value 99. + +### `default_to_hidden` + +```python +default_to_hidden +``` + +Boolean specifying whether the default behavior for latent styles is to be +hidden. + +A hidden style does not appear in the recommended list or in the style gallery. + +### `default_to_locked` + +```python +default_to_locked +``` + +Boolean specifying whether the default behavior for latent styles is to be +locked. + +A locked style does not appear in the styles panel or the style gallery and +cannot be applied to document content. This behavior is only active when +formatting protection is turned on for the document (via the Developer menu). + +### `default_to_quick_style` + +```python +default_to_quick_style +``` + +Boolean specifying whether the default behavior for latent styles is to +appear in the style gallery when not hidden. + +### `default_to_unhide_when_used` + +```python +default_to_unhide_when_used +``` + +Boolean specifying whether the default behavior for latent styles is to be +unhidden when first applied to content. + +### `load_count` + +```python +load_count +``` + +Integer specifying the number of built-in styles to initialize to the +defaults specified in this `LatentStyles` object. + +`None` if there is no setting in the XML (very uncommon). The default Word 2011 +template sets this value to 276, accounting for the built-in styles in Word +2010. + + + + + +# `docx.styles` + +Sub-package module for docx.styles sub-package. + +## `BabelFish` + +Translates special-case style names from UI name (e.g. Heading 1) to +internal/styles.xml name (e.g. heading 1) and back. + +### `internal2ui` + +```python +internal2ui(internal_style_name: str) -> str +``` + +Return the user interface style name corresponding to `internal_style_name`, +such as 'Heading 1' for 'heading 1'. + +### `internal_style_names` + +```python +internal_style_names: Dict[str, str] = dict(style_aliases) +``` + +### `style_aliases` + +```python +style_aliases = (('Caption', 'caption'), ('Footer', 'footer'), ('Header', 'header'), ('Heading 1', 'heading 1'), ('Heading 2', 'heading 2'), ('Heading 3', 'heading 3'), ('Heading 4', 'heading 4'), ('Heading 5', 'heading 5'), ('Heading 6', 'heading 6'), ('Heading 7', 'heading 7'), ('Heading 8', 'heading 8'), ('Heading 9', 'heading 9')) +``` + +### `ui2internal` + +```python +ui2internal(ui_style_name: str) -> str +``` + +Return the internal style name corresponding to `ui_style_name`, such as +'heading 1' for 'Heading 1'. + +### `ui_style_names` + +```python +ui_style_names = {item[1]: item[0] for item in style_aliases} +``` + + + + + +# `docx.styles.style` + +Style object hierarchy. + +## `BaseStyle` + +```python +BaseStyle(style_elm: CT_Style) +``` + +Bases: `ElementProxy` + +Base class for the various types of style object, paragraph, character, table, +and numbering. + +These properties and methods are inherited by all style objects. + +### `builtin` + +```python +builtin +``` + +Read-only. + +`True` if this style is a built-in style. `False` indicates it is a custom +(user-defined) style. Note this value is based on the presence of a +`customStyle` attribute in the XML, not on specific knowledge of which styles +are built into Word. + +### `delete` + +```python +delete() +``` + +Remove this style definition from the document. + +Note that calling this method does not remove or change the style applied to any +document content. Content items having the deleted style will be rendered using +the default style, as is any content with a style not defined in the document. + +### `hidden` + +```python +hidden +``` + +`True` if display of this style in the style gallery and list of recommended +styles is suppressed. + +`False` otherwise. In order to be shown in the style gallery, this value must be +`False` and `.quick_style` must be `True`. + +### `locked` + +```python +locked +``` + +Read/write Boolean. + +`True` if this style is locked. A locked style does not appear in the styles +panel or the style gallery and cannot be applied to document content. This +behavior is only active when formatting protection is turned on for the document +(via the Developer menu). + +### `name` + +```python +name +``` + +The UI name of this style. + +### `priority` + +```python +priority +``` + +The integer sort key governing display sequence of this style in the Word UI. + +`None` indicates no setting is defined, causing Word to use the default value of +0. Style name is used as a secondary sort key to resolve ordering of styles +having the same priority value. + +### `quick_style` + +```python +quick_style +``` + +`True` if this style should be displayed in the style gallery when +`.hidden` is `False`. + +Read/write Boolean. + +### `style_id` + +```python +style_id: str +``` + +The unique key name (string) for this style. + +This value is subject to rewriting by Word and should generally not be changed +unless you are familiar with the internals involved. + +### `type` + +```python +type +``` + +Member of `WdStyleType` corresponding to the type of this style, e.g. +``WD_STYLE_TYPE.PARAGRAPH``. + +### `unhide_when_used` + +```python +unhide_when_used +``` + +`True` if an application should make this style visible the next time it is +applied to content. + +False otherwise. Note that `docx` does not automatically unhide a style having +`True` for this attribute when it is applied to content. + +## `CharacterStyle` + +Bases: `BaseStyle` + +A character style. + +A character style is applied to a `Run` object and primarily provides character- +level formatting via the `Font` object in its `.font` property. + +### `base_style` + +```python +base_style +``` + +Style object this style inherits from or `None` if this style is not based on +another style. + +### `font` + +```python +font +``` + +The `Font` object providing access to the character formatting properties for +this style, such as font name and size. + +## `ParagraphStyle` + +Bases: `CharacterStyle` + +A paragraph style. + +A paragraph style provides both character formatting and paragraph formatting such +as indentation and line-spacing. + +### `next_paragraph_style` + +```python +next_paragraph_style +``` + +`_ParagraphStyle` object representing the style to be applied automatically +to a new paragraph inserted after a paragraph of this style. + +Returns self if no next paragraph style is defined. Assigning `None` or `self` +removes the setting such that new paragraphs are created using this same style. + +### `paragraph_format` + +```python +paragraph_format +``` + +The `ParagraphFormat` object providing access to the paragraph formatting +properties for this style such as indentation. + +## `StyleFactory` + +```python +StyleFactory(style_elm: CT_Style) -> BaseStyle +``` + +Return `Style` object of appropriate `BaseStyle` subclass for `style_elm`. + + + + + +# `docx.styles.styles` + +Styles object, container for all objects in the styles part. + +## `Styles` + +```python +Styles(styles: CT_Styles) +``` + +Bases: `ElementProxy` + +Provides access to the styles defined in a document. + +Accessed using the `.Document.styles` property. Supports ``len()``, iteration, +and dictionary-style access by style name. + +### `add_style` + +```python +add_style(name, style_type, builtin = False) +``` + +Return a newly added style object of `style_type` and identified by `name`. + +A builtin style can be defined by passing True for the optional `builtin` +argument. + +### `default` + +```python +default(style_type: WD_STYLE_TYPE) +``` + +Return the default style for `style_type` or `None` if no default is defined +for that type (not common). + +### `get_by_id` + +```python +get_by_id(style_id: str | None, style_type: WD_STYLE_TYPE) +``` + +Return the style of `style_type` matching `style_id`. + +Returns the default for `style_type` if `style_id` is not found or is `None`, or +if the style having `style_id` is not of `style_type`. + +### `get_style_id` + +```python +get_style_id(style_or_name, style_type) +``` + +Return the id of the style corresponding to `style_or_name`, or `None` if +`style_or_name` is `None`. + +If `style_or_name` is not a style object, the style is looked up using +`style_or_name` as a style name, raising `ValueError` if no style with that name +is defined. Raises `ValueError` if the target style is not of `style_type`. + +### `latent_styles` + +```python +latent_styles +``` + +A `LatentStyles` object providing access to the default behaviors for latent +styles and the collection of `_LatentStyle` objects that define overrides of +those defaults for a particular named latent style. + + + + + +# `docx.table` + +The `Table` object and related proxy classes. + +## `Table` + +```python +Table(tbl: CT_Tbl, parent: t.ProvidesStoryPart) +``` + +Bases: `StoryChild` + +Proxy class for a WordprocessingML ```` element. + +### `add_column` + +```python +add_column(width: Length) +``` + +Return a `_Column` object of `width`, newly added rightmost to the table. + +### `add_row` + +```python +add_row() +``` + +Return a `_Row` instance, newly added bottom-most to the table. + +### `alignment` + +```python +alignment: WD_TABLE_ALIGNMENT | None +``` + +Read/write. + +A member of `WdRowAlignment` or None, specifying the positioning of this +table between the page margins. `None` if no setting is specified, causing the +effective value to be inherited from the style hierarchy. + +### `autofit` + +```python +autofit: bool +``` + +`True` if column widths can be automatically adjusted to improve the fit of +cell contents. + +`False` if table layout is fixed. Column widths are adjusted in either case if +total column width exceeds page width. Read/write boolean. + +### `cell` + +```python +cell(row_idx: int, col_idx: int) -> _Cell +``` + +`_Cell` at `row_idx`, `col_idx` intersection. + +(0, 0) is the top, left-most cell. + +### `column_cells` + +```python +column_cells(column_idx: int) -> list[_Cell] +``` + +Sequence of cells in the column at `column_idx` in this table. + +### `columns` + +```python +columns() +``` + +`_Columns` instance representing the sequence of columns in this table. + +### `row_cells` + +```python +row_cells(row_idx: int) -> list[_Cell] +``` + +DEPRECATED: Use `table.rows[row_idx].cells` instead. + +Sequence of cells in the row at `row_idx` in this table. + +### `rows` + +```python +rows() -> _Rows +``` + +`_Rows` instance containing the sequence of rows in this table. + +### `style` + +```python +style: _TableStyle | None +``` + +`_TableStyle` object representing the style applied to this table. + +Read/write. The default table style for the document (often `Normal Table`) is +returned if the table has no directly-applied style. Assigning `None` to this +property removes any directly-applied table style causing it to inherit the +default table style of the document. + +Note that the style name of a table style differs slightly from that displayed +in the user interface; a hyphen, if it appears, must be removed. For example, +`Light Shading - Accent 1` becomes `Light Shading Accent 1`. + +### `table` + +```python +table +``` + +Provide child objects with reference to the `Table` object they belong to, +without them having to know their direct parent is a `Table` object. + +This is the terminus of a series of `parent._table` calls from an arbitrary +child through its ancestors. + +### `table_direction` + +```python +table_direction: WD_TABLE_DIRECTION | None +``` + +Member of `WdTableDirection` indicating cell-ordering direction. + +For example: `WD_TABLE_DIRECTION.LTR`. `None` indicates the value is inherited +from the style hierarchy. + +## `TableParent` + +```python +TableParent: TypeAlias = 'Table | _Columns | _Rows' +``` diff --git a/addons/sandbox/skills/docx/references/api-004.md b/addons/sandbox/skills/docx/references/api-004.md new file mode 100644 index 000000000..59f81e5d8 --- /dev/null +++ b/addons/sandbox/skills/docx/references/api-004.md @@ -0,0 +1,1312 @@ + + + + +# `docx.tableops` + +Narrow, guarded table operations (paper-docx). + +## `check_install` + +```python +check_install() -> None +``` + +Refuse when paper-docx and python-docx are both installed. + +## `delete_row` + +```python +delete_row(table: 'Table', row: int) -> None +``` + +Delete row `row` (0-based). + +Refuses the last remaining row, since a rowless table is not valid WordprocessingML. +Refuses a protected document, an out-of-range index, and a merged or nested target. + +## `find_table` + +```python +find_table(document: 'Document', *, near_text: str, match: str = 'exact') -> 'Table' +``` + +The table with one physical cell containing `near_text`. + +Matching is literal and exact by default; ``match="normalized"`` folds case, +typography, and whitespace. Paragraph boundaries within one cell are represented +by literal newlines, but a match never crosses from one cell into another. Only +top-level tables in the main document body are searched. + +Zero matching tables raise `TargetNotFoundError`; more than one matching table +raises `AmbiguousTargetError` — make `near_text` more specific. + +## `insert_row_after` + +```python +insert_row_after(table: 'Table', row: int, values: Sequence[str], *, copy_format_from: Optional[int] = None) -> None +``` + +Insert a row after `row` (0-based), copying formatting from `copy_format_from` and +filling `values`. + +The copied template must have one direct paragraph per physical cell, containing +only plain text runs with identical complete direct run properties. Cell and +paragraph properties are preserved. Complex or conflicting templates refuse +before population with guidance to use a simpler uniform template; they are never +repaired or flattened. + +Refuses a protected document, an out-of-range index, and a target row that is merged +or holds a nested table. + +## `update_cell` + +```python +update_cell(table: 'Table', row: int, column: int, new_text: str, *, tracked: bool = False, author: Optional[str] = None, date: Optional[dt.datetime] = None) -> ReplaceResult +``` + +Replace one cell's visible text and return a `ReplaceResult` (0-based `row`, +layout-grid `column`). + +Runs through `Span.replace`, so a non-empty replacement inherits the target cell text's +starting run properties and reports whether later formatting regions were consumed. Guards +are cell-wise: a merged header elsewhere in the table does not block a plain target cell. +Refuses a protected document, an out-of-range address, and a marker-divided, +wrapper-divided, merged, multi-paragraph, or nested target. + + + + + +# `docx.text.font` + +Font-related proxy objects. + +## `Font` + +```python +Font(r: CT_R, parent: Any | None = None) +``` + +Bases: `ElementProxy` + +Proxy object for parent of a `` element and providing access to +character properties such as font name, font size, bold, and subscript. + +### `all_caps` + +```python +all_caps: bool | None +``` + +Read/write. + +Causes text in this font to appear in capital letters. + +### `bold` + +```python +bold: bool | None +``` + +Read/write. + +Causes text in this font to appear in bold. + +### `color` + +```python +color +``` + +A `ColorFormat` object providing a way to get and set the text color for this +font. + +### `complex_script` + +```python +complex_script: bool | None +``` + +Read/write tri-state value. + +When `True`, causes the characters in the run to be treated as complex script +regardless of their Unicode values. + +### `cs_bold` + +```python +cs_bold: bool | None +``` + +Read/write tri-state value. + +When `True`, causes the complex script characters in the run to be displayed in +bold typeface. + +### `cs_italic` + +```python +cs_italic: bool | None +``` + +Read/write tri-state value. + +When `True`, causes the complex script characters in the run to be displayed in +italic typeface. + +### `double_strike` + +```python +double_strike: bool | None +``` + +Read/write tri-state value. + +When `True`, causes the text in the run to appear with double strikethrough. + +### `emboss` + +```python +emboss: bool | None +``` + +Read/write tri-state value. + +When `True`, causes the text in the run to appear as if raised off the page in +relief. + +### `hidden` + +```python +hidden: bool | None +``` + +Read/write tri-state value. + +When `True`, causes the text in the run to be hidden from display, unless +applications settings force hidden text to be shown. + +### `highlight_color` + +```python +highlight_color: WD_COLOR_INDEX | None +``` + +Color of highlighing applied or `None` if not highlighted. + +### `imprint` + +```python +imprint: bool | None +``` + +Read/write tri-state value. + +When `True`, causes the text in the run to appear as if pressed into the page. + +### `italic` + +```python +italic: bool | None +``` + +Read/write tri-state value. + +When `True`, causes the text of the run to appear in italics. `None` indicates +the effective value is inherited from the style hierarchy. + +### `math` + +```python +math: bool | None +``` + +Read/write tri-state value. + +When `True`, specifies this run contains WML that should be handled as though it +was Office Open XML Math. + +### `name` + +```python +name: str | None +``` + +The typeface name for this `Font`. + +Causes the text it controls to appear in the named font, if a matching font is +found. `None` indicates the typeface is inherited from the style hierarchy. + +### `no_proof` + +```python +no_proof: bool | None +``` + +Read/write tri-state value. + +When `True`, specifies that the contents of this run should not report any +errors when the document is scanned for spelling and grammar. + +### `outline` + +```python +outline: bool | None +``` + +Read/write tri-state value. + +When `True` causes the characters in the run to appear as if they have an +outline, by drawing a one pixel wide border around the inside and outside +borders of each character glyph. + +### `rtl` + +```python +rtl: bool | None +``` + +Read/write tri-state value. + +When `True` causes the text in the run to have right-to-left characteristics. + +### `shadow` + +```python +shadow: bool | None +``` + +Read/write tri-state value. + +When `True` causes the text in the run to appear as if each character has a +shadow. + +### `size` + +```python +size: Length | None +``` + +Font height in English Metric Units (EMU). + +`None` indicates the font size should be inherited from the style hierarchy. +`Length` is a subclass of `int` having properties for convenient conversion into +points or other length units. The `docx.shared.Pt` class allows +convenient specification of point values:: + + >>> font.size = Pt(24) + >>> font.size + 304800 + >>> font.size.pt + 24.0 + +### `small_caps` + +```python +small_caps: bool | None +``` + +Read/write tri-state value. + +When `True` causes the lowercase characters in the run to appear as capital +letters two points smaller than the font size specified for the run. + +### `snap_to_grid` + +```python +snap_to_grid: bool | None +``` + +Read/write tri-state value. + +When `True` causes the run to use the document grid characters per line settings +defined in the docGrid element when laying out the characters in this run. + +### `spec_vanish` + +```python +spec_vanish: bool | None +``` + +Read/write tri-state value. + +When `True`, specifies that the given run shall always behave as if it is +hidden, even when hidden text is being displayed in the current document. The +property has a very narrow, specialized use related to the table of contents. +Consult the spec (§17.3.2.36) for more details. + +### `strike` + +```python +strike: bool | None +``` + +Read/write tri-state value. + +When `True` causes the text in the run to appear with a single horizontal line +through the center of the line. + +### `subscript` + +```python +subscript: bool | None +``` + +Boolean indicating whether the characters in this `Font` appear as subscript. + +`None` indicates the subscript/subscript value is inherited from the style +hierarchy. + +### `superscript` + +```python +superscript: bool | None +``` + +Boolean indicating whether the characters in this `Font` appear as +superscript. + +`None` indicates the subscript/superscript value is inherited from the style +hierarchy. + +### `underline` + +```python +underline: bool | WD_UNDERLINE | None +``` + +The underline style for this `Font`. + +The value is one of `None`, `True`, `False`, or a member of `WdUnderline`. + +`None` indicates the font inherits its underline value from the style hierarchy. +`False` indicates no underline. `True` indicates single underline. The values +from `WdUnderline` are used to specify other outline styles such as double, +wavy, and dotted. + +### `web_hidden` + +```python +web_hidden: bool | None +``` + +Read/write tri-state value. + +When `True`, specifies that the contents of this run shall be hidden when the +document is displayed in web page view. + + + + + +# `docx.text.hyperlink` + +Hyperlink-related proxy objects for python-docx, Hyperlink in particular. + +## `Hyperlink` + +```python +Hyperlink(hyperlink: CT_Hyperlink, parent: t.ProvidesStoryPart) +``` + +Bases: `Parented` + +Proxy object wrapping a `` element. + +A hyperlink occurs as a child of a paragraph, at the same level as a Run. A +hyperlink itself contains runs, which is where the visible text of the hyperlink is +stored. + +### `address` + +```python +address: str +``` + +The "URL" of the hyperlink (but not necessarily a web link). + +While commonly a web link like "https://google.com" the hyperlink address can +take a variety of forms including "internal links" to bookmarked locations +within the document. When this hyperlink is an internal "jump" to for example a +heading from the table-of-contents (TOC), the address is blank. The bookmark +reference (like "_Toc147925734") is stored in the `.fragment` property. + +### `contains_page_break` + +```python +contains_page_break: bool +``` + +True when the text of this hyperlink is broken across page boundaries. + +This is not uncommon and can happen for example when the hyperlink text is +multiple words and occurs in the last line of a page. Theoretically, a hyperlink +can contain more than one page break but that would be extremely uncommon in +practice. Still, this value should be understood to mean that "one-or-more" +rendered page breaks are present. + +### `fragment` + +```python +fragment: str +``` + +Reference like `#glossary` at end of URL that refers to a sub-resource. + +Note that this value does not include the fragment-separator character ("#"). + +This value is known as a "named anchor" in an HTML context and "anchor" in the +MS API, but an "anchor" element (``) represents a full hyperlink in HTML so +we avoid confusion by using the more precise RFC 3986 naming "URI fragment". + +These are also used to refer to bookmarks within the same document, in which +case the `.address` value with be blank ("") and this property will hold a +value like "_Toc147925734". + +To reliably get an entire web URL you will need to concatenate this with the +`.address` value, separated by "#" when both are present. Consider using the +`.url` property for that purpose. + +Word sometimes stores a fragment in this property (an XML attribute) and +sometimes with the address, depending on how the URL is inserted, so don't +depend on this field being empty to indicate no fragment is present. + +### `runs` + +```python +runs: list[Run] +``` + +List of `Run` instances in this hyperlink. + +Together these define the visible text of the hyperlink. The text of a hyperlink +is typically contained in a single run will be broken into multiple runs if for +example part of the hyperlink is bold or the text was changed after the document +was saved. + +### `text` + +```python +text: str +``` + +String formed by concatenating the text of each run in the hyperlink. + +Tabs and line breaks in the XML are mapped to ``\t`` and ``\n`` characters +respectively. Note that rendered page-breaks can occur within a hyperlink but +they are not reflected in this text. + +### `url` + +```python +url: str +``` + +Convenience property to get web URLs from hyperlinks that contain them. + +This value is the empty string ("") when there is no address portion, so its +boolean value can also be used to distinguish external URIs from internal "jump" +hyperlinks like those found in a table-of-contents. + +Note that this value may also be a link to a file, so if you only want web-urls +you'll need to check for a protocol prefix like `https://`. + +When both an address and fragment are present, the return value joins the two +separated by the fragment-separator hash ("#"). Otherwise this value is the same +as that of the `.address` property. + +## `rollback_on_error` + +```python +rollback_on_error(document: 'Document', *participants: Any) -> Generator[None, None, None] +``` + +Restore the live package and named mutable proxies after an error. + + + + + +# `docx.text.pagebreak` + +Proxy objects related to rendered page-breaks. + +## `RenderedPageBreak` + +```python +RenderedPageBreak(lastRenderedPageBreak: CT_LastRenderedPageBreak, parent: t.ProvidesStoryPart) +``` + +Bases: `Parented` + +A page-break inserted by Word during page-layout for print or display purposes. + +This usually does not correspond to a "hard" page-break inserted by the document +author, rather just that Word ran out of room on one page and needed to start +another. The position of these can change depending on the printer and page-size, as +well as margins, etc. They also will change in response to edits, but not until Word +loads and saves the document. + +Note these are never inserted by `python-docx` because it has no rendering function. +These are generally only useful for text-extraction of existing documents when +`python-docx` is being used solely as a document "reader". + +NOTE: a rendered page-break can occur within a hyperlink; consider a multi-word +hyperlink like "excellent Wikipedia article on LLMs" that happens to fall close to +the end of the last line on a page such that the page breaks between "Wikipedia" and +"article". In such a "page-breaks-in-hyperlink" case, THESE METHODS WILL "MOVE" THE +PAGE-BREAK to occur after the hyperlink, such that the entire hyperlink appears in +the paragraph returned by `.preceding_paragraph_fragment`. While this places the +"tail" text of the hyperlink on the "wrong" page, it avoids having two hyperlinks +each with a fragment of the actual text and pointing to the same address. + +### `following_paragraph_fragment` + +```python +following_paragraph_fragment: Paragraph | None +``` + +A "loose" paragraph containing the content following this page-break. + +HAS POTENTIALLY SURPRISING BEHAVIORS so read carefully to be sure this is what +you want. This is primarily targeted toward text-extraction use-cases for which +precisely associating text with the page it occurs on is important. + +Compare `.preceding_paragraph_fragment` as these two are intended to be used +together. + +This value is `None` when no content follows this page-break. This case is +unlikely to occur in practice because Word places even-paragraph-boundary +page-breaks on the paragraph *following* the page-break. Still, it is possible +and must be checked for. Returning `None` for this case avoids "inserting" an +extra, non-existent paragraph into the content stream. Note that content can +include DrawingML items like images or charts, not just text. + +The returned paragraph *is divorced from the document body*. Any changes made to +it will not be reflected in the document. It is intended to provide a container +(`Paragraph`) with familiar properties and methods that can be used to +characterize the paragraph content following a mid-paragraph page-break. + +Contains no portion of the hyperlink when this break occurs within a hyperlink. + +### `preceding_paragraph_fragment` + +```python +preceding_paragraph_fragment: Paragraph | None +``` + +A "loose" paragraph containing the content preceding this page-break. + +Compare `.following_paragraph_fragment` as these two are intended to be used +together. + +This value is `None` when no content precedes this page-break. This case is +common and occurs whenever a page breaks on an even paragraph boundary. +Returning `None` for this case avoids "inserting" a non-existent paragraph into +the content stream. Note that content can include DrawingML items like images or +charts. + +Note the returned paragraph *is divorced from the document body*. Any changes +made to it will not be reflected in the document. It is intended to provide a +familiar container (`Paragraph`) to interrogate for the content preceding this +page-break in the paragraph in which it occured. + +Contains the entire hyperlink when this break occurs within a hyperlink. + + + + + +# `docx.text.paragraph` + +Paragraph-related proxy types. + +## `Paragraph` + +```python +Paragraph(p: CT_P, parent: t.ProvidesStoryPart) +``` + +Bases: `StoryChild` + +Proxy object wrapping a `` element. + +### `add_run` + +```python +add_run(text: str | None = None, style: str | CharacterStyle | None = None) -> Run +``` + +Append run containing `text` and having character-style `style`. + +`text` can contain tab (``\t``) characters, which are converted to the +appropriate XML form for a tab. `text` can also include newline (``\n``) or +carriage return (``\r``) characters, each of which is converted to a line +break. When `text` is `None`, the new run is empty. + +### `alignment` + +```python +alignment: WD_PARAGRAPH_ALIGNMENT | None +``` + +A member of the `WdParagraphAlignment` enumeration specifying the +justification setting for this paragraph. + +A value of `None` indicates the paragraph has no directly-applied alignment +value and will inherit its alignment value from its style hierarchy. Assigning +`None` to this property removes any directly-applied alignment value. + +### `clear` + +```python +clear() +``` + +Return this same paragraph after removing all its content. + +Paragraph-level formatting, such as style, is preserved. + +### `contains_page_break` + +```python +contains_page_break: bool +``` + +`True` when one or more rendered page-breaks occur in this paragraph. + +### `hyperlinks` + +```python +hyperlinks: List[Hyperlink] +``` + +A `Hyperlink` instance for each hyperlink in this paragraph. + +### `insert_paragraph_before` + +```python +insert_paragraph_before(text: str | None = None, style: str | ParagraphStyle | None = None) -> Paragraph +``` + +Return a newly created paragraph, inserted directly before this paragraph. + +If `text` is supplied, the new paragraph contains that text in a single run. If +`style` is provided, that style is assigned to the new paragraph. + +### `iter_inner_content` + +```python +iter_inner_content() -> Iterator[Run | Hyperlink] +``` + +Generate the runs and hyperlinks in this paragraph, in the order they appear. + +The content in a paragraph consists of both runs and hyperlinks. This method +allows accessing each of those separately, in document order, for when the +precise position of the hyperlink within the paragraph text is important. Note +that a hyperlink itself contains runs. + +### `paragraph_format` + +```python +paragraph_format +``` + +The `ParagraphFormat` object providing access to the formatting properties +for this paragraph, such as line spacing and indentation. + +### `rendered_page_breaks` + +```python +rendered_page_breaks: List[RenderedPageBreak] +``` + +All rendered page-breaks in this paragraph. + +Most often an empty list, sometimes contains one page-break, but can contain +more than one is rare or contrived cases. + +### `runs` + +```python +runs: List[Run] +``` + +Sequence of `Run` instances corresponding to the elements in this +paragraph. + +### `style` + +```python +style: ParagraphStyle | None +``` + +Read/Write. + +`_ParagraphStyle` object representing the style assigned to this paragraph. If +no explicit style is assigned to this paragraph, its value is the default +paragraph style for the document. A paragraph style name can be assigned in lieu +of a paragraph style object. Assigning `None` removes any applied style, making +its effective value the default paragraph style for the document. + +### `text` + +```python +text: str +``` + +The textual content of this paragraph. + +The text includes the visible-text portion of any hyperlinks in the paragraph. +Tabs and line breaks in the XML are mapped to ``\t`` and ``\n`` characters +respectively. + +Assigning text to this property causes all existing paragraph content to be +replaced with a single run containing the assigned text. A ``\t`` character in +the text is mapped to a ```` element and each ``\n`` or ``\r`` +character is mapped to a line break. Paragraph-level formatting, such as style, +is preserved. All run-level formatting, such as bold or italic, is removed. + + + + + +# `docx.text.parfmt` + +Paragraph-related proxy types. + +## `ParagraphFormat` + +Bases: `ElementProxy` + +Provides access to paragraph formatting such as justification, indentation, line +spacing, space before and after, and widow/orphan control. + +### `alignment` + +```python +alignment +``` + +A member of the `WdParagraphAlignment` enumeration specifying the +justification setting for this paragraph. + +A value of `None` indicates paragraph alignment is inherited from the style +hierarchy. + +### `first_line_indent` + +```python +first_line_indent +``` + +`Length` value specifying the relative difference in indentation for the +first line of the paragraph. + +A positive value causes the first line to be indented. A negative value produces +a hanging indent. `None` indicates first line indentation is inherited from the +style hierarchy. + +### `keep_together` + +```python +keep_together +``` + +`True` if the paragraph should be kept "in one piece" and not broken across a +page boundary when the document is rendered. + +`None` indicates its effective value is inherited from the style hierarchy. + +### `keep_with_next` + +```python +keep_with_next +``` + +`True` if the paragraph should be kept on the same page as the subsequent +paragraph when the document is rendered. + +For example, this property could be used to keep a section heading on the same +page as its first paragraph. `None` indicates its effective value is inherited +from the style hierarchy. + +### `left_indent` + +```python +left_indent +``` + +`Length` value specifying the space between the left margin and the left side +of the paragraph. + +`None` indicates the left indent value is inherited from the style hierarchy. +Use an `Inches` value object as a convenient way to apply indentation in units +of inches. + +### `line_spacing` + +```python +line_spacing +``` + +`float` or `Length` value specifying the space between baselines in +successive lines of the paragraph. + +A value of `None` indicates line spacing is inherited from the style hierarchy. +A float value, e.g. ``2.0`` or ``1.75``, indicates spacing is applied in +multiples of line heights. A `Length` value such as ``Pt(12)`` indicates spacing +is a fixed height. The `Pt` value class is a convenient way to apply line +spacing in units of points. Assigning `None` resets line spacing to inherit from +the style hierarchy. + +### `line_spacing_rule` + +```python +line_spacing_rule +``` + +A member of the `WdLineSpacing` enumeration indicating how the value of +`line_spacing` should be interpreted. + +Assigning any of the `WdLineSpacing` members `SINGLE`, +`DOUBLE`, or `ONE_POINT_FIVE` will cause the value of +`line_spacing` to be updated to produce the corresponding line spacing. + +### `page_break_before` + +```python +page_break_before +``` + +`True` if the paragraph should appear at the top of the page following the +prior paragraph. + +`None` indicates its effective value is inherited from the style hierarchy. + +### `right_indent` + +```python +right_indent +``` + +`Length` value specifying the space between the right margin and the right +side of the paragraph. + +`None` indicates the right indent value is inherited from the style hierarchy. +Use a `Cm` value object as a convenient way to apply indentation in units of +centimeters. + +### `space_after` + +```python +space_after +``` + +`Length` value specifying the spacing to appear between this paragraph and +the subsequent paragraph. + +`None` indicates this value is inherited from the style hierarchy. `Length` +objects provide convenience properties, such as `pt` and +`inches`, that allow easy conversion to various length units. + +### `space_before` + +```python +space_before +``` + +`Length` value specifying the spacing to appear between this paragraph and +the prior paragraph. + +`None` indicates this value is inherited from the style hierarchy. `Length` +objects provide convenience properties, such as `pt` and +`cm`, that allow easy conversion to various length units. + +### `tab_stops` + +```python +tab_stops() +``` + +`TabStops` object providing access to the tab stops defined for this +paragraph format. + +### `widow_control` + +```python +widow_control +``` + +`True` if the first and last lines in the paragraph remain on the same page +as the rest of the paragraph when Word repaginates the document. + +`None` indicates its effective value is inherited from the style hierarchy. + + + + + +# `docx.text.run` + +Run-related proxy objects for python-docx, Run in particular. + +## `Run` + +```python +Run(r: CT_R, parent: t.ProvidesStoryPart) +``` + +Bases: `StoryChild` + +Proxy object wrapping `` element. + +Several of the properties on Run take a tri-state value, `True`, `False`, or `None`. +`True` and `False` correspond to on and off respectively. `None` indicates the +property is not specified directly on the run and its effective value is taken from +the style hierarchy. + +### `add_break` + +```python +add_break(break_type: WD_BREAK = WD_BREAK.LINE) +``` + +Add a break element of `break_type` to this run. + +`break_type` can take the values `WD_BREAK.LINE`, `WD_BREAK.PAGE`, and +`WD_BREAK.COLUMN` where `WD_BREAK` is imported from `docx.enum.text`. +`break_type` defaults to `WD_BREAK.LINE`. + +### `add_picture` + +```python +add_picture(image_path_or_stream: str | IO[bytes], width: int | Length | None = None, height: int | Length | None = None) -> InlineShape +``` + +Return `InlineShape` containing image identified by `image_path_or_stream`. + +The picture is added to the end of this run. + +`image_path_or_stream` can be a path (a string) or a file-like object containing +a binary image. + +If neither width nor height is specified, the picture appears at +its native size. If only one is specified, it is used to compute a scaling +factor that is then applied to the unspecified dimension, preserving the aspect +ratio of the image. The native size of the picture is calculated using the dots- +per-inch (dpi) value specified in the image file, defaulting to 72 dpi if no +value is specified, as is often the case. + +### `add_tab` + +```python +add_tab() -> None +``` + +Add a ```` element at the end of the run, which Word interprets as a +tab character. + +### `add_text` + +```python +add_text(text: str) +``` + +Returns a newly appended `_Text` object (corresponding to a new ```` +child element) to the run, containing `text`. + +Compare with the possibly more friendly approach of assigning text to the +`Run.text` property. + +### `bold` + +```python +bold: bool | None +``` + +Read/write tri-state value. + +When `True`, causes the text of the run to appear in bold face. When `False`, +the text unconditionally appears non-bold. When `None` the bold setting for this +run is inherited from the style hierarchy. + +### `clear` + +```python +clear() +``` + +Return reference to this run after removing all its content. + +All run formatting is preserved. + +### `contains_page_break` + +```python +contains_page_break: bool +``` + +`True` when one or more rendered page-breaks occur in this run. + +Note that "hard" page-breaks inserted by the author are not included. A hard +page-break gives rise to a rendered page-break in the right position so if those +were included that page-break would be "double-counted". + +It would be very rare for multiple rendered page-breaks to occur in a single +run, but it is possible. + +### `element` + +```python +element = r +``` + +### `font` + +```python +font: Font +``` + +The `Font` object providing access to the character formatting properties for +this run, such as font name and size. + +### `italic` + +```python +italic: bool | None +``` + +Read/write tri-state value. + +When `True`, causes the text of the run to appear in italics. When `False`, the +text unconditionally appears non-italic. When `None` the italic setting for this +run is inherited from the style hierarchy. + +### `iter_inner_content` + +```python +iter_inner_content() -> Iterator[str | Drawing | RenderedPageBreak] +``` + +Generate the content-items in this run in the order they appear. + +NOTE: only content-types currently supported by `python-docx` are generated. In +this version, that is text and rendered page-breaks. Drawing is included but +currently only provides access to its XML element (CT_Drawing) on its +`._drawing` attribute. `Drawing` attributes and methods may be expanded in +future releases. + +There are a number of element-types that can appear inside a run, but most of +those (w:br, w:cr, w:noBreakHyphen, w:t, w:tab) have a clear plain-text +equivalent. Any contiguous range of such elements is generated as a single +`str`. Rendered page-break and drawing elements are generated individually. Any +other elements are ignored. + +### `mark_comment_range` + +```python +mark_comment_range(last_run: Run, comment_id: int) -> None +``` + +Mark the runs from this one to `last_run` as a comment range for `comment_id`. + +Called by the comment-anchoring machinery; prefer `Document.add_comment` or +`Span.comment`. Refuses when the two runs belong to different documents, leaving the +XML unchanged. + +### `style` + +```python +style: CharacterStyle +``` + +Read/write. + +A `CharacterStyle` object representing the character style applied to this run. +The default character style for the document (often `Default Character Font`) is +returned if the run has no directly-applied character style. Setting this +property to `None` removes any directly-applied character style. + +### `text` + +```python +text: str +``` + +String formed by concatenating the text equivalent of each run. + +Each `` element adds the text characters it contains. A `` element +adds a `\t` character. A `` or `` element each add a `\n` +character. Note that a `` element can indicate a page break or column +break as well as a line break. Only line-break `` elements translate to +a `\n` character. Others are ignored. All other content child elements, such as +``, are ignored. + +Assigning text to this property has the reverse effect, translating each `\t` +character to a `` element and each `\n` or `\r` character to a +`` element. Any existing run content is replaced. Run formatting is +preserved. + +### `underline` + +```python +underline: bool | WD_UNDERLINE | None +``` + +The underline style for this `Run`. + +Value is one of `None`, `True`, `False`, or a member of `WdUnderline`. + +A value of `None` indicates the run has no directly-applied underline value and +so will inherit the underline value of its containing paragraph. Assigning +`None` to this property removes any directly-applied underline value. + +A value of `False` indicates a directly-applied setting of no underline, +overriding any inherited value. + +A value of `True` indicates single underline. + +The values from `WdUnderline` are used to specify other outline styles such +as double, wavy, and dotted. + +## `rollback_xml_on_error` + +```python +rollback_xml_on_error(root: '_Element') -> Generator[None, None, None] +``` + +Restore one live XML tree after an error in a local compound edit. + + + + + +# `docx.text.tabstops` + +Tabstop-related proxy types. + +## `TabStop` + +```python +TabStop(element) +``` + +Bases: `ElementProxy` + +An individual tab stop applying to a paragraph or style. + +Accessed using list semantics on its containing `TabStops` object. + +### `alignment` + +```python +alignment +``` + +A member of `WdTabAlignment` specifying the alignment setting for this +tab stop. + +Read/write. + +### `leader` + +```python +leader +``` + +A member of `WdTabLeader` specifying a repeating character used as a +"leader", filling in the space spanned by this tab. + +Assigning `None` produces the same result as assigning `WD_TAB_LEADER.SPACES`. +Read/write. + +### `position` + +```python +position +``` + +A `Length` object representing the distance of this tab stop from the inside +edge of the paragraph. + +May be positive or negative. Read/write. + +## `TabStops` + +```python +TabStops(element) +``` + +Bases: `ElementProxy` + +A sequence of `TabStop` objects providing access to the tab stops of a paragraph +or paragraph style. + +Supports iteration, indexed access, del, and len(). It is accesed using the +`tab_stops` property of ParagraphFormat; it is not intended +to be constructed directly. + +### `add_tab_stop` + +```python +add_tab_stop(position, alignment = WD_TAB_ALIGNMENT.LEFT, leader = WD_TAB_LEADER.SPACES) +``` + +Add a new tab stop at `position`, a `Length` object specifying the location +of the tab stop relative to the paragraph edge. + +A negative `position` value is valid and appears in hanging indentation. Tab +alignment defaults to left, but may be specified by passing a member of the +`WdTabAlignment` enumeration as `alignment`. An optional leader character +can be specified by passing a member of the `WdTabLeader` enumeration as +`leader`. + +### `clear_all` + +```python +clear_all() +``` + +Remove all custom tab stops. + + + + + +# `docx.types` + +Abstract types used by `python-docx`. + +## `ProvidesStoryPart` + +Bases: `Protocol` + +An object that provides access to the StoryPart. + +This type is for objects that have a story part like document or header as their +root part. + +### `part` + +```python +part: StoryPart +``` + +## `ProvidesXmlPart` + +Bases: `Protocol` + +An object that provides access to its XmlPart. + +This type is for objects that need access to their part but it either isn't a +StoryPart or they don't care, possibly because they just need access to the package +or related parts. + +### `part` + +```python +part: XmlPart +``` diff --git a/core/services/studio/builtinskills/tree/docx/references/paper-api.md b/addons/sandbox/skills/docx/references/paper-api.md similarity index 99% rename from core/services/studio/builtinskills/tree/docx/references/paper-api.md rename to addons/sandbox/skills/docx/references/paper-api.md index 2c2c4080d..bc2951d07 100644 --- a/core/services/studio/builtinskills/tree/docx/references/paper-api.md +++ b/addons/sandbox/skills/docx/references/paper-api.md @@ -1,3 +1,5 @@ + + # Paper DOCX API Companion This companion covers capabilities beyond familiar `python-docx`. The installed distribution is `paper-docx`, but the import remains `docx`; ordinary `Document`, paragraph, run, style, table, section, picture, header, and footer APIs remain available. diff --git a/core/services/studio/builtinskills/tree/pdf/SKILL.md b/addons/sandbox/skills/pdf/SKILL.md similarity index 88% rename from core/services/studio/builtinskills/tree/pdf/SKILL.md rename to addons/sandbox/skills/pdf/SKILL.md index 29c522bef..0d4c7f828 100644 --- a/core/services/studio/builtinskills/tree/pdf/SKILL.md +++ b/addons/sandbox/skills/pdf/SKILL.md @@ -29,11 +29,11 @@ content; overlays and annotations do not. ## References and helpers -- [Deterministic PDF quality](references/deterministic-pdf-quality.md) describes the mechanical +- [Deterministic PDF quality](references/deterministic-pdf-quality.md#source-1924639cbd4f358c) describes the mechanical verifier and the limits of extracted-geometry heuristics. -- [Content QA](references/content-qa.md) describes final-PDF text extraction. +- [Content QA](references/content-qa.md#source-7cbccb7ea6593740) describes final-PDF text extraction. -The `scripts/` directory contains mechanical checks for openability, page boxes, text layers, +The guest directory `/usr/local/lib/localai/document-skills/pdf/` contains mechanical checks for openability, page boxes, text layers, extracted content, and selected geometry. The verifier's `--strict-layout` mode is designed for known generated layouts with predictable geometry, not arbitrary PDFs, scans, assembled pages, forms, redactions, logos, watermarks, or background artwork. diff --git a/addons/sandbox/skills/pdf/notice.txt b/addons/sandbox/skills/pdf/notice.txt new file mode 100644 index 000000000..e2afba80e --- /dev/null +++ b/addons/sandbox/skills/pdf/notice.txt @@ -0,0 +1,107 @@ +Sandbox document skills +============================= + +The skills "docx", "xlsx", "pptx" and "pdf" are adapted from the skills of the +Feather project. + + Source: https://github.com/paper-instruments/feather-train + (folder feather-harness/src/feather_harness/skills) + Commit: b7463092af862ebbdf4c5920c4bc9ab38ab17ad9 + Licence: MIT, Copyright (c) 2026 Paper Instruments, Inc. + +What was changed: the text about LibreOffice was replaced by a note that +LibreOffice is not installed, the text about OCR was shortened in the same way, +and the generated page of the LibreOffice-backed module "openpyxl.oracle" got +the same note. Each of the four got one line that says to write +helper scripts in the chat's work folder. The remaining built-in skills are not part of this package. + +The MIT licence of the Feather project +-------------------------------------- + +MIT License + +Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +The generated API pages +----------------------- + +The pages under docx/references/api, xlsx/references/api and +pptx/references/api are generated from the docstrings of the Paper libraries +and of the libraries that they extend. The licences of those projects apply to +that text. All three are MIT licences. + +paper-docx extends python-docx, and paper-pptx extends python-pptx. Steve Canny +wrote both upstream libraries, so the two licence files of the Paper packages +have the same text. Each applies to its own package. + + paper-docx https://pypi.org/project/paper-docx/ (python-docx) + paper-pptx https://pypi.org/project/paper-pptx/ (python-pptx) + +The MIT License (MIT) +Copyright (c) 2013 Steve Canny, https://github.com/scanny +Portions Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +paper-xlsx extends openpyxl. + + paper-xlsx https://pypi.org/project/paper-xlsx/ (openpyxl) + +This software is under the MIT Licence +====================================== + +Copyright (c) 2010 openpyxl +Portions Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/core/services/studio/builtinskills/tree/pdf/references/content-qa.md b/addons/sandbox/skills/pdf/references/content-qa.md similarity index 57% rename from core/services/studio/builtinskills/tree/pdf/references/content-qa.md rename to addons/sandbox/skills/pdf/references/content-qa.md index c6cae81c6..7087c062d 100644 --- a/core/services/studio/builtinskills/tree/pdf/references/content-qa.md +++ b/addons/sandbox/skills/pdf/references/content-qa.md @@ -1,3 +1,5 @@ + + # Content QA Content QA extracts text from a PDF and reports: @@ -7,7 +9,7 @@ Content QA extracts text from a PDF and reports: Command: ```bash -python scripts/content_qa.py artifact.pdf --json +python3 /usr/local/lib/localai/document-skills/pdf/content_qa.py artifact.pdf --json ``` The script does not determine semantic completeness, correctness, or whether omissions are diff --git a/core/services/studio/builtinskills/tree/pdf/references/deterministic-pdf-quality.md b/addons/sandbox/skills/pdf/references/deterministic-pdf-quality.md similarity index 83% rename from core/services/studio/builtinskills/tree/pdf/references/deterministic-pdf-quality.md rename to addons/sandbox/skills/pdf/references/deterministic-pdf-quality.md index e99ca4472..a3082d63d 100644 --- a/core/services/studio/builtinskills/tree/pdf/references/deterministic-pdf-quality.md +++ b/addons/sandbox/skills/pdf/references/deterministic-pdf-quality.md @@ -1,3 +1,5 @@ + + # Deterministic PDF Quality The final PDF verifier is a mechanical guard for the rendered PDF package. It intentionally avoids @@ -14,7 +16,7 @@ Default `verify_pdf.py` checks: Command: ```bash -python scripts/verify_pdf.py artifact.pdf --json +python3 /usr/local/lib/localai/document-skills/pdf/verify_pdf.py artifact.pdf --json ``` The default verifier checks mechanical PDF properties; it does not judge semantic completeness or diff --git a/core/services/studio/builtinskills/tree/pptx/SKILL.md b/addons/sandbox/skills/pptx/SKILL.md similarity index 90% rename from core/services/studio/builtinskills/tree/pptx/SKILL.md rename to addons/sandbox/skills/pptx/SKILL.md index c0745b2a6..7f12cc990 100644 --- a/core/services/studio/builtinskills/tree/pptx/SKILL.md +++ b/addons/sandbox/skills/pptx/SKILL.md @@ -22,7 +22,7 @@ Use your existing knowledge of `python-pptx` for normal slides, shapes, text, ta `paper-pptx` is installed under the `pptx` import. -The [Paper API companion](references/paper-api.md) maps Paper-specific capabilities to their public symbols. The [generated API reference](references/api/index.md) covers the complete public API, including the surface inherited from `python-pptx`, with one page per module. It is large; search by symbol and read only the relevant section. +The [Paper API companion](references/paper-api.md#source-bd380984355417c8) maps Paper-specific capabilities to their public symbols. The [generated API reference](references/api-002.md#source-21810f9156652e60) covers the complete public API, including the surface inherited from `python-pptx`, with one page per module. It is large; search by symbol and read only the relevant section. ## Package behavior diff --git a/addons/sandbox/skills/pptx/notice.txt b/addons/sandbox/skills/pptx/notice.txt new file mode 100644 index 000000000..e2afba80e --- /dev/null +++ b/addons/sandbox/skills/pptx/notice.txt @@ -0,0 +1,107 @@ +Sandbox document skills +============================= + +The skills "docx", "xlsx", "pptx" and "pdf" are adapted from the skills of the +Feather project. + + Source: https://github.com/paper-instruments/feather-train + (folder feather-harness/src/feather_harness/skills) + Commit: b7463092af862ebbdf4c5920c4bc9ab38ab17ad9 + Licence: MIT, Copyright (c) 2026 Paper Instruments, Inc. + +What was changed: the text about LibreOffice was replaced by a note that +LibreOffice is not installed, the text about OCR was shortened in the same way, +and the generated page of the LibreOffice-backed module "openpyxl.oracle" got +the same note. Each of the four got one line that says to write +helper scripts in the chat's work folder. The remaining built-in skills are not part of this package. + +The MIT licence of the Feather project +-------------------------------------- + +MIT License + +Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +The generated API pages +----------------------- + +The pages under docx/references/api, xlsx/references/api and +pptx/references/api are generated from the docstrings of the Paper libraries +and of the libraries that they extend. The licences of those projects apply to +that text. All three are MIT licences. + +paper-docx extends python-docx, and paper-pptx extends python-pptx. Steve Canny +wrote both upstream libraries, so the two licence files of the Paper packages +have the same text. Each applies to its own package. + + paper-docx https://pypi.org/project/paper-docx/ (python-docx) + paper-pptx https://pypi.org/project/paper-pptx/ (python-pptx) + +The MIT License (MIT) +Copyright (c) 2013 Steve Canny, https://github.com/scanny +Portions Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +paper-xlsx extends openpyxl. + + paper-xlsx https://pypi.org/project/paper-xlsx/ (openpyxl) + +This software is under the MIT Licence +====================================== + +Copyright (c) 2010 openpyxl +Portions Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/addons/sandbox/skills/pptx/references/api-001.md b/addons/sandbox/skills/pptx/references/api-001.md new file mode 100644 index 000000000..e42a5beab --- /dev/null +++ b/addons/sandbox/skills/pptx/references/api-001.md @@ -0,0 +1,6960 @@ + + + + +# `pptx.action` + +Objects related to mouse click and hover actions on a shape or text. + +## `ActionSetting` + +```python +ActionSetting(xPr: CT_NonVisualDrawingProps | CT_TextCharacterProperties, parent: BaseShape, hover: bool = False) +``` + +Bases: `Subshape` + +Properties specifying how a shape or run reacts to mouse actions. + +### `action` + +```python +action +``` + +Member of `PpActionType` enumeration, such as `PP_ACTION.HYPERLINK`. + +The returned member indicates the type of action that will result when the +specified shape or text is clicked or the mouse pointer is positioned over the +shape during a slide show. + +If there is no click-action or the click-action value is not recognized (is not +one of the official `MsoPpAction` values) then `PP_ACTION.NONE` is returned. + +### `hyperlink` + +```python +hyperlink() -> Hyperlink +``` + +A `Hyperlink` object representing the hyperlink action defined on +this click or hover mouse event. A `Hyperlink` object is always +returned, even if no hyperlink or other click action is defined. + +### `target_slide` + +```python +target_slide: Slide | None +``` + +A reference to the slide in this presentation that is the target of +the slide jump action in this shape. Slide jump actions include +`PP_ACTION.FIRST_SLIDE`, `LAST_SLIDE`, `NEXT_SLIDE`, +`PREVIOUS_SLIDE`, and `NAMED_SLIDE`. Returns `None` for all other +actions. In particular, the `LAST_SLIDE_VIEWED` action and the `PLAY` +(start other presentation) actions are not supported. + +A slide object may be assigned to this property, which makes the +shape an "internal hyperlink" to the assigened slide:: + + slide, target_slide = prs.slides[0], prs.slides[1] + shape = slide.shapes[0] + shape.target_slide = target_slide + +Assigning `None` removes any slide jump action. Note that this is +accomplished by removing any action present (such as a hyperlink), +without first checking that it is a slide jump action. + +## `Hyperlink` + +```python +Hyperlink(xPr: CT_NonVisualDrawingProps | CT_TextCharacterProperties, parent: BaseShape, hover: bool = False) +``` + +Bases: `Subshape` + +Represents a hyperlink action on a shape or text run. + +### `address` + +```python +address: str | None +``` + +Read/write. The URL of the hyperlink. + +URL can be on http, https, mailto, or file scheme; others may work. Returns `None` if no +hyperlink is defined, including when another action such as `RUN_MACRO` is defined on the +object. Assigning `None` removes any action defined on the object, whether it is a hyperlink +action or not. + + + + + +# `pptx.api` + +Directly exposed API classes, Presentation for now. + +## `Presentation` + +```python +Presentation(pptx: str | IO[bytes] | None = None) -> presentation.Presentation +``` + +Return a `Presentation` object loaded from *pptx*, where *pptx* can be +either a path to a ``.pptx`` file (a string) or a file-like object. If +*pptx* is missing or ``None``, the built-in default presentation +"template" is loaded. + + + + + +# `pptx.chart.axis` + +Axis-related chart objects. + +## `AxisTitle` + +```python +AxisTitle(title) +``` + +Bases: `ElementProxy` + +Provides properties for manipulating axis title. + +### `format` + +```python +format() +``` + +`ChartFormat` object providing access to shape formatting. + +Return the `ChartFormat` object providing shape formatting properties +for this axis title, such as its line color and fill. + +### `has_text_frame` + +```python +has_text_frame +``` + +Read/write Boolean specifying presence of a text frame. + +Return `True` if this axis title has a text frame, and `False` +otherwise. Assigning `True` causes a text frame to be added if not +already present. Assigning `False` causes any existing text frame to +be removed along with any text contained in the text frame. + +### `text_frame` + +```python +text_frame +``` + +`TextFrame` instance for this axis title. + +Return a `TextFrame` instance allowing read/write access to the text +of this axis title and its text formatting properties. Accessing this +property is destructive as it adds a new text frame if not already +present. + +## `CategoryAxis` + +Bases: `_BaseAxis` + +A category axis of a chart. + +### `category_type` + +```python +category_type +``` + +A member of `XlCategoryType` specifying the scale type of this +axis. Unconditionally ``CATEGORY_SCALE`` for a `CategoryAxis` object. + +## `DateAxis` + +Bases: `_BaseAxis` + +A category axis with dates as its category labels. + +This axis-type has some special display behaviors such as making length of equal +periods equal and normalizing month start dates despite unequal month lengths. + +### `category_type` + +```python +category_type +``` + +A member of `XlCategoryType` specifying the scale type of this +axis. Unconditionally ``TIME_SCALE`` for a `DateAxis` object. + +## `MajorGridlines` + +```python +MajorGridlines(xAx) +``` + +Bases: `ElementProxy` + +Provides access to the properties of the major gridlines appearing on an axis. + +### `format` + +```python +format() +``` + +The `ChartFormat` object providing access to the shape formatting +properties of this data point, such as line and fill. + +## `TickLabels` + +```python +TickLabels(xAx_elm) +``` + +Bases: `object` + +A service class providing access to formatting of axis tick mark labels. + +### `font` + +```python +font() +``` + +The `Font` object that provides access to the text properties for +these tick labels, such as bold, italic, etc. + +### `number_format` + +```python +number_format +``` + +Read/write string (e.g. "$#,##0.00") specifying the format for the +numbers on this axis. The syntax for these strings is the same as it +appears in the PowerPoint or Excel UI. Returns 'General' if no number +format has been set. Note that this format string has no effect on +rendered tick labels when `number_format_is_linked` is `True`. +Assigning a format string to this property automatically sets +`number_format_is_linked` to `False`. + +### `number_format_is_linked` + +```python +number_format_is_linked +``` + +Read/write boolean specifying whether number formatting should be +taken from the source spreadsheet rather than the value of +`number_format`. + +### `offset` + +```python +offset +``` + +Read/write int value in range 0-1000 specifying the spacing between +the tick mark labels and the axis as a percentange of the default +value. 100 if no label offset setting is present. + +## `ValueAxis` + +Bases: `_BaseAxis` + +An axis having continuous (as opposed to discrete) values. + +The vertical axis is generally a value axis, however both axes of an XY-type chart +are value axes. + +### `crosses` + +```python +crosses +``` + +Member of `XlAxisCrosses` enumeration specifying the point on +this axis where the other axis crosses, such as auto/zero, minimum, +or maximum. Returns `XL_AXIS_CROSSES.CUSTOM` when a specific numeric +crossing point (e.g. 1.5) is defined. + +### `crosses_at` + +```python +crosses_at +``` + +Numeric value on this axis at which the perpendicular axis crosses. +Returns `None` if no crossing value is set. + +### `major_unit` + +```python +major_unit +``` + +The float number of units between major tick marks on this value +axis. `None` corresponds to the 'Auto' setting in the UI, and +specifies the value should be calculated by PowerPoint based on the +underlying chart data. + +### `minor_unit` + +```python +minor_unit +``` + +The float number of units between minor tick marks on this value +axis. `None` corresponds to the 'Auto' setting in the UI, and +specifies the value should be calculated by PowerPoint based on the +underlying chart data. + + + + + +# `pptx.chart.category` + +Category-related objects. + +## `Categories` + +```python +Categories(xChart) +``` + +Bases: `Sequence` + +A sequence of `category.Category` objects, each representing a category +label on the chart. Provides properties for dealing with hierarchical +categories. + +### `depth` + +```python +depth +``` + +Return an integer representing the number of hierarchical levels in +this category collection. Returns 1 for non-hierarchical categories +and 0 if no categories are present (generally meaning no series are +present). + +### `flattened_labels` + +```python +flattened_labels +``` + +Return a sequence of tuples, each containing the flattened hierarchy +of category labels for a leaf category. Each tuple is in parent -> +child order, e.g. ``('US', 'CA', 'San Francisco')``, with the leaf +category appearing last. If this categories collection is +non-hierarchical, each tuple will contain only a leaf category label. +If the plot has no series (and therefore no categories), an empty +tuple is returned. + +### `levels` + +```python +levels +``` + +Return a sequence of `CategoryLevel` objects representing the +hierarchy of this category collection. The sequence is empty when the +category collection is not hierarchical, that is, contains only +leaf-level categories. The levels are ordered from the leaf level to +the root level; so the first level will contain the same categories +as this category collection. + +## `Category` + +```python +Category(pt, idx = None) +``` + +Bases: `str` + +An extension of `str` that provides the category label as its string +value, and additional attributes representing other aspects of the +category. + +*idx* is a required attribute of a c:pt element, but must be +specified when pt is None, as when a "placeholder" category is +created to represent a missing c:pt element. + +### `idx` + +```python +idx +``` + +Return an integer representing the index reference of this category. +For a leaf node, the index identifies the category. For a parent (or +other ancestor) category, the index specifies the first leaf category +that ancestor encloses. + +### `label` + +```python +label +``` + +Return the label of this category as a string. + +## `CategoryLevel` + +```python +CategoryLevel(lvl) +``` + +Bases: `Sequence` + +A sequence of `category.Category` objects representing a single level in +a hierarchical category collection. This object is only used when the +categories are hierarchical, meaning they have more than one level and +higher level categories group those at lower levels. + + + + + +# `pptx.chart.chart` + +Chart-related objects such as Chart and ChartTitle. + +## `Chart` + +```python +Chart(chartSpace, chart_part) +``` + +Bases: `PartElementProxy` + +A chart object. + +### `category_axis` + +```python +category_axis +``` + +The category axis of this chart. In the case of an XY or Bubble +chart, this is the X axis. Raises `ValueError` if no category +axis is defined (as is the case for a pie chart, for example). + +### `chart_style` + +```python +chart_style +``` + +Read/write integer index of chart style used to format this chart. +Range is from 1 to 48. Value is `None` if no explicit style has been +assigned, in which case the default chart style is used. Assigning +`None` causes any explicit setting to be removed. The integer index +corresponds to the style's position in the chart style gallery in the +PowerPoint UI. + +### `chart_title` + +```python +chart_title +``` + +A `ChartTitle` object providing access to title properties. + +Calling this property is destructive in the sense it adds a chart +title element (`c:title`) to the chart XML if one is not already +present. Use `has_title` to test for presence of a chart title +non-destructively. + +### `chart_type` + +```python +chart_type +``` + +Member of `XlChartType` enumeration specifying type of this chart. + +If the chart has two plots, for example, a line plot overlayed on a bar plot, +the type reported is for the first (back-most) plot. Read-only. + +### `font` + +```python +font() +``` + +Font object controlling text format defaults for this chart. + +### `has_legend` + +```python +has_legend +``` + +Read/write boolean, `True` if the chart has a legend. Assigning +`True` causes a legend to be added to the chart if it doesn't already +have one. Assigning False removes any existing legend definition +along with any existing legend settings. + +### `has_title` + +```python +has_title +``` + +Read/write boolean, specifying whether this chart has a title. + +Assigning `True` causes a title to be added if not already present. +Assigning `False` removes any existing title along with its text and +settings. + +### `legend` + +```python +legend +``` + +A `Legend` object providing access to the properties of the legend +for this chart. + +### `plots` + +```python +plots() +``` + +The sequence of plots in this chart. A plot, called a *chart group* +in the Microsoft API, is a distinct sequence of one or more series +depicted in a particular charting type. For example, a chart having +a series plotted as a line overlaid on three series plotted as +columns would have two plots; the first corresponding to the three +column series and the second to the line series. Plots are sequenced +in the order drawn, i.e. back-most to front-most. Supports *len()*, +membership (e.g. ``p in plots``), iteration, slicing, and indexed +access (e.g. ``plot = plots[i]``). + +### `replace_data` + +```python +replace_data(chart_data) +``` + +Use the categories and series values in the `ChartData` object +*chart_data* to replace those in the XML and Excel worksheet for this +chart. + +### `replace_data_safe` + +```python +replace_data_safe(categories, series, *, number_format = None) +``` + +Validate `categories`/`series` fully, then route to `replace_data`. + +paper-pptx addition: the safety-and-addressing wrapper over the existing replacement +mechanism. `categories` is a sequence of str; `series` is a sequence of +`(name, values)` pairs where each `values` is a sequence of numbers (or None for a +missing point) exactly as long as `categories`. + +Data-shape problems raise `ValueError` (programmer error). Structural refusals +(`UnsupportedStructureError`, document untouched): a chart type outside the +supported category-chart families (XY/bubble/stock/surface/radar and 3-D variants +are not supported) or a multi-plot (combo) chart. Charts without an embedded +workbook (e.g. LibreOffice/Google-authored) are supported: their chart +XML is rewritten and the (absent) workbook update is skipped. + +### `series` + +```python +series() +``` + +A `SeriesCollection` object containing all the series in this +chart. When the chart has multiple plots, all the series for the +first plot appear before all those for the second, and so on. Series +within a plot have an explicit ordering and appear in that sequence. + +### `value_axis` + +```python +value_axis +``` + +The `ValueAxis` object providing access to properties of the value +axis of this chart. Raises `ValueError` if the chart has no value +axis. + +## `ChartTitle` + +```python +ChartTitle(title) +``` + +Bases: `ElementProxy` + +Provides properties for manipulating a chart title. + +### `format` + +```python +format() +``` + +`ChartFormat` object providing access to line and fill formatting. + +Return the `ChartFormat` object providing shape formatting properties +for this chart title, such as its line color and fill. + +### `has_text_frame` + +```python +has_text_frame +``` + +Read/write Boolean specifying whether this title has a text frame. + +Return `True` if this chart title has a text frame, and `False` +otherwise. Assigning `True` causes a text frame to be added if not +already present. Assigning `False` causes any existing text frame to +be removed along with its text and formatting. + +### `text_frame` + +```python +text_frame +``` + +`TextFrame` instance for this chart title. + +Return a `TextFrame` instance allowing read/write access to the text +of this chart title and its text formatting properties. Accessing this +property is destructive in the sense it adds a text frame if one is +not present. Use `has_text_frame` to test for the presence of +a text frame non-destructively. + + + + + +# `pptx.chart.data` + +ChartData and related objects. + +## `BubbleChartData` + +Bases: `XyChartData` + +A specialized ChartData object suitable for use with a bubble chart. +A bubble chart is essentially an XY chart where the markers are scaled to +provide a third quantitative dimension to the exhibit. + +### `add_series` + +```python +add_series(name, number_format = None) +``` + +Return a `BubbleSeriesData` object newly created and added at the end +of this sequence, and having series named *name* and values formatted +with *number_format*. + +### `bubble_sizes_ref` + +```python +bubble_sizes_ref(series) +``` + +The Excel worksheet reference for the range containing the bubble +sizes for *series*. + +## `BubbleDataPoint` + +```python +BubbleDataPoint(series_data, x, y, size, number_format) +``` + +Bases: `XyDataPoint` + +A data point in a bubble chart series. Provides access to the x, y, and +size values of the datapoint. + +### `bubble_size` + +```python +bubble_size +``` + +The value representing the size of the bubble for this data point. + +## `BubbleSeriesData` + +Bases: `XySeriesData` + +The data specific to a particular Bubble chart series. It provides access +to the series label, the series data points, and an optional number +format to be applied to each data point not having a specified number +format. + +The sequence of data points in a bubble chart series is maintained +throughout the chart building process because a data point has no unique +identifier and can only be retrieved by index. + +### `add_data_point` + +```python +add_data_point(x, y, size, number_format = None) +``` + +Append a new BubbleDataPoint object having the values *x*, *y*, and +*size*. The optional *number_format* is used to format the Y value. +If not provided, the number format is inherited from the series data. + +### `bubble_sizes` + +```python +bubble_sizes +``` + +A sequence containing the bubble size for each datapoint in this +series, in data point order. + +### `bubble_sizes_ref` + +```python +bubble_sizes_ref +``` + +The Excel worksheet reference for the range containing the bubble +sizes for this series. + +## `Categories` + +```python +Categories() +``` + +Bases: `Sequence` + +A sequence of `data.Category` objects, also having certain hierarchical +graph behaviors for support of multi-level (nested) categories. + +### `add_category` + +```python +add_category(label) +``` + +Return a newly created `data.Category` object having *label* and +appended to the end of this category sequence. *label* can be +a string, a number, a datetime.date, or datetime.datetime object. All +category labels in a chart must be the same type. All category labels +in a chart having multi-level categories must be strings. + +Creating a chart from chart data having date categories will cause +the chart to have a `DateAxis` for its category axis. + +### `are_dates` + +```python +are_dates +``` + +Return `True` if the first category in this collection has a date +label (as opposed to str or numeric). A date label is one of type +datetime.date or datetime.datetime. Returns `False` otherwise, +including when this category collection is empty. It also returns +False when this category collection is hierarchical, because +hierarchical categories can only be written as string labels. + +### `are_numeric` + +```python +are_numeric +``` + +Return `True` if the first category in this collection has a numeric +label (as opposed to a string label), including if that value is +a datetime.date or datetime.datetime object (as those are converted +to integers for storage in Excel). Returns `False` otherwise, +including when this category collection is empty. It also returns +False when this category collection is hierarchical, because +hierarchical categories can only be written as string labels. + +### `depth` + +```python +depth +``` + +The number of hierarchy levels in this category graph. Returns 0 if +it contains no categories. + +### `index` + +```python +index(category) +``` + +The offset of *category* in the overall sequence of leaf categories. +A non-leaf category gets the index of its first sub-category. + +### `leaf_count` + +```python +leaf_count +``` + +The number of leaf-level categories in this hierarchy. The return +value is the same as that of `len()` only when the hierarchy is +single level. + +### `levels` + +```python +levels +``` + +A generator of (idx, label) sequences representing the category +hierarchy from the bottom up. The first level contains all leaf +categories, and each subsequent is the next level up. + +### `number_format` + +```python +number_format +``` + +Read/write. Return a string representing the number format used in +Excel to format these category values, e.g. '0.0' or 'mm/dd/yyyy'. +This string is only relevant when the categories are numeric or date +type, although it returns 'General' without error when the categories +are string labels. Assigning `None` causes the default number format +to be used, based on the type of the category labels. + +## `Category` + +```python +Category(label, parent) +``` + +Bases: `object` + +A chart category, primarily having a label to be displayed on the +category axis, but also able to be configured in a hierarchy for support +of multi-level category charts. + +### `add_sub_category` + +```python +add_sub_category(label) +``` + +Return a newly created `data.Category` object having *label* and +appended to the end of the sub-category sequence for this category. + +### `depth` + +```python +depth +``` + +The number of hierarchy levels rooted at this category node. Returns +1 if this category has no sub-categories. + +### `idx` + +```python +idx +``` + +The offset of this category in the overall sequence of leaf +categories. A non-leaf category gets the index of its first +sub-category. + +### `index` + +```python +index(sub_category) +``` + +The offset of *sub_category* in the overall sequence of leaf +categories. + +### `label` + +```python +label +``` + +The value that appears on the axis for this category. The label can +be a string, a number, or a datetime.date or datetime.datetime +object. + +### `leaf_count` + +```python +leaf_count +``` + +The number of leaf category nodes under this category. Returns +1 if this category has no sub-categories. + +### `numeric_str_val` + +```python +numeric_str_val(date_1904 = False) +``` + +The string representation of the numeric (or date) label of this +category, suitable for use in the XML `c:pt` element for this +category. The optional *date_1904* parameter specifies the epoch used +for calculating Excel date numbers. + +### `sub_categories` + +```python +sub_categories +``` + +The sequence of child categories for this category. + +## `CategoryChartData` + +Bases: `_BaseChartData` + +Accumulates data specifying the categories and series values for a chart +and acts as a proxy for the chart data table that will be written to an +Excel worksheet. Used as a parameter in `shapes.add_chart` and +`Chart.replace_data`. + +This object is suitable for use with category charts, i.e. all those +having a discrete set of label values (categories) as the range of their +independent variable (X-axis) values. Unlike the ChartData types for +charts supporting a continuous range of independent variable values (such +as XyChartData), CategoryChartData has a single collection of category +(X) values and each data point in its series specifies only the Y value. +The corresponding X value is inferred by its position in the sequence. + +### `add_category` + +```python +add_category(label) +``` + +Return a newly created `data.Category` object having *label* and +appended to the end of the category collection for this chart. +*label* can be a string, a number, a datetime.date, or +datetime.datetime object. All category labels in a chart must be the +same type. All category labels in a chart having multi-level +categories must be strings. + +### `add_series` + +```python +add_series(name, values = (), number_format = None) +``` + +Add a series to this data set entitled *name* and having the data +points specified by *values*, an iterable of numeric values. +*number_format* specifies how the series values will be displayed, +and may be a string, e.g. '#,##0' corresponding to an Excel number +format. + +### `categories` + +```python +categories +``` + +`data.Categories` object providing access to category-object hierarchy. + +Assigning an iterable of category labels (strings, numbers, or dates) replaces +the `data.Categories` object with a new one containing a category for each label +in the sequence. + +Creating a chart from chart data having date categories will cause the chart to +have a `DateAxis` for its category axis. + +### `categories_ref` + +```python +categories_ref +``` + +The Excel worksheet reference to the categories for this chart (not +including the column heading). + +### `values_ref` + +```python +values_ref(series) +``` + +The Excel worksheet reference to the values for *series* (not +including the column heading). + +## `CategoryDataPoint` + +```python +CategoryDataPoint(series_data, value, number_format) +``` + +Bases: `_BaseDataPoint` + +A data point in a category chart series. Provides access to the value of +the datapoint and the number format with which it should appear in the +Excel file. + +### `value` + +```python +value +``` + +The (Y) value for this category data point. + +## `CategorySeriesData` + +Bases: `_BaseSeriesData` + +The data specific to a particular category chart series. It provides +access to the series label, the series data points, and an optional +number format to be applied to each data point not having a specified +number format. + +### `add_data_point` + +```python +add_data_point(value, number_format = None) +``` + +Return a CategoryDataPoint object newly created with value *value*, +an optional *number_format*, and appended to this sequence. + +### `categories` + +```python +categories +``` + +The `data.Categories` object that provides access to the category +objects for this series. + +### `categories_ref` + +```python +categories_ref +``` + +The Excel worksheet reference to the categories for this chart (not +including the column heading). + +### `values` + +```python +values +``` + +A sequence containing the (Y) value of each datapoint in this series, +in data point order. + +### `values_ref` + +```python +values_ref +``` + +The Excel worksheet reference to the (Y) values for this series (not +including the column heading). + +## `ChartData` + +Bases: `CategoryChartData` + +`ChartData` is simply an alias for `CategoryChartData` and may be removed +in a future release. All new development should use `CategoryChartData` +for creating or replacing the data in chart types other than XY and +Bubble. + +## `XyChartData` + +Bases: `_BaseChartData` + +A specialized ChartData object suitable for use with an XY (aka. scatter) +chart. Unlike ChartData, it has no category sequence. Rather, each data +point of each series specifies both an X and a Y value. + +### `add_series` + +```python +add_series(name, number_format = None) +``` + +Return an `XySeriesData` object newly created and added at the end of +this sequence, identified by *name* and values formatted with +*number_format*. + +## `XyDataPoint` + +```python +XyDataPoint(series_data, x, y, number_format) +``` + +Bases: `_BaseDataPoint` + +A data point in an XY chart series. Provides access to the x and y values +of the datapoint. + +### `x` + +```python +x +``` + +The X value for this XY data point. + +### `y` + +```python +y +``` + +The Y value for this XY data point. + +## `XySeriesData` + +Bases: `_BaseSeriesData` + +The data specific to a particular XY chart series. It provides access to +the series label, the series data points, and an optional number format +to be applied to each data point not having a specified number format. + +The sequence of data points in an XY series is significant; lines are +plotted following the sequence of points, even if that causes a line +segment to "travel backward" (implying a multi-valued function). The data +points are not automatically sorted into increasing order by X value. + +### `add_data_point` + +```python +add_data_point(x, y, number_format = None) +``` + +Return an XyDataPoint object newly created with values *x* and *y*, +and appended to this sequence. + + + + + +# `pptx.chart.datalabel` + +Data label-related objects. + +## `DataLabel` + +```python +DataLabel(ser, idx) +``` + +Bases: `object` + +The data label associated with an individual data point. + +### `font` + +```python +font() +``` + +The `Font` object providing text formatting for this data label. + +This font object is used to customize the appearance of automatically +inserted text, such as the data point value. The font applies to the +entire data label. More granular control of the appearance of custom +data label text is controlled by a font object on runs in the text +frame. + +### `has_text_frame` + +```python +has_text_frame +``` + +Return `True` if this data label has a text frame (implying it has +custom data label text), and `False` otherwise. Assigning `True` +causes a text frame to be added if not already present. Assigning +`False` causes any existing text frame to be removed along with any +text contained in the text frame. + +### `position` + +```python +position +``` + +Read/write `XlDataLabelPosition` member specifying the position +of this data label with respect to its data point, or `None` if no +position is specified. Assigning `None` causes PowerPoint to choose +the default position, which varies by chart type. + +### `text_frame` + +```python +text_frame +``` + +`TextFrame` instance for this data label, containing the text of the +data label and providing access to its text formatting properties. + +## `DataLabels` + +```python +DataLabels(dLbls) +``` + +Bases: `object` + +Provides access to properties of data labels for a plot or a series. + +This is not a collection and does not provide access to individual data +labels. Access to individual labels is via the `Point` object. The +properties this object provides control formatting of *all* the data +labels in its scope. + +### `font` + +```python +font() +``` + +The `Font` object that provides access to the text properties for +these data labels, such as bold, italic, etc. + +### `number_format` + +```python +number_format +``` + +Read/write string specifying the format for the numbers on this set +of data labels. Returns 'General' if no number format has been set. +Note that this format string has no effect on rendered data labels +when `number_format_is_linked` is `True`. Assigning a format +string to this property automatically sets +`number_format_is_linked` to `False`. + +### `number_format_is_linked` + +```python +number_format_is_linked +``` + +Read/write boolean specifying whether number formatting should be +taken from the source spreadsheet rather than the value of +`number_format`. + +### `position` + +```python +position +``` + +Read/write `XlDataLabelPosition` enumeration value specifying +the position of the data labels with respect to their data point, or +`None` if no position is specified. Assigning `None` causes +PowerPoint to choose the default position, which varies by chart +type. + +### `show_category_name` + +```python +show_category_name +``` + +Read/write. True when name of category should appear in label. + +### `show_legend_key` + +```python +show_legend_key +``` + +Read/write. True when data label displays legend-color swatch. + +### `show_percentage` + +```python +show_percentage +``` + +Read/write. True when data label displays percentage. + +This option is not operative on all chart types. Percentage appears +on polar charts such as pie and donut. + +### `show_series_name` + +```python +show_series_name +``` + +Read/write. True when data label displays series name. + +### `show_value` + +```python +show_value +``` + +Read/write. True when label displays numeric value of datapoint. + + + + + +# `pptx.chart.legend` + +Legend of a chart. + +## `Legend` + +```python +Legend(legend_elm) +``` + +Bases: `object` + +Represents the legend in a chart. A chart can have at most one legend. + +### `font` + +```python +font() +``` + +The `Font` object that provides access to the text properties for +this legend, such as bold, italic, etc. + +### `horz_offset` + +```python +horz_offset +``` + +Adjustment of the x position of the legend from its default. +Expressed as a float between -1.0 and 1.0 representing a fraction of +the chart width. Negative values move the legend left, positive +values move it to the right. `None` if no setting is specified. + +### `include_in_layout` + +```python +include_in_layout +``` + +`True` if legend should be located inside plot area. + +Read/write boolean specifying whether legend should be placed inside +the plot area. In many cases this will cause it to be superimposed on +the chart itself. Assigning `None` to this property causes any +`c:overlay` element to be removed, which is interpreted the same as +`True`. This use case should rarely be required and assigning +a boolean value is recommended. + +### `position` + +```python +position +``` + +Read/write `XlLegendPosition` enumeration value specifying the +general region of the chart in which to place the legend. + + + + + +# `pptx.chart.marker` + +Marker-related objects. + +## `Marker` + +Bases: `ElementProxy` + +Represents a data point marker, such as a diamond or circle, on +a line-type chart. + +### `format` + +```python +format() +``` + +The `ChartFormat` instance for this marker, providing access to shape +properties such as fill and line. + +### `size` + +```python +size +``` + +An integer between 2 and 72 inclusive indicating the size of this +marker in points. A value of `None` indicates no explicit value is +set and the size is inherited from a higher-level setting or the +PowerPoint default (which may be 9). Assigning `None` removes any +explicitly assigned size, causing this value to be inherited. + +### `style` + +```python +style +``` + +A member of the `XlMarkerStyle` enumeration indicating the shape +of this marker. Returns `None` if no explicit style has been set, +which corresponds to the "Automatic" option in the PowerPoint UI. + + + + + +# `pptx.chart.plot` + +Plot-related objects. + +## `Area3DPlot` + +Bases: `_BasePlot` + +A 3-dimensional area plot. + +## `AreaPlot` + +Bases: `_BasePlot` + +An area plot. + +## `BarPlot` + +Bases: `_BasePlot` + +A bar chart-style plot. + +### `gap_width` + +```python +gap_width +``` + +Width of gap between bar(s) of each category, as an integer +percentage of the bar width. The default value for a new bar chart is +150, representing 150% or 1.5 times the width of a single bar. + +### `overlap` + +```python +overlap +``` + +Read/write int value in range -100..100 specifying a percentage of +the bar width by which to overlap adjacent bars in a multi-series bar +chart. Default is 0. A setting of -100 creates a gap of a full bar +width and a setting of 100 causes all the bars in a category to be +superimposed. A stacked bar plot has overlap of 100 by default. + +## `BubblePlot` + +Bases: `_BasePlot` + +A bubble chart plot. + +### `bubble_scale` + +```python +bubble_scale +``` + +An integer between 0 and 300 inclusive indicating the percentage of +the default size at which bubbles should be displayed. Assigning +`None` produces the same behavior as assigning `100`. + +## `DoughnutPlot` + +Bases: `_BasePlot` + +An doughnut plot. + +## `LinePlot` + +Bases: `_BasePlot` + +A line chart-style plot. + +## `PiePlot` + +Bases: `_BasePlot` + +A pie chart-style plot. + +## `PlotFactory` + +```python +PlotFactory(xChart, chart) +``` + +Return an instance of the appropriate subclass of _BasePlot based on the +tagname of *xChart*. + +## `PlotTypeInspector` + +Bases: `object` + +"One-shot" service object that knows how to identify the type of a plot +as a member of the XL_CHART_TYPE enumeration. + +### `chart_type` + +```python +chart_type(plot) +``` + +Return the member of `XlChartType` that corresponds to the chart +type of *plot*. + +## `RadarPlot` + +Bases: `_BasePlot` + +A radar-style plot. + +## `XyPlot` + +Bases: `_BasePlot` + +An XY (scatter) plot. + + + + + +# `pptx.chart.point` + +Data point-related objects. + +## `BubblePoints` + +Bases: `_BasePoints` + +Sequence providing access to the individual data points in +a `BubbleSeries` object. + +## `CategoryPoints` + +Bases: `_BasePoints` + +Sequence providing access to individual `Point` objects, each +representing the visual properties of a data point in the specified +category series. + +## `Point` + +```python +Point(ser, idx) +``` + +Bases: `object` + +Provides access to the properties of an individual data point in +a series, such as the visual properties of its marker and the text and +font of its data label. + +### `data_label` + +```python +data_label() +``` + +The `DataLabel` object representing the label on this data point. + +### `format` + +```python +format() +``` + +The `ChartFormat` object providing access to the shape formatting +properties of this data point, such as line and fill. + +### `marker` + +```python +marker() +``` + +The `Marker` instance for this point, providing access to the visual +properties of the data point marker, such as fill and line. Setting +these properties overrides any value set at the series level. + +## `XyPoints` + +Bases: `_BasePoints` + +Sequence providing access to the individual data points in an `XySeries` +object. + + + + + +# `pptx.chart.series` + +Series-related objects. + +## `AreaSeries` + +Bases: `_BaseCategorySeries` + +A data point series belonging to an area plot. + +## `BarSeries` + +Bases: `_BaseCategorySeries` + +A data point series belonging to a bar plot. + +### `invert_if_negative` + +```python +invert_if_negative +``` + +`True` if a point having a value less than zero should appear with a +fill different than those with a positive value. `False` if the fill +should be the same regardless of the bar's value. When `True`, a bar +with a solid fill appears with white fill; in a bar with gradient +fill, the direction of the gradient is reversed, e.g. dark -> light +instead of light -> dark. The term "invert" here should be understood +to mean "invert the *direction* of the *fill gradient*". + +## `BubbleSeries` + +Bases: `XySeries` + +A data point series belonging to a bubble plot. + +### `points` + +```python +points() +``` + +The `BubblePoints` object providing access to individual data point +objects used to discover and adjust the formatting and data labels of +a data point. + +## `LineSeries` + +Bases: `_BaseCategorySeries`, `_MarkerMixin` + +A data point series belonging to a line plot. + +### `smooth` + +```python +smooth +``` + +Read/write boolean specifying whether to use curve smoothing to +form the line connecting the data points in this series into +a continuous curve. If `False`, a series of straight line segments +are used to connect the points. + +## `PieSeries` + +Bases: `_BaseCategorySeries` + +A data point series belonging to a pie plot. + +## `RadarSeries` + +Bases: `_BaseCategorySeries`, `_MarkerMixin` + +A data point series belonging to a radar plot. + +## `SeriesCollection` + +```python +SeriesCollection(parent_elm) +``` + +Bases: `Sequence` + +A sequence of `Series` objects. + +## `XySeries` + +Bases: `_BaseSeries`, `_MarkerMixin` + +A data point series belonging to an XY (scatter) plot. + +### `iter_values` + +```python +iter_values() +``` + +Generate each float Y value in this series, in the order they appear +on the chart. A value of `None` represents a missing Y value +(corresponding to a blank Excel cell). + +### `points` + +```python +points() +``` + +The `XyPoints` object providing access to individual data points in +this series. + +### `values` + +```python +values +``` + +Read-only. A sequence containing the float values for this series, in +the order they appear on the chart. + + + + + +# `pptx.chart.xlsx` + +Chart builder and related objects. + +## `BubbleWorkbookWriter` + +Bases: `XyWorkbookWriter` + +Service object that knows how to write an Excel workbook from bubble +chart data. + +### `bubble_sizes_ref` + +```python +bubble_sizes_ref(series) +``` + +The Excel worksheet reference to the range containing the bubble +sizes for *series* (not including the column heading cell). + +## `CategoryWorkbookWriter` + +Bases: `_BaseWorkbookWriter` + +Determines Excel worksheet layout and can write an Excel workbook from +a CategoryChartData object. Serves as the authority for Excel worksheet +ranges. + +### `categories_ref` + +```python +categories_ref +``` + +The Excel worksheet reference to the categories for this chart (not +including the column heading). + +### `series_name_ref` + +```python +series_name_ref(series) +``` + +Return the Excel worksheet reference to the cell containing the name +for *series*. This also serves as the column heading for the series +values. + +### `values_ref` + +```python +values_ref(series) +``` + +The Excel worksheet reference to the values for this series (not +including the column heading). + +## `XyWorkbookWriter` + +Bases: `_BaseWorkbookWriter` + +Determines Excel worksheet layout and can write an Excel workbook from XY +chart data. Serves as the authority for Excel worksheet ranges. + +### `series_name_ref` + +```python +series_name_ref(series) +``` + +Return the Excel worksheet reference to the cell containing the name +for *series*. This also serves as the column heading for the series +Y values. + +### `series_table_row_offset` + +```python +series_table_row_offset(series) +``` + +Return the number of rows preceding the data table for *series* in +the Excel worksheet. + +### `x_values_ref` + +```python +x_values_ref(series) +``` + +The Excel worksheet reference to the X values for this chart (not +including the column label). + +### `y_values_ref` + +```python +y_values_ref(series) +``` + +The Excel worksheet reference to the Y values for this chart (not +including the column label). + + + + + +# `pptx.chart.xmlwriter` + +Composers for default chart XML for various chart types. + +## `ChartXmlWriter` + +```python +ChartXmlWriter(chart_type, chart_data) +``` + +Factory function returning appropriate XML writer object for +*chart_type*, loaded with *chart_type* and *chart_data*. + +## `SeriesXmlRewriterFactory` + +```python +SeriesXmlRewriterFactory(chart_type, chart_data) +``` + +Return a `_BaseSeriesXmlRewriter` subclass appropriate to *chart_type*. + + + + + +# `pptx.compose` + +Cross-presentation slide import and deck merge (paper-pptx addition). + +## `ImportReport` + +```python +ImportReport(mode: str, source_slide: str, dest_slide: str, dest_slide_id: int, position: int, layout_binding: str, layout_binding_method: str, placeholder_map_used: Tuple[Tuple[int, Optional[int]], ...], parts_added: Tuple[str, ...], parts_reused: Tuple[str, ...], notes_copied: bool, comments_dropped: int, section: Optional[str], section_id: Optional[str], baked_shapes: Tuple[str, ...], dropped_placeholders: Tuple[str, ...], run_shifts: tuple) -> None +``` + +What one import did. Deterministic; `.to_dict()` is goldenable. + +Fields: + +* ``mode`` -- the reconciliation mode used ("adopt_theme", "keep_appearance", "bake"). +* ``source_slide`` -- partname of the imported slide in the source presentation. +* ``dest_slide`` / ``dest_slide_id`` -- partname and permanent slide id of the new + slide in the destination. +* ``position`` -- 0-based index the new slide was inserted at. +* ``layout_binding`` -- partname of the destination layout the slide is bound to. +* ``layout_binding_method`` -- how that layout was chosen ("name-match", + "type-match", "explicit", "transplant", or "blank-fallback"). Automatic + methods always identify a unique candidate at their matching tier. +* ``placeholder_map_used`` -- the complete resolved ``(source_idx, target_idx)`` + mapping for adopt-theme reconciliation; ``target_idx`` is ``None`` for an + orphan. Empty for keep-appearance and bake. +* ``parts_added`` -- partnames added to the destination package by this import. +* ``parts_reused`` -- partnames of existing destination parts reused via + content-hash deduplication (keep_appearance). +* ``notes_copied`` -- whether the source slide's speaker-notes part was imported. +* ``comments_dropped`` -- count of comment parts dropped (comments never travel). +* ``section`` / ``section_id`` -- name and exact GUID of the destination section the + slide was enrolled in, or None when it was not enrolled in a section. +* ``baked_shapes`` -- names of placeholders converted to free baked shapes. +* ``dropped_placeholders`` -- names of furniture placeholders (dt/ftr/sldNum) + removed under "bake". +* ``run_shifts`` -- `pptx.rebind.RunShift` entries for every run whose + resolved appearance changed (populated for "adopt_theme"; empty for + keep_appearance). + +### `baked_shapes` + +```python +baked_shapes: Tuple[str, ...] +``` + +### `comments_dropped` + +```python +comments_dropped: int +``` + +### `dest_slide` + +```python +dest_slide: str +``` + +### `dest_slide_id` + +```python +dest_slide_id: int +``` + +### `dropped_placeholders` + +```python +dropped_placeholders: Tuple[str, ...] +``` + +### `layout_binding` + +```python +layout_binding: str +``` + +### `layout_binding_method` + +```python +layout_binding_method: str +``` + +### `mode` + +```python +mode: str +``` + +### `notes_copied` + +```python +notes_copied: bool +``` + +### `parts_added` + +```python +parts_added: Tuple[str, ...] +``` + +### `parts_reused` + +```python +parts_reused: Tuple[str, ...] +``` + +### `placeholder_map_used` + +```python +placeholder_map_used: Tuple[Tuple[int, Optional[int]], ...] +``` + +### `position` + +```python +position: int +``` + +### `run_shifts` + +```python +run_shifts: tuple +``` + +### `section` + +```python +section: Optional[str] +``` + +### `section_id` + +```python +section_id: Optional[str] +``` + +### `source_slide` + +```python +source_slide: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the import report as a JSON-ready dict stamped with its schema and version. + +## `PackageTransaction` + +```python +PackageTransaction(package: 'OpcPackage', *roots: object) +``` + +Restore a package's original live graph if the guarded operation raises. + +Prepare a rollback boundary over `package`, tracking the proxies passed as `roots`. + +Validates the relationship graph immediately, so a malformed relationship or a signature +part refuses here rather than on entry. Nothing is snapshotted until `__enter__`, so the +instance can be built well before the mutation site. + +## `SCHEMA_NAME` + +```python +SCHEMA_NAME = 'paper-import-report' +``` + +## `SCHEMA_VERSION` + +```python +SCHEMA_VERSION = 3 +``` + +## `append_deck` + +```python +append_deck(dest_prs: 'Presentation', source_prs: 'Presentation', *, mode: str, notes: bool = True) -> 'Tuple[ImportReport, ...]' +``` + +Import every `source_prs` slide, in order, at the end of `dest_prs`. + +The COMPLETE source deck validates before the first destination write: a refusal on +any source slide leaves the destination untouched. + +## `import_slide` + +```python +import_slide(dest_prs: 'Presentation', source_prs: 'Presentation', slide: 'Presentation', *, mode: str, position: 'Optional[int]' = None, notes: bool = True, section: 'Optional[str]' = None, section_id: 'Optional[str]' = None, target_layout: 'Optional[SlideLayout]' = None, placeholder_map: 'Optional[SlideLayout]' = 'auto') -> ImportReport +``` + +Import one slide from `source_prs` into `dest_prs`; return the `ImportReport`. + + + + + +# `pptx.diff` + +Deck diff - the verification mirror (paper-pptx addition). + +## `BulletShift` + +```python +BulletShift(part: str, shape: ShapeRef, before_location: dict, after_location: dict, text: str, before: dict, after: dict) -> None +``` + +One paragraph whose resolved bullet changed between the two decks. + +Bullets live only in formatting, so a list losing its bullets changes no text and no +field marker: `text_changes` stays empty while the slide visibly loses every glyph. +This is the facet that reports it. + +Paragraphs qualify only when their exact text-and-field value is unique on both sides +and lies in the canonical unchanged prefix or suffix. Repeated or changed-region +paragraphs are skipped rather than paired by position. + +Fields: + +* ``part`` -- partname of the slide the paragraph lives on. +* ``shape`` -- stable shape identity plus current display name. +* ``before_location`` / ``after_location`` -- container-local paragraph locations. +* ``text`` -- the unchanged paragraph's literal text. +* ``before`` / ``after`` -- the resolved ``bullet``, ``bullet_font`` and ``bullet_size`` + payloads from `pptx.inspect.effective_paragraph_format` on each side. + +### `after` + +```python +after: dict +``` + +### `after_location` + +```python +after_location: dict +``` + +### `before` + +```python +before: dict +``` + +### `before_location` + +```python +before_location: dict +``` + +### `part` + +```python +part: str +``` + +### `shape` + +```python +shape: ShapeRef +``` + +### `text` + +```python +text: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this bullet change as a JSON-ready dict, before and after values included. + +## `DeckDiff` + +```python +DeckDiff(detail: str, slides_added: Tuple[SlideRef, ...] = (), slides_removed: Tuple[SlideRef, ...] = (), slides_moved: Tuple[MovedSlide, ...] = (), slide_changes: Tuple[SlideChange, ...] = tuple(), package_changes: tuple = tuple()) -> None +``` + +The whole comparison. `.to_dict()` is deterministic and goldenable. + +### `detail` + +```python +detail: str +``` + +### `is_empty` + +```python +is_empty: bool +``` + +True when the two decks match. Check it to skip reporting a no-op edit. + +### `package_changes` + +```python +package_changes: tuple = field(default_factory=tuple) +``` + +### `slide_changes` + +```python +slide_changes: Tuple[SlideChange, ...] = field(default_factory=tuple) +``` + +### `slides_added` + +```python +slides_added: Tuple[SlideRef, ...] = () +``` + +### `slides_moved` + +```python +slides_moved: Tuple[MovedSlide, ...] = () +``` + +### `slides_removed` + +```python +slides_removed: Tuple[SlideRef, ...] = () +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the whole diff as a JSON-ready dict stamped with its schema and version. + +## `EffectiveShift` + +```python +EffectiveShift(part: str, shape: ShapeRef, before_location: dict, after_location: dict, before_run_index: int, after_run_index: int, text: str, before: dict, after: dict) -> None +``` + +One uniquely matched run in a unique unchanged paragraph whose resolved font changed. + +### `after` + +```python +after: dict +``` + +### `after_location` + +```python +after_location: dict +``` + +### `after_run_index` + +```python +after_run_index: int +``` + +### `before` + +```python +before: dict +``` + +### `before_location` + +```python +before_location: dict +``` + +### `before_run_index` + +```python +before_run_index: int +``` + +### `part` + +```python +part: str +``` + +### `shape` + +```python +shape: ShapeRef +``` + +### `text` + +```python +text: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this location-aware shift as a JSON-ready dictionary. + +## `MovedSlide` + +```python +MovedSlide(slide_id: int, from_position: int, to_position: int) -> None +``` + +A slide that kept its identity and changed position. + +### `from_position` + +```python +from_position: int +``` + +### `slide_id` + +```python +slide_id: int +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this move as a JSON-ready dict. + +### `to_position` + +```python +to_position: int +``` + +## `SCHEMA_NAME` + +```python +SCHEMA_NAME = 'paper-deck-diff' +``` + +## `SCHEMA_VERSION` + +```python +SCHEMA_VERSION = 5 +``` + +## `ShapeRef` + +```python +ShapeRef(shape_id: int, name: str) -> None +``` + +Identifies a slide-scoped shape by stable id and display name. + +### `name` + +```python +name: str +``` + +### `shape_id` + +```python +shape_id: int +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this shape reference as a JSON-ready dict. + +## `SlideChange` + +```python +SlideChange(slide_id: int, shapes_added: Tuple[ShapeRef, ...] = (), shapes_removed: Tuple[ShapeRef, ...] = (), geometry_changes: Tuple[dict, ...] = (), images_replaced: Tuple[ShapeRef, ...] = (), chart_data_changes: Tuple[dict, ...] = (), table_structure_changes: Tuple[dict, ...] = (), text_changes: Tuple[dict, ...] = (), notes_change: Optional[dict] = None, effective_shifts: tuple = (), bullet_shifts: tuple = ()) -> None +``` + +Within-slide deltas for one id-matched slide pair. Empty facets are omitted +from the payload, so an all-empty change never appears in `slide_changes`. + +### `bullet_shifts` + +```python +bullet_shifts: tuple = () +``` + +### `chart_data_changes` + +```python +chart_data_changes: Tuple[dict, ...] = () +``` + +### `effective_shifts` + +```python +effective_shifts: tuple = () +``` + +### `geometry_changes` + +```python +geometry_changes: Tuple[dict, ...] = () +``` + +### `images_replaced` + +```python +images_replaced: Tuple[ShapeRef, ...] = () +``` + +### `is_empty` + +```python +is_empty: bool +``` + +True when nothing on this slide changed. Check it before adding the slide to a report. + +### `notes_change` + +```python +notes_change: Optional[dict] = None +``` + +### `shapes_added` + +```python +shapes_added: Tuple[ShapeRef, ...] = () +``` + +### `shapes_removed` + +```python +shapes_removed: Tuple[ShapeRef, ...] = () +``` + +### `slide_id` + +```python +slide_id: int +``` + +### `table_structure_changes` + +```python +table_structure_changes: Tuple[dict, ...] = () +``` + +### `text_changes` + +```python +text_changes: Tuple[dict, ...] = () +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this slide's changes as a JSON-ready dict, omitting the categories that are empty. + +## `SlideRef` + +```python +SlideRef(slide_id: int, position: int, title: Optional[str]) -> None +``` + +Identifies a slide by id, position, and title. + +### `position` + +```python +position: int +``` + +### `slide_id` + +```python +slide_id: int +``` + +### `title` + +```python +title: Optional[str] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this slide reference as a JSON-ready dict. + +## `diff_decks` + +```python +diff_decks(path_a, path_b, *, detail: str = 'structure') -> DeckDiff +``` + +Compare two decks; return the typed `DeckDiff`. + +`path_a`/`path_b` accept a file path, a file-like object, or an already-open +`Presentation`. `detail`: "structure" (slide add/remove/move, shape add/remove, +geometry, image replacement, table-grid deltas), "text" (+ exact paragraph deltas, +chart data per series/category, notes), "full" (+ per-run effective-value shifts via +the resolver - expensive on large decks, deliberately opt-in). + +When either side is an open `Presentation`, both sides are normalized by serializing +before the package-level comparison, because a live presentation has no on-disk package +to read; when both sides are a path or a file-like object, the packages are compared +exactly. + +Matching is by permanent slide id and, within matched slides, top-level shapes match by +slide-wide shape id and compatible structural kind. Display names are labels only. Moving a +shape across a group boundary remains a top-level removal or addition. Independently built +decks can reuse ids and are outside this contract. A deleted shape id reused by a new +same-kind shape is likewise indistinguishable without a persistent identifier not present in +general PPTX files. Slide ids allocate as max+1, so deleting the highest-id slide and then +adding a new one RECYCLES the id, and this diff will read that delete-plus-add as one edited +slide - order add-before-delete when producing lineage decks you intend to diff. + +Within each stable leaf-shape or table-frame container, paragraphs are ordered snapshot values +consisting of raw literal text plus positioned field markers. The longest exact prefix is +consumed first, followed by the longest non-overlapping exact suffix. The remaining middle is +one ``insertion``, ``deletion``, one-paragraph ``replacement``, or ``changed_region`` event. +Each event contains zero-based half-open ``before_range``/``after_range`` values and array- +valued ``before``/``after`` block evidence; every block carries its structured location, raw +text, and positioned fields. Duplicate values follow the prefix-first rule, which is a +deterministic endpoint representation rather than the historical edit location. Paragraph +moves and ambiguous identity are not inferred. + +An unmatched text-bearing container produces one whole-container insertion or deletion event +and is never paired with another unmatched container. + +Table dimensions are structural changes without inferred row/column insertion history. +At ``detail="full"``, effective-font and bullet shifts are limited to container-unique, +unchanged prefix/suffix paragraphs and exact unique run identities. Speaker notes remain one +flat comparison, while table-cell effective formatting and bullets remain outside the +supported resolver domain. ``package_changes`` remains the authoritative fallback for every +semantic package change not represented by a specialized facet. + + + + + +# `pptx.dml.chtfmt` + +`ChartFormat` and related objects. + +## `ChartFormat` + +Bases: `ElementProxy` + +The `ChartFormat` object provides access to visual shape properties for +chart elements like `Axis`, `Series`, and `MajorGridlines`. It has two +properties, `fill` and `line`, which return a `FillFormat` +and `LineFormat` object respectively. The `ChartFormat` object is +provided by the `format` property on the target axis, series, etc. + +### `fill` + +```python +fill() +``` + +`FillFormat` instance for this object, providing access to fill +properties such as fill color. + +### `line` + +```python +line() +``` + +The `LineFormat` object providing access to the visual properties of +this object, such as line color and line style. + + + + + +# `pptx.dml.color` + +DrawingML objects related to color, ColorFormat being the most prominent. + +## `ColorFormat` + +```python +ColorFormat(eg_colorChoice_parent, color) +``` + +Bases: `object` + +Provides access to color settings such as RGB color, theme color, and +luminance adjustments. + +### `brightness` + +```python +brightness +``` + +Read/write float value between -1.0 and 1.0 indicating the brightness +adjustment for this color, e.g. -0.25 is 25% darker and 0.4 is 40% +lighter. 0 means no brightness adjustment. + +### `from_colorchoice_parent` + +```python +from_colorchoice_parent(eg_colorChoice_parent) +``` + +### `rgb` + +```python +rgb +``` + +`RGBColor` value of this color, or None if no RGB color is explicitly +defined for this font. Setting this value to an `RGBColor` instance +causes its type to change to MSO_COLOR_TYPE.RGB. If the color was a +theme color with a brightness adjustment, the brightness adjustment +is removed when changing it to an RGB color. + +### `theme_color` + +```python +theme_color +``` + +Theme color value of this color. + +Value is a member of `MsoThemeColorIndex`, e.g. +``MSO_THEME_COLOR.ACCENT_1``. Raises AttributeError on access if the +color is not type ``MSO_COLOR_TYPE.SCHEME``. Assigning a member of +`MsoThemeColorIndex` causes the color's type to change to +``MSO_COLOR_TYPE.SCHEME``. + +### `type` + +```python +type +``` + +Read-only. A value from `MsoColorType`, either RGB or SCHEME, +corresponding to the way this color is defined, or None if no color +is defined at the level of this font. + +## `RGBColor` + +Bases: `tuple` + +Immutable value object defining a particular RGB color. + +### `from_string` + +```python +from_string(rgb_hex_str) +``` + +Return a new instance from an RGB color hex string like ``'3C2F80'``. + + + + + +# `pptx.dml.effect` + +Visual effects on a shape such as shadow, glow, and reflection. + +## `ShadowFormat` + +```python +ShadowFormat(spPr) +``` + +Bases: `object` + +Provides access to shadow effect on a shape. + +### `inherit` + +```python +inherit +``` + +True if shape inherits shadow settings. + +Read/write. An explicitly-defined shadow setting on a shape causes +this property to return `False`. A shape with no explicitly-defined +shadow setting inherits its shadow settings from the style hierarchy +(and so returns `True`). + +Assigning `True` causes any explicitly-defined shadow setting to be +removed and inheritance is restored. Note this has the side-effect of +removing **all** explicitly-defined effects, such as glow and +reflection, and restoring inheritance for all effects on the shape. +Assigning `False` causes the inheritance link to be broken and **no** +effects to appear on the shape. + + + + + +# `pptx.dml.fill` + +DrawingML objects related to fill. + +## `FillFormat` + +```python +FillFormat(eg_fill_properties_parent: BaseOxmlElement, fill_obj: _Fill) +``` + +Bases: `object` + +Provides access to the current fill properties. + +Also provides methods to change the fill type. + +### `back_color` + +```python +back_color +``` + +Return a `ColorFormat` object representing background color. + +This property is only applicable to pattern fills and lines. + +### `background` + +```python +background() +``` + +Sets the fill type to noFill, i.e. transparent. + +### `fore_color` + +```python +fore_color +``` + +Return a `ColorFormat` instance representing the foreground color of +this fill. + +### `from_fill_parent` + +```python +from_fill_parent(eg_fillProperties_parent: BaseOxmlElement) -> FillFormat +``` + +Return a `FillFormat` instance initialized to the settings contained +in *eg_fillProperties_parent*, which must be an element having +EG_FillProperties in its child element sequence in the XML schema. + +### `gradient` + +```python +gradient() +``` + +Sets the fill type to gradient. + +If the fill is not already a gradient, a default gradient is added. +The default gradient corresponds to the default in the built-in +PowerPoint "White" template. This gradient is linear at angle +90-degrees (upward), with two stops. The first stop is Accent-1 with +tint 100%, shade 100%, and satMod 130%. The second stop is Accent-1 +with tint 50%, shade 100%, and satMod 350%. + +### `gradient_angle` + +```python +gradient_angle +``` + +Angle in float degrees of line of a linear gradient. + +Read/Write. May be `None`, indicating the angle should be inherited +from the style hierarchy. An angle of 0.0 corresponds to +a left-to-right gradient. Increasing angles represent +counter-clockwise rotation of the line, for example 90.0 represents +a bottom-to-top gradient. Raises `TypeError` when the fill type is +not MSO_FILL_TYPE.GRADIENT. Raises `ValueError` for a non-linear +gradient (e.g. a radial gradient). + +### `gradient_stops` + +```python +gradient_stops +``` + +`GradientStops` object providing access to stops of this gradient. + +Raises `TypeError` when fill is not gradient (call `fill.gradient()` +first). Each stop represents a color between which the gradient +smoothly transitions. + +### `pattern` + +```python +pattern +``` + +Return member of `MsoPatternType` indicating fill pattern. + +Raises `TypeError` when fill is not patterned (call +`fill.patterned()` first). Returns `None` if no pattern has been set; +PowerPoint may display the default `PERCENT_5` pattern in this case. +Assigning `None` will remove any explicit pattern setting, although +relying on the default behavior is discouraged and may produce +rendering differences across client applications. + +### `patterned` + +```python +patterned() +``` + +Selects the pattern fill type. + +Note that calling this method does not by itself set a foreground or +background color of the pattern. Rather it enables subsequent +assignments to properties like fore_color to set the pattern and +colors. + +### `solid` + +```python +solid() +``` + +Sets the fill type to solid, i.e. a solid color. Note that calling +this method does not set a color or by itself cause the shape to +appear with a solid color fill; rather it enables subsequent +assignments to properties like fore_color to set the color. + +### `type` + +```python +type: MSO_FILL_TYPE +``` + +The type of this fill, e.g. `MSO_FILL_TYPE.SOLID`. + + + + + +# `pptx.dml.line` + +DrawingML objects related to line formatting. + +## `LineFormat` + +```python +LineFormat(parent) +``` + +Bases: `object` + +Provides access to line properties such as color, style, and width. + +A LineFormat object is typically accessed via the ``.line`` property of +a shape such as `Shape` or `Picture`. + +### `color` + +```python +color() +``` + +The `ColorFormat` instance that provides access to the color settings +for this line. Essentially a shortcut for ``line.fill.fore_color``. +As a side-effect, accessing this property causes the line fill type +to be set to ``MSO_FILL.SOLID``. If this sounds risky for your use +case, use ``line.fill.type`` to non-destructively discover the +existing fill type. + +### `dash_style` + +```python +dash_style +``` + +Return value indicating line style. + +Returns a member of `MsoLineDashStyle` indicating line style, or +`None` if no explicit value has been set. When no explicit value has +been set, the line dash style is inherited from the style hierarchy. + +Assigning `None` removes any existing explicitly-defined dash style. + +### `fill` + +```python +fill() +``` + +`FillFormat` instance for this line, providing access to fill +properties such as foreground color. + +### `width` + +```python +width +``` + +The width of the line expressed as an integer number of `English +Metric Units`. The returned value is an instance of `Length`, +a value class having properties such as `.inches`, `.cm`, and `.pt` +for converting the value into convenient units. + + + + + +# `pptx.edit` + +Structural-anchor write APIs: formatting-preserving text replacement (paper-pptx addition). + +## `RESULT_SCHEMA_NAME` + +```python +RESULT_SCHEMA_NAME = 'paper-replace-result' +``` + +## `RESULT_SCHEMA_VERSION` + +```python +RESULT_SCHEMA_VERSION = 2 +``` + +## `ReplaceResult` + +```python +ReplaceResult(replacements: int, blocks: Tuple[BlockAnchor, ...] = tuple()) -> None +``` + +Outcome of a text replacement. + +Fields: + +* ``replacements`` -- total number of occurrences replaced across the deck. +* ``blocks`` -- POST-edit `pptx.inspect.BlockAnchor` for each block that was + touched (their content hashes reflect the new text). + +### `blocks` + +```python +blocks: Tuple[BlockAnchor, ...] = field(default_factory=tuple) +``` + +### `replacements` + +```python +replacements: int +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the replace result as a JSON-ready dict stamped with its schema and version. + +## `refind` + +```python +refind(prs: 'Presentation', anchor: BlockAnchor) -> BlockAnchor +``` + +Return a fresh current anchor for an exact unique fingerprint match. + +Current anchors search only their structurally identified shape or table cell. Legacy +three-field anchors search the whole named part by their pinned short text hash. Neither path +uses ordinal preference, shape names, geometry, or approximate text. + +## `replace_text` + +```python +replace_text(prs: 'Presentation', find: str, replace: str, *, include_notes: bool = False) -> ReplaceResult +``` + +Replace literal `find` with `replace` across `prs`; return a `ReplaceResult`. + +Matching is case-sensitive, left-to-right, and non-overlapping. A match may span consecutive +text runs in one paragraph, but never a paragraph boundary or an intervening non-run element +such as a line break or field. `find` must be a non-empty string; `replace` may be empty. Tabs +are accepted, while line breaks, XML control characters, and non-encodable text are refused. + +Boundary fragments retain their original run properties, and replacement text receives the +run properties of the run where its match starts. Untouched runs remain byte-identical. Any +run left with no text after replacement is removed, so formatting found only on that run is +not retained. + +Traversal covers slide shapes, grouped shapes, and table cells, plus existing notes slides +when `include_notes=True`. An unsupported blind region refuses the whole operation before any +write. Zero matches is a successful result with ``replacements == 0`` and no block anchors. +Each returned block anchor describes the post-edit text of a block that changed. + +## `replace_text_at` + +```python +replace_text_at(prs: 'Presentation', anchor: BlockAnchor, find: str, replace: str) -> ReplaceResult +``` + +Replace literal `find` in the block at `anchor`; return a `ReplaceResult`. + +Matching, validation, run-boundary formatting, and non-run boundaries are the same as +`replace_text`. Current anchors resolve the exact shape or table cell first, then require +a unique matching full fingerprint in that container. Changed content raises +`StaleAnchorError`; missing or ambiguous structure refuses without mutation. Legacy +three-field anchors search only for an exact unique short hash in their named part. `find` +absent from the resolved block, or present only across a boundary a match cannot cross, raises +`TargetNotFoundError` rather than returning a zero count. + +On success the result contains the number of occurrences replaced in that block and its one +post-edit anchor. + + + + + +# `pptx.enum.action` + +Enumerations that describe click-action settings. + +## `PP_ACTION` + +```python +PP_ACTION = PP_ACTION_TYPE +``` + +## `PP_ACTION_TYPE` + +Bases: `BaseEnum` + +Specifies the type of a mouse action (click or hover action). + +Alias: ``PP_ACTION`` + +Example:: + + from pptx.enum.action import PP_ACTION + + assert shape.click_action.action == PP_ACTION.HYPERLINK + +MS API name: `PpActionType` + +https://msdn.microsoft.com/EN-US/library/office/ff744895.aspx + +### `END_SHOW` + +```python +END_SHOW = (6, 'Slide show ends.') +``` + +Slide show ends. + +### `FIRST_SLIDE` + +```python +FIRST_SLIDE = (3, 'Returns to the first slide.') +``` + +Returns to the first slide. + +### `HYPERLINK` + +```python +HYPERLINK = (7, 'Hyperlink.') +``` + +Hyperlink. + +### `LAST_SLIDE` + +```python +LAST_SLIDE = (4, 'Moves to the last slide.') +``` + +Moves to the last slide. + +### `LAST_SLIDE_VIEWED` + +```python +LAST_SLIDE_VIEWED = (5, 'Moves to the last slide viewed.') +``` + +Moves to the last slide viewed. + +### `NAMED_SLIDE` + +```python +NAMED_SLIDE = (101, 'Moves to slide specified by slide number.') +``` + +Moves to slide specified by slide number. + +### `NAMED_SLIDE_SHOW` + +```python +NAMED_SLIDE_SHOW = (10, 'Runs the slideshow.') +``` + +Runs the slideshow. + +### `NEXT_SLIDE` + +```python +NEXT_SLIDE = (1, 'Moves to the next slide.') +``` + +Moves to the next slide. + +### `NONE` + +```python +NONE = (0, 'No action is performed.') +``` + +No action is performed. + +### `OLE_VERB` + +```python +OLE_VERB = (11, 'OLE Verb.') +``` + +OLE Verb. + +### `OPEN_FILE` + +```python +OPEN_FILE = (102, 'Opens the specified file.') +``` + +Opens the specified file. + +### `PLAY` + +```python +PLAY = (12, 'Begins the slideshow.') +``` + +Begins the slideshow. + +### `PREVIOUS_SLIDE` + +```python +PREVIOUS_SLIDE = (2, 'Moves to the previous slide.') +``` + +Moves to the previous slide. + +### `RUN_MACRO` + +```python +RUN_MACRO = (8, 'Runs a macro.') +``` + +Runs a macro. + +### `RUN_PROGRAM` + +```python +RUN_PROGRAM = (9, 'Runs a program.') +``` + +Runs a program. + + + + + +# `pptx.enum.base` + +Base classes and other objects used by enumerations. + +## `BaseEnum` + +Bases: `int`, `Enum` + +Base class for Enums that do not map XML attr values. + +The enum's value will be an integer, corresponding to the integer assigned the +corresponding member in the MS API enum of the same name. + +## `BaseXmlEnum` + +Bases: `int`, `Enum` + +Base class for Enums that also map XML attr values. + +The enum's value will be an integer, corresponding to the integer assigned the +corresponding member in the MS API enum of the same name. + +### `from_xml` + +```python +from_xml(xml_value: str) -> Self +``` + +Enumeration member corresponding to XML attribute value `xml_value`. + +Raises `ValueError` if `xml_value` is the empty string ("") or is not an XML attribute +value registered on the enumeration. Note that enum members that do not correspond to one +of the defined values for an XML attribute have `xml_value == ""`. These +"return-value only" members cannot be automatically mapped from an XML attribute value and +must be selected explicitly by code, based on the appropriate conditions. + +Example:: + + >>> WD_PARAGRAPH_ALIGNMENT.from_xml("center") + WD_PARAGRAPH_ALIGNMENT.CENTER + +### `to_xml` + +```python +to_xml(value: int | _T) -> str +``` + +XML value of this enum member, generally an XML attribute value. + +### `validate` + +```python +validate(value: _T) +``` + +Raise `ValueError` if `value` is not an assignable value. + +### `xml_value` + +```python +xml_value: str | None +``` + +## `DocsPageFormatter` + +```python +DocsPageFormatter(clsname: str, clsdict: dict[str, Any]) +``` + +Bases: `object` + +Formats a reStructuredText documention page (string) for an enumeration. + +### `page_str` + +```python +page_str +``` + +The RestructuredText documentation page for the enumeration. This is +the only API member for the class. + + + + + +# `pptx.enum.chart` + +Enumerations used by charts and related objects. + +## `XL_AXIS_CROSSES` + +Bases: `BaseXmlEnum` + +Specifies the point on an axis where the other axis crosses. + +Example:: + + from pptx.enum.chart import XL_AXIS_CROSSES + + value_axis.crosses = XL_AXIS_CROSSES.MAXIMUM + +MS API Name: `XlAxisCrosses` + +https://msdn.microsoft.com/en-us/library/office/ff745402.aspx + +### `AUTOMATIC` + +```python +AUTOMATIC = (-4105, 'autoZero', 'The axis crossing point is set automatically, often at zero.') +``` + +The axis crossing point is set automatically, often at zero. + +### `CUSTOM` + +```python +CUSTOM = (-4114, '', 'The .crosses_at property specifies the axis crossing point.') +``` + +The .crosses_at property specifies the axis crossing point. + +### `MAXIMUM` + +```python +MAXIMUM = (2, 'max', 'The axis crosses at the maximum value.') +``` + +The axis crosses at the maximum value. + +### `MINIMUM` + +```python +MINIMUM = (4, 'min', 'The axis crosses at the minimum value.') +``` + +The axis crosses at the minimum value. + +## `XL_CATEGORY_TYPE` + +Bases: `BaseEnum` + +Specifies the type of the category axis. + +Example:: + + from pptx.enum.chart import XL_CATEGORY_TYPE + + date_axis = chart.category_axis + assert date_axis.category_type == XL_CATEGORY_TYPE.TIME_SCALE + +MS API Name: `XlCategoryType` + +https://msdn.microsoft.com/EN-US/library/office/ff746136.aspx + +### `AUTOMATIC_SCALE` + +```python +AUTOMATIC_SCALE = (-4105, 'The application controls the axis type.') +``` + +The application controls the axis type. + +### `CATEGORY_SCALE` + +```python +CATEGORY_SCALE = (2, 'Axis groups data by an arbitrary set of categories') +``` + +Axis groups data by an arbitrary set of categories + +### `TIME_SCALE` + +```python +TIME_SCALE = (3, 'Axis groups data on a time scale of days, months, or years.') +``` + +Axis groups data on a time scale of days, months, or years. + +## `XL_CHART_TYPE` + +Bases: `BaseEnum` + +Specifies the type of a chart. + +Example:: + + from pptx.enum.chart import XL_CHART_TYPE + + assert chart.chart_type == XL_CHART_TYPE.BAR_STACKED + +MS API Name: `XlChartType` + +http://msdn.microsoft.com/en-us/library/office/ff838409.aspx + +### `AREA` + +```python +AREA = (1, 'Area') +``` + +Area + +### `AREA_STACKED` + +```python +AREA_STACKED = (76, 'Stacked Area.') +``` + +Stacked Area. + +### `AREA_STACKED_100` + +```python +AREA_STACKED_100 = (77, '100% Stacked Area.') +``` + +100% Stacked Area. + +### `BAR_CLUSTERED` + +```python +BAR_CLUSTERED = (57, 'Clustered Bar.') +``` + +Clustered Bar. + +### `BAR_OF_PIE` + +```python +BAR_OF_PIE = (71, 'Bar of Pie.') +``` + +Bar of Pie. + +### `BAR_STACKED` + +```python +BAR_STACKED = (58, 'Stacked Bar.') +``` + +Stacked Bar. + +### `BAR_STACKED_100` + +```python +BAR_STACKED_100 = (59, '100% Stacked Bar.') +``` + +100% Stacked Bar. + +### `BUBBLE` + +```python +BUBBLE = (15, 'Bubble.') +``` + +Bubble. + +### `BUBBLE_THREE_D_EFFECT` + +```python +BUBBLE_THREE_D_EFFECT = (87, 'Bubble with 3D effects.') +``` + +Bubble with 3D effects. + +### `COLUMN_CLUSTERED` + +```python +COLUMN_CLUSTERED = (51, 'Clustered Column.') +``` + +Clustered Column. + +### `COLUMN_STACKED` + +```python +COLUMN_STACKED = (52, 'Stacked Column.') +``` + +Stacked Column. + +### `COLUMN_STACKED_100` + +```python +COLUMN_STACKED_100 = (53, '100% Stacked Column.') +``` + +100% Stacked Column. + +### `CONE_BAR_CLUSTERED` + +```python +CONE_BAR_CLUSTERED = (102, 'Clustered Cone Bar.') +``` + +Clustered Cone Bar. + +### `CONE_BAR_STACKED` + +```python +CONE_BAR_STACKED = (103, 'Stacked Cone Bar.') +``` + +Stacked Cone Bar. + +### `CONE_BAR_STACKED_100` + +```python +CONE_BAR_STACKED_100 = (104, '100% Stacked Cone Bar.') +``` + +100% Stacked Cone Bar. + +### `CONE_COL` + +```python +CONE_COL = (105, '3D Cone Column.') +``` + +3D Cone Column. + +### `CONE_COL_CLUSTERED` + +```python +CONE_COL_CLUSTERED = (99, 'Clustered Cone Column.') +``` + +Clustered Cone Column. + +### `CONE_COL_STACKED` + +```python +CONE_COL_STACKED = (100, 'Stacked Cone Column.') +``` + +Stacked Cone Column. + +### `CONE_COL_STACKED_100` + +```python +CONE_COL_STACKED_100 = (101, '100% Stacked Cone Column.') +``` + +100% Stacked Cone Column. + +### `CYLINDER_BAR_CLUSTERED` + +```python +CYLINDER_BAR_CLUSTERED = (95, 'Clustered Cylinder Bar.') +``` + +Clustered Cylinder Bar. + +### `CYLINDER_BAR_STACKED` + +```python +CYLINDER_BAR_STACKED = (96, 'Stacked Cylinder Bar.') +``` + +Stacked Cylinder Bar. + +### `CYLINDER_BAR_STACKED_100` + +```python +CYLINDER_BAR_STACKED_100 = (97, '100% Stacked Cylinder Bar.') +``` + +100% Stacked Cylinder Bar. + +### `CYLINDER_COL` + +```python +CYLINDER_COL = (98, '3D Cylinder Column.') +``` + +3D Cylinder Column. + +### `CYLINDER_COL_CLUSTERED` + +```python +CYLINDER_COL_CLUSTERED = (92, 'Clustered Cone Column.') +``` + +Clustered Cone Column. + +### `CYLINDER_COL_STACKED` + +```python +CYLINDER_COL_STACKED = (93, 'Stacked Cone Column.') +``` + +Stacked Cone Column. + +### `CYLINDER_COL_STACKED_100` + +```python +CYLINDER_COL_STACKED_100 = (94, '100% Stacked Cylinder Column.') +``` + +100% Stacked Cylinder Column. + +### `DOUGHNUT` + +```python +DOUGHNUT = (-4120, 'Doughnut.') +``` + +Doughnut. + +### `DOUGHNUT_EXPLODED` + +```python +DOUGHNUT_EXPLODED = (80, 'Exploded Doughnut.') +``` + +Exploded Doughnut. + +### `LINE` + +```python +LINE = (4, 'Line.') +``` + +Line. + +### `LINE_MARKERS` + +```python +LINE_MARKERS = (65, 'Line with Markers.') +``` + +Line with Markers. + +### `LINE_MARKERS_STACKED` + +```python +LINE_MARKERS_STACKED = (66, 'Stacked Line with Markers.') +``` + +Stacked Line with Markers. + +### `LINE_MARKERS_STACKED_100` + +```python +LINE_MARKERS_STACKED_100 = (67, '100% Stacked Line with Markers.') +``` + +100% Stacked Line with Markers. + +### `LINE_STACKED` + +```python +LINE_STACKED = (63, 'Stacked Line.') +``` + +Stacked Line. + +### `LINE_STACKED_100` + +```python +LINE_STACKED_100 = (64, '100% Stacked Line.') +``` + +100% Stacked Line. + +### `PIE` + +```python +PIE = (5, 'Pie.') +``` + +Pie. + +### `PIE_EXPLODED` + +```python +PIE_EXPLODED = (69, 'Exploded Pie.') +``` + +Exploded Pie. + +### `PIE_OF_PIE` + +```python +PIE_OF_PIE = (68, 'Pie of Pie.') +``` + +Pie of Pie. + +### `PYRAMID_BAR_CLUSTERED` + +```python +PYRAMID_BAR_CLUSTERED = (109, 'Clustered Pyramid Bar.') +``` + +Clustered Pyramid Bar. + +### `PYRAMID_BAR_STACKED` + +```python +PYRAMID_BAR_STACKED = (110, 'Stacked Pyramid Bar.') +``` + +Stacked Pyramid Bar. + +### `PYRAMID_BAR_STACKED_100` + +```python +PYRAMID_BAR_STACKED_100 = (111, '100% Stacked Pyramid Bar.') +``` + +100% Stacked Pyramid Bar. + +### `PYRAMID_COL` + +```python +PYRAMID_COL = (112, '3D Pyramid Column.') +``` + +3D Pyramid Column. + +### `PYRAMID_COL_CLUSTERED` + +```python +PYRAMID_COL_CLUSTERED = (106, 'Clustered Pyramid Column.') +``` + +Clustered Pyramid Column. + +### `PYRAMID_COL_STACKED` + +```python +PYRAMID_COL_STACKED = (107, 'Stacked Pyramid Column.') +``` + +Stacked Pyramid Column. + +### `PYRAMID_COL_STACKED_100` + +```python +PYRAMID_COL_STACKED_100 = (108, '100% Stacked Pyramid Column.') +``` + +100% Stacked Pyramid Column. + +### `RADAR` + +```python +RADAR = (-4151, 'Radar.') +``` + +Radar. + +### `RADAR_FILLED` + +```python +RADAR_FILLED = (82, 'Filled Radar.') +``` + +Filled Radar. + +### `RADAR_MARKERS` + +```python +RADAR_MARKERS = (81, 'Radar with Data Markers.') +``` + +Radar with Data Markers. + +### `STOCK_HLC` + +```python +STOCK_HLC = (88, 'High-Low-Close.') +``` + +High-Low-Close. + +### `STOCK_OHLC` + +```python +STOCK_OHLC = (89, 'Open-High-Low-Close.') +``` + +Open-High-Low-Close. + +### `STOCK_VHLC` + +```python +STOCK_VHLC = (90, 'Volume-High-Low-Close.') +``` + +Volume-High-Low-Close. + +### `STOCK_VOHLC` + +```python +STOCK_VOHLC = (91, 'Volume-Open-High-Low-Close.') +``` + +Volume-Open-High-Low-Close. + +### `SURFACE` + +```python +SURFACE = (83, '3D Surface.') +``` + +3D Surface. + +### `SURFACE_TOP_VIEW` + +```python +SURFACE_TOP_VIEW = (85, 'Surface (Top View).') +``` + +Surface (Top View). + +### `SURFACE_TOP_VIEW_WIREFRAME` + +```python +SURFACE_TOP_VIEW_WIREFRAME = (86, 'Surface (Top View wireframe).') +``` + +Surface (Top View wireframe). + +### `SURFACE_WIREFRAME` + +```python +SURFACE_WIREFRAME = (84, '3D Surface (wireframe).') +``` + +3D Surface (wireframe). + +### `THREE_D_AREA` + +```python +THREE_D_AREA = (-4098, '3D Area.') +``` + +3D Area. + +### `THREE_D_AREA_STACKED` + +```python +THREE_D_AREA_STACKED = (78, '3D Stacked Area.') +``` + +3D Stacked Area. + +### `THREE_D_AREA_STACKED_100` + +```python +THREE_D_AREA_STACKED_100 = (79, '100% Stacked Area.') +``` + +100% Stacked Area. + +### `THREE_D_BAR_CLUSTERED` + +```python +THREE_D_BAR_CLUSTERED = (60, '3D Clustered Bar.') +``` + +3D Clustered Bar. + +### `THREE_D_BAR_STACKED` + +```python +THREE_D_BAR_STACKED = (61, '3D Stacked Bar.') +``` + +3D Stacked Bar. + +### `THREE_D_BAR_STACKED_100` + +```python +THREE_D_BAR_STACKED_100 = (62, '3D 100% Stacked Bar.') +``` + +3D 100% Stacked Bar. + +### `THREE_D_COLUMN` + +```python +THREE_D_COLUMN = (-4100, '3D Column.') +``` + +3D Column. + +### `THREE_D_COLUMN_CLUSTERED` + +```python +THREE_D_COLUMN_CLUSTERED = (54, '3D Clustered Column.') +``` + +3D Clustered Column. + +### `THREE_D_COLUMN_STACKED` + +```python +THREE_D_COLUMN_STACKED = (55, '3D Stacked Column.') +``` + +3D Stacked Column. + +### `THREE_D_COLUMN_STACKED_100` + +```python +THREE_D_COLUMN_STACKED_100 = (56, '3D 100% Stacked Column.') +``` + +3D 100% Stacked Column. + +### `THREE_D_LINE` + +```python +THREE_D_LINE = (-4101, '3D Line.') +``` + +3D Line. + +### `THREE_D_PIE` + +```python +THREE_D_PIE = (-4102, '3D Pie.') +``` + +3D Pie. + +### `THREE_D_PIE_EXPLODED` + +```python +THREE_D_PIE_EXPLODED = (70, 'Exploded 3D Pie.') +``` + +Exploded 3D Pie. + +### `XY_SCATTER` + +```python +XY_SCATTER = (-4169, 'Scatter.') +``` + +Scatter. + +### `XY_SCATTER_LINES` + +```python +XY_SCATTER_LINES = (74, 'Scatter with Lines.') +``` + +Scatter with Lines. + +### `XY_SCATTER_LINES_NO_MARKERS` + +```python +XY_SCATTER_LINES_NO_MARKERS = (75, 'Scatter with Lines and No Data Markers.') +``` + +Scatter with Lines and No Data Markers. + +### `XY_SCATTER_SMOOTH` + +```python +XY_SCATTER_SMOOTH = (72, 'Scatter with Smoothed Lines.') +``` + +Scatter with Smoothed Lines. + +### `XY_SCATTER_SMOOTH_NO_MARKERS` + +```python +XY_SCATTER_SMOOTH_NO_MARKERS = (73, 'Scatter with Smoothed Lines and No Data Markers.') +``` + +Scatter with Smoothed Lines and No Data Markers. + +## `XL_DATA_LABEL_POSITION` + +Bases: `BaseXmlEnum` + +Specifies where the data label is positioned. + +Example:: + + from pptx.enum.chart import XL_LABEL_POSITION + + data_labels = chart.plots[0].data_labels + data_labels.position = XL_LABEL_POSITION.OUTSIDE_END + +MS API Name: `XlDataLabelPosition` + +http://msdn.microsoft.com/en-us/library/office/ff745082.aspx + +### `ABOVE` + +```python +ABOVE = (0, 't', 'The data label is positioned above the data point.') +``` + +The data label is positioned above the data point. + +### `BELOW` + +```python +BELOW = (1, 'b', 'The data label is positioned below the data point.') +``` + +The data label is positioned below the data point. + +### `BEST_FIT` + +```python +BEST_FIT = (5, 'bestFit', 'Word sets the position of the data label.') +``` + +Word sets the position of the data label. + +### `CENTER` + +```python +CENTER = (-4108, 'ctr', 'The data label is centered on the data point or inside a bar or a pie slice.') +``` + +The data label is centered on the data point or inside a bar or a pie slice. + +### `INSIDE_BASE` + +```python +INSIDE_BASE = (4, 'inBase', 'The data label is positioned inside the data point at the bottom edge.') +``` + +The data label is positioned inside the data point at the bottom edge. + +### `INSIDE_END` + +```python +INSIDE_END = (3, 'inEnd', 'The data label is positioned inside the data point at the top edge.') +``` + +The data label is positioned inside the data point at the top edge. + +### `LEFT` + +```python +LEFT = (-4131, 'l', 'The data label is positioned to the left of the data point.') +``` + +The data label is positioned to the left of the data point. + +### `MIXED` + +```python +MIXED = (6, '', 'Data labels are in multiple positions (read-only).') +``` + +Data labels are in multiple positions (read-only). + +### `OUTSIDE_END` + +```python +OUTSIDE_END = (2, 'outEnd', 'The data label is positioned outside the data point at the top edge.') +``` + +The data label is positioned outside the data point at the top edge. + +### `RIGHT` + +```python +RIGHT = (-4152, 'r', 'The data label is positioned to the right of the data point.') +``` + +The data label is positioned to the right of the data point. + +## `XL_LABEL_POSITION` + +```python +XL_LABEL_POSITION = XL_DATA_LABEL_POSITION +``` + +## `XL_LEGEND_POSITION` + +Bases: `BaseXmlEnum` + +Specifies the position of the legend on a chart. + +Example:: + + from pptx.enum.chart import XL_LEGEND_POSITION + + chart.has_legend = True + chart.legend.position = XL_LEGEND_POSITION.BOTTOM + +MS API Name: `XlLegendPosition` + +http://msdn.microsoft.com/en-us/library/office/ff745840.aspx + +### `BOTTOM` + +```python +BOTTOM = (-4107, 'b', 'Below the chart.') +``` + +Below the chart. + +### `CORNER` + +```python +CORNER = (2, 'tr', 'In the upper-right corner of the chart border.') +``` + +In the upper-right corner of the chart border. + +### `CUSTOM` + +```python +CUSTOM = (-4161, '', 'A custom position (read-only).') +``` + +A custom position (read-only). + +### `LEFT` + +```python +LEFT = (-4131, 'l', 'Left of the chart.') +``` + +Left of the chart. + +### `RIGHT` + +```python +RIGHT = (-4152, 'r', 'Right of the chart.') +``` + +Right of the chart. + +### `TOP` + +```python +TOP = (-4160, 't', 'Above the chart.') +``` + +Above the chart. + +## `XL_MARKER_STYLE` + +Bases: `BaseXmlEnum` + +Specifies the marker style for a point or series in a line, scatter, or radar chart. + +Example:: + + from pptx.enum.chart import XL_MARKER_STYLE + + series.marker.style = XL_MARKER_STYLE.CIRCLE + +MS API Name: `XlMarkerStyle` + +http://msdn.microsoft.com/en-us/library/office/ff197219.aspx + +### `AUTOMATIC` + +```python +AUTOMATIC = (-4105, 'auto', 'Automatic markers') +``` + +Automatic markers + +### `CIRCLE` + +```python +CIRCLE = (8, 'circle', 'Circular markers') +``` + +Circular markers + +### `DASH` + +```python +DASH = (-4115, 'dash', 'Long bar markers') +``` + +Long bar markers + +### `DIAMOND` + +```python +DIAMOND = (2, 'diamond', 'Diamond-shaped markers') +``` + +Diamond-shaped markers + +### `DOT` + +```python +DOT = (-4118, 'dot', 'Short bar markers') +``` + +Short bar markers + +### `NONE` + +```python +NONE = (-4142, 'none', 'No markers') +``` + +No markers + +### `PICTURE` + +```python +PICTURE = (-4147, 'picture', 'Picture markers') +``` + +Picture markers + +### `PLUS` + +```python +PLUS = (9, 'plus', 'Square markers with a plus sign') +``` + +Square markers with a plus sign + +### `SQUARE` + +```python +SQUARE = (1, 'square', 'Square markers') +``` + +Square markers + +### `STAR` + +```python +STAR = (5, 'star', 'Square markers with an asterisk') +``` + +Square markers with an asterisk + +### `TRIANGLE` + +```python +TRIANGLE = (3, 'triangle', 'Triangular markers') +``` + +Triangular markers + +### `X` + +```python +X = (-4168, 'x', 'Square markers with an X') +``` + +Square markers with an X + +## `XL_TICK_LABEL_POSITION` + +Bases: `BaseXmlEnum` + +Specifies the position of tick-mark labels on a chart axis. + +Example:: + + from pptx.enum.chart import XL_TICK_LABEL_POSITION + + category_axis = chart.category_axis + category_axis.tick_label_position = XL_TICK_LABEL_POSITION.LOW + +MS API Name: `XlTickLabelPosition` + +http://msdn.microsoft.com/en-us/library/office/ff822561.aspx + +### `HIGH` + +```python +HIGH = (-4127, 'high', 'Top or right side of the chart.') +``` + +Top or right side of the chart. + +### `LOW` + +```python +LOW = (-4134, 'low', 'Bottom or left side of the chart.') +``` + +Bottom or left side of the chart. + +### `NEXT_TO_AXIS` + +```python +NEXT_TO_AXIS = (4, 'nextTo', 'Next to axis (where axis is not at either side of the chart).') +``` + +Next to axis (where axis is not at either side of the chart). + +### `NONE` + +```python +NONE = (-4142, 'none', 'No tick labels.') +``` + +No tick labels. + +## `XL_TICK_MARK` + +Bases: `BaseXmlEnum` + +Specifies a type of axis tick for a chart. + +Example:: + + from pptx.enum.chart import XL_TICK_MARK + + chart.value_axis.minor_tick_mark = XL_TICK_MARK.INSIDE + +MS API Name: `XlTickMark` + +http://msdn.microsoft.com/en-us/library/office/ff193878.aspx + +### `CROSS` + +```python +CROSS = (4, 'cross', 'Tick mark crosses the axis') +``` + +Tick mark crosses the axis + +### `INSIDE` + +```python +INSIDE = (2, 'in', 'Tick mark appears inside the axis') +``` + +Tick mark appears inside the axis + +### `NONE` + +```python +NONE = (-4142, 'none', 'No tick mark') +``` + +No tick mark + +### `OUTSIDE` + +```python +OUTSIDE = (3, 'out', 'Tick mark appears outside the axis') +``` + +Tick mark appears outside the axis + + + + + +# `pptx.enum.dml` + +Enumerations used by DrawingML objects. + +## `MSO_COLOR_TYPE` + +Bases: `BaseEnum` + +Specifies the color specification scheme + +Example:: + + from pptx.enum.dml import MSO_COLOR_TYPE + + assert shape.fill.fore_color.type == MSO_COLOR_TYPE.SCHEME + +MS API Name: "MsoColorType" + +http://msdn.microsoft.com/en-us/library/office/ff864912(v=office.15).aspx + +### `HSL` + +```python +HSL = (101, 'Color is specified using Hue, Saturation, and Luminosity values') +``` + +Color is specified using Hue, Saturation, and Luminosity values + +### `PRESET` + +```python +PRESET = (102, 'Color is specified using a named built-in color') +``` + +Color is specified using a named built-in color + +### `RGB` + +```python +RGB = (1, 'Color is specified by an `RGBColor` value.') +``` + +Color is specified by an `RGBColor` value. + +### `SCHEME` + +```python +SCHEME = (2, 'Color is one of the preset theme colors') +``` + +Color is one of the preset theme colors + +### `SCRGB` + +```python +SCRGB = (103, 'Color is an scRGB color, a wide color gamut RGB color space') +``` + +Color is an scRGB color, a wide color gamut RGB color space + +### `SYSTEM` + +```python +SYSTEM = (104, 'Color is one specified by the operating system, such as the window background color.') +``` + +Color is one specified by the operating system, such as the window background color. + +## `MSO_FILL` + +```python +MSO_FILL = MSO_FILL_TYPE +``` + +## `MSO_FILL_TYPE` + +Bases: `BaseEnum` + +Specifies the type of bitmap used for the fill of a shape. + +Alias: ``MSO_FILL`` + +Example:: + + from pptx.enum.dml import MSO_FILL + + assert shape.fill.type == MSO_FILL.SOLID + +MS API Name: `MsoFillType` + +http://msdn.microsoft.com/EN-US/library/office/ff861408.aspx + +### `BACKGROUND` + +```python +BACKGROUND = (5, 'The shape is transparent, such that whatever is behind the shape shows through. Often this is the slide background, but if a visible shape is behind, that will show through.') +``` + +The shape is transparent, such that whatever is behind the shape shows through. + +Often this is the slide background, but if a visible shape is behind, that will show through. + +### `GRADIENT` + +```python +GRADIENT = (3, 'Shape is filled with a gradient') +``` + +Shape is filled with a gradient + +### `GROUP` + +```python +GROUP = (101, 'Shape is part of a group and should inherit the fill properties of the group.') +``` + +Shape is part of a group and should inherit the fill properties of the group. + +### `PATTERNED` + +```python +PATTERNED = (2, 'Shape is filled with a pattern') +``` + +Shape is filled with a pattern + +### `PICTURE` + +```python +PICTURE = (6, 'Shape is filled with a bitmapped image') +``` + +Shape is filled with a bitmapped image + +### `SOLID` + +```python +SOLID = (1, 'Shape is filled with a solid color') +``` + +Shape is filled with a solid color + +### `TEXTURED` + +```python +TEXTURED = (4, 'Shape is filled with a texture') +``` + +Shape is filled with a texture + +## `MSO_LINE` + +```python +MSO_LINE = MSO_LINE_DASH_STYLE +``` + +## `MSO_LINE_DASH_STYLE` + +Bases: `BaseXmlEnum` + +Specifies the dash style for a line. + +Alias: ``MSO_LINE`` + +Example:: + + from pptx.enum.dml import MSO_LINE + + shape.line.dash_style = MSO_LINE.DASH_DOT_DOT + +MS API name: `MsoLineDashStyle` + +https://learn.microsoft.com/en-us/office/vba/api/Office.MsoLineDashStyle + +### `DASH` + +```python +DASH = (4, 'dash', 'Line consists of dashes only.') +``` + +Line consists of dashes only. + +### `DASH_DOT` + +```python +DASH_DOT = (5, 'dashDot', 'Line is a dash-dot pattern.') +``` + +Line is a dash-dot pattern. + +### `DASH_DOT_DOT` + +```python +DASH_DOT_DOT = (6, 'lgDashDotDot', 'Line is a dash-dot-dot pattern.') +``` + +Line is a dash-dot-dot pattern. + +### `DASH_STYLE_MIXED` + +```python +DASH_STYLE_MIXED = (-2, '', 'Not supported.') +``` + +Return value only, indicating more than one dash style applies. + +### `LONG_DASH` + +```python +LONG_DASH = (7, 'lgDash', 'Line consists of long dashes.') +``` + +Line consists of long dashes. + +### `LONG_DASH_DOT` + +```python +LONG_DASH_DOT = (8, 'lgDashDot', 'Line is a long dash-dot pattern.') +``` + +Line is a long dash-dot pattern. + +### `ROUND_DOT` + +```python +ROUND_DOT = (3, 'sysDot', 'Line is made up of round dots.') +``` + +Line is made up of round dots. + +### `SOLID` + +```python +SOLID = (1, 'solid', 'Line is solid.') +``` + +Line is solid. + +### `SQUARE_DOT` + +```python +SQUARE_DOT = (2, 'sysDash', 'Line is made up of square dots.') +``` + +Line is made up of square dots. + +## `MSO_PATTERN` + +```python +MSO_PATTERN = MSO_PATTERN_TYPE +``` + +## `MSO_PATTERN_TYPE` + +Bases: `BaseXmlEnum` + +Specifies the fill pattern used in a shape. + +Alias: ``MSO_PATTERN`` + +Example:: + + from pptx.enum.dml import MSO_PATTERN + + fill = shape.fill + fill.patterned() + fill.pattern = MSO_PATTERN.WAVE + +MS API Name: `MsoPatternType` + +https://learn.microsoft.com/en-us/office/vba/api/Office.MsoPatternType + +### `CROSS` + +```python +CROSS = (51, 'cross', 'Cross') +``` + +Cross + +### `DARK_DOWNWARD_DIAGONAL` + +```python +DARK_DOWNWARD_DIAGONAL = (15, 'dkDnDiag', 'Dark Downward Diagonal') +``` + +Dark Downward Diagonal + +### `DARK_HORIZONTAL` + +```python +DARK_HORIZONTAL = (13, 'dkHorz', 'Dark Horizontal') +``` + +Dark Horizontal + +### `DARK_UPWARD_DIAGONAL` + +```python +DARK_UPWARD_DIAGONAL = (16, 'dkUpDiag', 'Dark Upward Diagonal') +``` + +Dark Upward Diagonal + +### `DARK_VERTICAL` + +```python +DARK_VERTICAL = (14, 'dkVert', 'Dark Vertical') +``` + +Dark Vertical + +### `DASHED_DOWNWARD_DIAGONAL` + +```python +DASHED_DOWNWARD_DIAGONAL = (28, 'dashDnDiag', 'Dashed Downward Diagonal') +``` + +Dashed Downward Diagonal + +### `DASHED_HORIZONTAL` + +```python +DASHED_HORIZONTAL = (32, 'dashHorz', 'Dashed Horizontal') +``` + +Dashed Horizontal + +### `DASHED_UPWARD_DIAGONAL` + +```python +DASHED_UPWARD_DIAGONAL = (27, 'dashUpDiag', 'Dashed Upward Diagonal') +``` + +Dashed Upward Diagonal + +### `DASHED_VERTICAL` + +```python +DASHED_VERTICAL = (31, 'dashVert', 'Dashed Vertical') +``` + +Dashed Vertical + +### `DIAGONAL_BRICK` + +```python +DIAGONAL_BRICK = (40, 'diagBrick', 'Diagonal Brick') +``` + +Diagonal Brick + +### `DIAGONAL_CROSS` + +```python +DIAGONAL_CROSS = (54, 'diagCross', 'Diagonal Cross') +``` + +Diagonal Cross + +### `DIVOT` + +```python +DIVOT = (46, 'divot', 'Pattern Divot') +``` + +Pattern Divot + +### `DOTTED_DIAMOND` + +```python +DOTTED_DIAMOND = (24, 'dotDmnd', 'Dotted Diamond') +``` + +Dotted Diamond + +### `DOTTED_GRID` + +```python +DOTTED_GRID = (45, 'dotGrid', 'Dotted Grid') +``` + +Dotted Grid + +### `DOWNWARD_DIAGONAL` + +```python +DOWNWARD_DIAGONAL = (52, 'dnDiag', 'Downward Diagonal') +``` + +Downward Diagonal + +### `ERCENT_40` + +```python +ERCENT_40 = (6, 'pct40', '40% of the foreground color.') +``` + +40% of the foreground color. + +### `HORIZONTAL` + +```python +HORIZONTAL = (49, 'horz', 'Horizontal') +``` + +Horizontal + +### `HORIZONTAL_BRICK` + +```python +HORIZONTAL_BRICK = (35, 'horzBrick', 'Horizontal Brick') +``` + +Horizontal Brick + +### `LARGE_CHECKER_BOARD` + +```python +LARGE_CHECKER_BOARD = (36, 'lgCheck', 'Large Checker Board') +``` + +Large Checker Board + +### `LARGE_CONFETTI` + +```python +LARGE_CONFETTI = (33, 'lgConfetti', 'Large Confetti') +``` + +Large Confetti + +### `LARGE_GRID` + +```python +LARGE_GRID = (34, 'lgGrid', 'Large Grid') +``` + +Large Grid + +### `LIGHT_DOWNWARD_DIAGONAL` + +```python +LIGHT_DOWNWARD_DIAGONAL = (21, 'ltDnDiag', 'Light Downward Diagonal') +``` + +Light Downward Diagonal + +### `LIGHT_HORIZONTAL` + +```python +LIGHT_HORIZONTAL = (19, 'ltHorz', 'Light Horizontal') +``` + +Light Horizontal + +### `LIGHT_UPWARD_DIAGONAL` + +```python +LIGHT_UPWARD_DIAGONAL = (22, 'ltUpDiag', 'Light Upward Diagonal') +``` + +Light Upward Diagonal + +### `LIGHT_VERTICAL` + +```python +LIGHT_VERTICAL = (20, 'ltVert', 'Light Vertical') +``` + +Light Vertical + +### `MIXED` + +```python +MIXED = (-2, '', 'Mixed pattern (read-only).') +``` + +Mixed pattern (read-only). + +### `NARROW_HORIZONTAL` + +```python +NARROW_HORIZONTAL = (30, 'narHorz', 'Narrow Horizontal') +``` + +Narrow Horizontal + +### `NARROW_VERTICAL` + +```python +NARROW_VERTICAL = (29, 'narVert', 'Narrow Vertical') +``` + +Narrow Vertical + +### `OUTLINED_DIAMOND` + +```python +OUTLINED_DIAMOND = (41, 'openDmnd', 'Outlined Diamond') +``` + +Outlined Diamond + +### `PERCENT_10` + +```python +PERCENT_10 = (2, 'pct10', '10% of the foreground color.') +``` + +10% of the foreground color. + +### `PERCENT_20` + +```python +PERCENT_20 = (3, 'pct20', '20% of the foreground color.') +``` + +20% of the foreground color. + +### `PERCENT_25` + +```python +PERCENT_25 = (4, 'pct25', '25% of the foreground color.') +``` + +25% of the foreground color. + +### `PERCENT_30` + +```python +PERCENT_30 = (5, 'pct30', '30% of the foreground color.') +``` + +30% of the foreground color. + +### `PERCENT_5` + +```python +PERCENT_5 = (1, 'pct5', '5% of the foreground color.') +``` + +5% of the foreground color. + +### `PERCENT_50` + +```python +PERCENT_50 = (7, 'pct50', '50% of the foreground color.') +``` + +50% of the foreground color. + +### `PERCENT_60` + +```python +PERCENT_60 = (8, 'pct60', '60% of the foreground color.') +``` + +60% of the foreground color. + +### `PERCENT_70` + +```python +PERCENT_70 = (9, 'pct70', '70% of the foreground color.') +``` + +70% of the foreground color. + +### `PERCENT_75` + +```python +PERCENT_75 = (10, 'pct75', '75% of the foreground color.') +``` + +75% of the foreground color. + +### `PERCENT_80` + +```python +PERCENT_80 = (11, 'pct80', '80% of the foreground color.') +``` + +80% of the foreground color. + +### `PERCENT_90` + +```python +PERCENT_90 = (12, 'pct90', '90% of the foreground color.') +``` + +90% of the foreground color. + +### `PLAID` + +```python +PLAID = (42, 'plaid', 'Plaid') +``` + +Plaid + +### `SHINGLE` + +```python +SHINGLE = (47, 'shingle', 'Shingle') +``` + +Shingle + +### `SMALL_CHECKER_BOARD` + +```python +SMALL_CHECKER_BOARD = (17, 'smCheck', 'Small Checker Board') +``` + +Small Checker Board + +### `SMALL_CONFETTI` + +```python +SMALL_CONFETTI = (37, 'smConfetti', 'Small Confetti') +``` + +Small Confetti + +### `SMALL_GRID` + +```python +SMALL_GRID = (23, 'smGrid', 'Small Grid') +``` + +Small Grid + +### `SOLID_DIAMOND` + +```python +SOLID_DIAMOND = (39, 'solidDmnd', 'Solid Diamond') +``` + +Solid Diamond + +### `SPHERE` + +```python +SPHERE = (43, 'sphere', 'Sphere') +``` + +Sphere + +### `TRELLIS` + +```python +TRELLIS = (18, 'trellis', 'Trellis') +``` + +Trellis + +### `UPWARD_DIAGONAL` + +```python +UPWARD_DIAGONAL = (53, 'upDiag', 'Upward Diagonal') +``` + +Upward Diagonal + +### `VERTICAL` + +```python +VERTICAL = (50, 'vert', 'Vertical') +``` + +Vertical + +### `WAVE` + +```python +WAVE = (48, 'wave', 'Wave') +``` + +Wave + +### `WEAVE` + +```python +WEAVE = (44, 'weave', 'Weave') +``` + +Weave + +### `WIDE_DOWNWARD_DIAGONAL` + +```python +WIDE_DOWNWARD_DIAGONAL = (25, 'wdDnDiag', 'Wide Downward Diagonal') +``` + +Wide Downward Diagonal + +### `WIDE_UPWARD_DIAGONAL` + +```python +WIDE_UPWARD_DIAGONAL = (26, 'wdUpDiag', 'Wide Upward Diagonal') +``` + +Wide Upward Diagonal + +### `ZIG_ZAG` + +```python +ZIG_ZAG = (38, 'zigZag', 'Zig Zag') +``` + +Zig Zag + +## `MSO_THEME_COLOR` + +```python +MSO_THEME_COLOR = MSO_THEME_COLOR_INDEX +``` + +## `MSO_THEME_COLOR_INDEX` + +Bases: `BaseXmlEnum` + +An Office theme color, one of those shown in the color gallery on the formatting ribbon. + +Alias: ``MSO_THEME_COLOR`` + +Example:: + + from pptx.enum.dml import MSO_THEME_COLOR + + shape.fill.solid() + shape.fill.fore_color.theme_color = MSO_THEME_COLOR.ACCENT_1 + +MS API Name: `MsoThemeColorIndex` + +http://msdn.microsoft.com/en-us/library/office/ff860782(v=office.15).aspx + +### `ACCENT_1` + +```python +ACCENT_1 = (5, 'accent1', 'Specifies the Accent 1 theme color.') +``` + +Specifies the Accent 1 theme color. + +### `ACCENT_2` + +```python +ACCENT_2 = (6, 'accent2', 'Specifies the Accent 2 theme color.') +``` + +Specifies the Accent 2 theme color. + +### `ACCENT_3` + +```python +ACCENT_3 = (7, 'accent3', 'Specifies the Accent 3 theme color.') +``` + +Specifies the Accent 3 theme color. + +### `ACCENT_4` + +```python +ACCENT_4 = (8, 'accent4', 'Specifies the Accent 4 theme color.') +``` + +Specifies the Accent 4 theme color. + +### `ACCENT_5` + +```python +ACCENT_5 = (9, 'accent5', 'Specifies the Accent 5 theme color.') +``` + +Specifies the Accent 5 theme color. + +### `ACCENT_6` + +```python +ACCENT_6 = (10, 'accent6', 'Specifies the Accent 6 theme color.') +``` + +Specifies the Accent 6 theme color. + +### `BACKGROUND_1` + +```python +BACKGROUND_1 = (14, 'bg1', 'Specifies the Background 1 theme color.') +``` + +Specifies the Background 1 theme color. + +### `BACKGROUND_2` + +```python +BACKGROUND_2 = (16, 'bg2', 'Specifies the Background 2 theme color.') +``` + +Specifies the Background 2 theme color. + +### `DARK_1` + +```python +DARK_1 = (1, 'dk1', 'Specifies the Dark 1 theme color.') +``` + +Specifies the Dark 1 theme color. + +### `DARK_2` + +```python +DARK_2 = (3, 'dk2', 'Specifies the Dark 2 theme color.') +``` + +Specifies the Dark 2 theme color. + +### `FOLLOWED_HYPERLINK` + +```python +FOLLOWED_HYPERLINK = (12, 'folHlink', 'Specifies the theme color for a clicked hyperlink.') +``` + +Specifies the theme color for a clicked hyperlink. + +### `HYPERLINK` + +```python +HYPERLINK = (11, 'hlink', 'Specifies the theme color for a hyperlink.') +``` + +Specifies the theme color for a hyperlink. + +### `LIGHT_1` + +```python +LIGHT_1 = (2, 'lt1', 'Specifies the Light 1 theme color.') +``` + +Specifies the Light 1 theme color. + +### `LIGHT_2` + +```python +LIGHT_2 = (4, 'lt2', 'Specifies the Light 2 theme color.') +``` + +Specifies the Light 2 theme color. + +### `MIXED` + +```python +MIXED = (-2, '', 'Indicates multiple theme colors are used, such as in a group shape (read-only).') +``` + +Indicates multiple theme colors are used, such as in a group shape (read-only). + +### `NOT_THEME_COLOR` + +```python +NOT_THEME_COLOR = (0, '', 'Indicates the color is not a theme color.') +``` + +Indicates the color is not a theme color. + +### `TEXT_1` + +```python +TEXT_1 = (13, 'tx1', 'Specifies the Text 1 theme color.') +``` + +Specifies the Text 1 theme color. + +### `TEXT_2` + +```python +TEXT_2 = (15, 'tx2', 'Specifies the Text 2 theme color.') +``` + +Specifies the Text 2 theme color. + + + + + +# `pptx.enum.lang` + +Enumerations used for specifying language. + +## `MSO_LANGUAGE_ID` + +Bases: `BaseXmlEnum` + +Specifies the language identifier. + +Example:: + + from pptx.enum.lang import MSO_LANGUAGE_ID + + font.language_id = MSO_LANGUAGE_ID.POLISH + +MS API Name: `MsoLanguageId` + +https://msdn.microsoft.com/en-us/library/office/ff862134.aspx + +### `AFRIKAANS` + +```python +AFRIKAANS = (1078, 'af-ZA', 'The Afrikaans language.') +``` + +The Afrikaans language. + +### `ALBANIAN` + +```python +ALBANIAN = (1052, 'sq-AL', 'The Albanian language.') +``` + +The Albanian language. + +### `AMHARIC` + +```python +AMHARIC = (1118, 'am-ET', 'The Amharic language.') +``` + +The Amharic language. + +### `ARABIC` + +```python +ARABIC = (1025, 'ar-SA', 'The Arabic language.') +``` + +The Arabic language. + +### `ARABIC_ALGERIA` + +```python +ARABIC_ALGERIA = (5121, 'ar-DZ', 'The Arabic Algeria language.') +``` + +The Arabic Algeria language. + +### `ARABIC_BAHRAIN` + +```python +ARABIC_BAHRAIN = (15361, 'ar-BH', 'The Arabic Bahrain language.') +``` + +The Arabic Bahrain language. + +### `ARABIC_EGYPT` + +```python +ARABIC_EGYPT = (3073, 'ar-EG', 'The Arabic Egypt language.') +``` + +The Arabic Egypt language. + +### `ARABIC_IRAQ` + +```python +ARABIC_IRAQ = (2049, 'ar-IQ', 'The Arabic Iraq language.') +``` + +The Arabic Iraq language. + +### `ARABIC_JORDAN` + +```python +ARABIC_JORDAN = (11265, 'ar-JO', 'The Arabic Jordan language.') +``` + +The Arabic Jordan language. + +### `ARABIC_KUWAIT` + +```python +ARABIC_KUWAIT = (13313, 'ar-KW', 'The Arabic Kuwait language.') +``` + +The Arabic Kuwait language. + +### `ARABIC_LEBANON` + +```python +ARABIC_LEBANON = (12289, 'ar-LB', 'The Arabic Lebanon language.') +``` + +The Arabic Lebanon language. + +### `ARABIC_LIBYA` + +```python +ARABIC_LIBYA = (4097, 'ar-LY', 'The Arabic Libya language.') +``` + +The Arabic Libya language. + +### `ARABIC_MOROCCO` + +```python +ARABIC_MOROCCO = (6145, 'ar-MA', 'The Arabic Morocco language.') +``` + +The Arabic Morocco language. + +### `ARABIC_OMAN` + +```python +ARABIC_OMAN = (8193, 'ar-OM', 'The Arabic Oman language.') +``` + +The Arabic Oman language. + +### `ARABIC_QATAR` + +```python +ARABIC_QATAR = (16385, 'ar-QA', 'The Arabic Qatar language.') +``` + +The Arabic Qatar language. + +### `ARABIC_SYRIA` + +```python +ARABIC_SYRIA = (10241, 'ar-SY', 'The Arabic Syria language.') +``` + +The Arabic Syria language. + +### `ARABIC_TUNISIA` + +```python +ARABIC_TUNISIA = (7169, 'ar-TN', 'The Arabic Tunisia language.') +``` + +The Arabic Tunisia language. + +### `ARABIC_UAE` + +```python +ARABIC_UAE = (14337, 'ar-AE', 'The Arabic UAE language.') +``` + +The Arabic UAE language. + +### `ARABIC_YEMEN` + +```python +ARABIC_YEMEN = (9217, 'ar-YE', 'The Arabic Yemen language.') +``` + +The Arabic Yemen language. + +### `ARMENIAN` + +```python +ARMENIAN = (1067, 'hy-AM', 'The Armenian language.') +``` + +The Armenian language. + +### `ASSAMESE` + +```python +ASSAMESE = (1101, 'as-IN', 'The Assamese language.') +``` + +The Assamese language. + +### `AZERI_CYRILLIC` + +```python +AZERI_CYRILLIC = (2092, 'az-AZ', 'The Azeri Cyrillic language.') +``` + +The Azeri Cyrillic language. + +### `AZERI_LATIN` + +```python +AZERI_LATIN = (1068, 'az-Latn-AZ', 'The Azeri Latin language.') +``` + +The Azeri Latin language. + +### `BASQUE` + +```python +BASQUE = (1069, 'eu-ES', 'The Basque language.') +``` + +The Basque language. + +### `BELGIAN_DUTCH` + +```python +BELGIAN_DUTCH = (2067, 'nl-BE', 'The Belgian Dutch language.') +``` + +The Belgian Dutch language. + +### `BELGIAN_FRENCH` + +```python +BELGIAN_FRENCH = (2060, 'fr-BE', 'The Belgian French language.') +``` + +The Belgian French language. + +### `BENGALI` + +```python +BENGALI = (1093, 'bn-IN', 'The Bengali language.') +``` + +The Bengali language. + +### `BOSNIAN` + +```python +BOSNIAN = (4122, 'hr-BA', 'The Bosnian language.') +``` + +The Bosnian language. + +### `BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC` + +```python +BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC = (8218, 'bs-BA', 'The Bosnian Bosnia Herzegovina Cyrillic language.') +``` + +The Bosnian Bosnia Herzegovina Cyrillic language. + +### `BOSNIAN_BOSNIA_HERZEGOVINA_LATIN` + +```python +BOSNIAN_BOSNIA_HERZEGOVINA_LATIN = (5146, 'bs-Latn-BA', 'The Bosnian Bosnia Herzegovina Latin language.') +``` + +The Bosnian Bosnia Herzegovina Latin language. + +### `BRAZILIAN_PORTUGUESE` + +```python +BRAZILIAN_PORTUGUESE = (1046, 'pt-BR', 'The Brazilian Portuguese language.') +``` + +The Brazilian Portuguese language. + +### `BULGARIAN` + +```python +BULGARIAN = (1026, 'bg-BG', 'The Bulgarian language.') +``` + +The Bulgarian language. + +### `BURMESE` + +```python +BURMESE = (1109, 'my-MM', 'The Burmese language.') +``` + +The Burmese language. + +### `BYELORUSSIAN` + +```python +BYELORUSSIAN = (1059, 'be-BY', 'The Byelorussian language.') +``` + +The Byelorussian language. + +### `CATALAN` + +```python +CATALAN = (1027, 'ca-ES', 'The Catalan language.') +``` + +The Catalan language. + +### `CHEROKEE` + +```python +CHEROKEE = (1116, 'chr-US', 'The Cherokee language.') +``` + +The Cherokee language. + +### `CHINESE_HONG_KONG_SAR` + +```python +CHINESE_HONG_KONG_SAR = (3076, 'zh-HK', 'The Chinese Hong Kong SAR language.') +``` + +The Chinese Hong Kong SAR language. + +### `CHINESE_MACAO_SAR` + +```python +CHINESE_MACAO_SAR = (5124, 'zh-MO', 'The Chinese Macao SAR language.') +``` + +The Chinese Macao SAR language. + +### `CHINESE_SINGAPORE` + +```python +CHINESE_SINGAPORE = (4100, 'zh-SG', 'The Chinese Singapore language.') +``` + +The Chinese Singapore language. + +### `CROATIAN` + +```python +CROATIAN = (1050, 'hr-HR', 'The Croatian language.') +``` + +The Croatian language. + +### `CZECH` + +```python +CZECH = (1029, 'cs-CZ', 'The Czech language.') +``` + +The Czech language. + +### `DANISH` + +```python +DANISH = (1030, 'da-DK', 'The Danish language.') +``` + +The Danish language. + +### `DIVEHI` + +```python +DIVEHI = (1125, 'div-MV', 'The Divehi language.') +``` + +The Divehi language. + +### `DUTCH` + +```python +DUTCH = (1043, 'nl-NL', 'The Dutch language.') +``` + +The Dutch language. + +### `EDO` + +```python +EDO = (1126, 'bin-NG', 'The Edo language.') +``` + +The Edo language. + +### `ENGLISH_AUS` + +```python +ENGLISH_AUS = (3081, 'en-AU', 'The English AUS language.') +``` + +The English AUS language. + +### `ENGLISH_BELIZE` + +```python +ENGLISH_BELIZE = (10249, 'en-BZ', 'The English Belize language.') +``` + +The English Belize language. + +### `ENGLISH_CANADIAN` + +```python +ENGLISH_CANADIAN = (4105, 'en-CA', 'The English Canadian language.') +``` + +The English Canadian language. + +### `ENGLISH_CARIBBEAN` + +```python +ENGLISH_CARIBBEAN = (9225, 'en-CB', 'The English Caribbean language.') +``` + +The English Caribbean language. + +### `ENGLISH_INDONESIA` + +```python +ENGLISH_INDONESIA = (14345, 'en-ID', 'The English Indonesia language.') +``` + +The English Indonesia language. + +### `ENGLISH_IRELAND` + +```python +ENGLISH_IRELAND = (6153, 'en-IE', 'The English Ireland language.') +``` + +The English Ireland language. + +### `ENGLISH_JAMAICA` + +```python +ENGLISH_JAMAICA = (8201, 'en-JA', 'The English Jamaica language.') +``` + +The English Jamaica language. + +### `ENGLISH_NEW_ZEALAND` + +```python +ENGLISH_NEW_ZEALAND = (5129, 'en-NZ', 'The English NewZealand language.') +``` + +The English NewZealand language. + +### `ENGLISH_PHILIPPINES` + +```python +ENGLISH_PHILIPPINES = (13321, 'en-PH', 'The English Philippines language.') +``` + +The English Philippines language. + +### `ENGLISH_SOUTH_AFRICA` + +```python +ENGLISH_SOUTH_AFRICA = (7177, 'en-ZA', 'The English South Africa language.') +``` + +The English South Africa language. + +### `ENGLISH_TRINIDAD_TOBAGO` + +```python +ENGLISH_TRINIDAD_TOBAGO = (11273, 'en-TT', 'The English Trinidad Tobago language.') +``` + +The English Trinidad Tobago language. + +### `ENGLISH_UK` + +```python +ENGLISH_UK = (2057, 'en-GB', 'The English UK language.') +``` + +The English UK language. + +### `ENGLISH_US` + +```python +ENGLISH_US = (1033, 'en-US', 'The English US language.') +``` + +The English US language. + +### `ENGLISH_ZIMBABWE` + +```python +ENGLISH_ZIMBABWE = (12297, 'en-ZW', 'The English Zimbabwe language.') +``` + +The English Zimbabwe language. + +### `ESTONIAN` + +```python +ESTONIAN = (1061, 'et-EE', 'The Estonian language.') +``` + +The Estonian language. + +### `FAEROESE` + +```python +FAEROESE = (1080, 'fo-FO', 'The Faeroese language.') +``` + +The Faeroese language. + +### `FARSI` + +```python +FARSI = (1065, 'fa-IR', 'The Farsi language.') +``` + +The Farsi language. + +### `FILIPINO` + +```python +FILIPINO = (1124, 'fil-PH', 'The Filipino language.') +``` + +The Filipino language. + +### `FINNISH` + +```python +FINNISH = (1035, 'fi-FI', 'The Finnish language.') +``` + +The Finnish language. + +### `FRANCH_CONGO_DRC` + +```python +FRANCH_CONGO_DRC = (9228, 'fr-CD', 'The French Congo DRC language.') +``` + +The French Congo DRC language. + +### `FRENCH` + +```python +FRENCH = (1036, 'fr-FR', 'The French language.') +``` + +The French language. + +### `FRENCH_CAMEROON` + +```python +FRENCH_CAMEROON = (11276, 'fr-CM', 'The French Cameroon language.') +``` + +The French Cameroon language. + +### `FRENCH_CANADIAN` + +```python +FRENCH_CANADIAN = (3084, 'fr-CA', 'The French Canadian language.') +``` + +The French Canadian language. + +### `FRENCH_COTED_IVOIRE` + +```python +FRENCH_COTED_IVOIRE = (12300, 'fr-CI', 'The French Coted Ivoire language.') +``` + +The French Coted Ivoire language. + +### `FRENCH_HAITI` + +```python +FRENCH_HAITI = (15372, 'fr-HT', 'The French Haiti language.') +``` + +The French Haiti language. + +### `FRENCH_LUXEMBOURG` + +```python +FRENCH_LUXEMBOURG = (5132, 'fr-LU', 'The French Luxembourg language.') +``` + +The French Luxembourg language. + +### `FRENCH_MALI` + +```python +FRENCH_MALI = (13324, 'fr-ML', 'The French Mali language.') +``` + +The French Mali language. + +### `FRENCH_MONACO` + +```python +FRENCH_MONACO = (6156, 'fr-MC', 'The French Monaco language.') +``` + +The French Monaco language. + +### `FRENCH_MOROCCO` + +```python +FRENCH_MOROCCO = (14348, 'fr-MA', 'The French Morocco language.') +``` + +The French Morocco language. + +### `FRENCH_REUNION` + +```python +FRENCH_REUNION = (8204, 'fr-RE', 'The French Reunion language.') +``` + +The French Reunion language. + +### `FRENCH_SENEGAL` + +```python +FRENCH_SENEGAL = (10252, 'fr-SN', 'The French Senegal language.') +``` + +The French Senegal language. + +### `FRENCH_WEST_INDIES` + +```python +FRENCH_WEST_INDIES = (7180, 'fr-WINDIES', 'The French West Indies language.') +``` + +The French West Indies language. + +### `FRISIAN_NETHERLANDS` + +```python +FRISIAN_NETHERLANDS = (1122, 'fy-NL', 'The Frisian Netherlands language.') +``` + +The Frisian Netherlands language. + +### `FULFULDE` + +```python +FULFULDE = (1127, 'ff-NG', 'The Fulfulde language.') +``` + +The Fulfulde language. + +### `GAELIC_IRELAND` + +```python +GAELIC_IRELAND = (2108, 'ga-IE', 'The Gaelic Ireland language.') +``` + +The Gaelic Ireland language. + +### `GAELIC_SCOTLAND` + +```python +GAELIC_SCOTLAND = (1084, 'en-US', 'The Gaelic Scotland language.') +``` + +The Gaelic Scotland language. + +### `GALICIAN` + +```python +GALICIAN = (1110, 'gl-ES', 'The Galician language.') +``` + +The Galician language. + +### `GEORGIAN` + +```python +GEORGIAN = (1079, 'ka-GE', 'The Georgian language.') +``` + +The Georgian language. + +### `GERMAN` + +```python +GERMAN = (1031, 'de-DE', 'The German language.') +``` + +The German language. + +### `GERMAN_AUSTRIA` + +```python +GERMAN_AUSTRIA = (3079, 'de-AT', 'The German Austria language.') +``` + +The German Austria language. + +### `GERMAN_LIECHTENSTEIN` + +```python +GERMAN_LIECHTENSTEIN = (5127, 'de-LI', 'The German Liechtenstein language.') +``` + +The German Liechtenstein language. + +### `GERMAN_LUXEMBOURG` + +```python +GERMAN_LUXEMBOURG = (4103, 'de-LU', 'The German Luxembourg language.') +``` + +The German Luxembourg language. + +### `GREEK` + +```python +GREEK = (1032, 'el-GR', 'The Greek language.') +``` + +The Greek language. + +### `GUARANI` + +```python +GUARANI = (1140, 'gn-PY', 'The Guarani language.') +``` + +The Guarani language. + +### `GUJARATI` + +```python +GUJARATI = (1095, 'gu-IN', 'The Gujarati language.') +``` + +The Gujarati language. + +### `HAUSA` + +```python +HAUSA = (1128, 'ha-NG', 'The Hausa language.') +``` + +The Hausa language. + +### `HAWAIIAN` + +```python +HAWAIIAN = (1141, 'haw-US', 'The Hawaiian language.') +``` + +The Hawaiian language. + +### `HEBREW` + +```python +HEBREW = (1037, 'he-IL', 'The Hebrew language.') +``` + +The Hebrew language. + +### `HINDI` + +```python +HINDI = (1081, 'hi-IN', 'The Hindi language.') +``` + +The Hindi language. + +### `HUNGARIAN` + +```python +HUNGARIAN = (1038, 'hu-HU', 'The Hungarian language.') +``` + +The Hungarian language. + +### `IBIBIO` + +```python +IBIBIO = (1129, 'ibb-NG', 'The Ibibio language.') +``` + +The Ibibio language. + +### `ICELANDIC` + +```python +ICELANDIC = (1039, 'is-IS', 'The Icelandic language.') +``` + +The Icelandic language. + +### `IGBO` + +```python +IGBO = (1136, 'ig-NG', 'The Igbo language.') +``` + +The Igbo language. + +### `INDONESIAN` + +```python +INDONESIAN = (1057, 'id-ID', 'The Indonesian language.') +``` + +The Indonesian language. + +### `INUKTITUT` + +```python +INUKTITUT = (1117, 'iu-Cans-CA', 'The Inuktitut language.') +``` + +The Inuktitut language. + +### `ITALIAN` + +```python +ITALIAN = (1040, 'it-IT', 'The Italian language.') +``` + +The Italian language. + +### `JAPANESE` + +```python +JAPANESE = (1041, 'ja-JP', 'The Japanese language.') +``` + +The Japanese language. + +### `KANNADA` + +```python +KANNADA = (1099, 'kn-IN', 'The Kannada language.') +``` + +The Kannada language. + +### `KANURI` + +```python +KANURI = (1137, 'kr-NG', 'The Kanuri language.') +``` + +The Kanuri language. + +### `KASHMIRI` + +```python +KASHMIRI = (1120, 'ks-Arab', 'The Kashmiri language.') +``` + +The Kashmiri language. + +### `KASHMIRI_DEVANAGARI` + +```python +KASHMIRI_DEVANAGARI = (2144, 'ks-Deva', 'The Kashmiri Devanagari language.') +``` + +The Kashmiri Devanagari language. + +### `KAZAKH` + +```python +KAZAKH = (1087, 'kk-KZ', 'The Kazakh language.') +``` + +The Kazakh language. + +### `KHMER` + +```python +KHMER = (1107, 'kh-KH', 'The Khmer language.') +``` + +The Khmer language. + +### `KIRGHIZ` + +```python +KIRGHIZ = (1088, 'ky-KG', 'The Kirghiz language.') +``` + +The Kirghiz language. + +### `KONKANI` + +```python +KONKANI = (1111, 'kok-IN', 'The Konkani language.') +``` + +The Konkani language. + +### `KOREAN` + +```python +KOREAN = (1042, 'ko-KR', 'The Korean language.') +``` + +The Korean language. + +### `KYRGYZ` + +```python +KYRGYZ = (1088, 'ky-KG', 'The Kyrgyz language.') +``` + +The Kyrgyz language. + +### `LAO` + +```python +LAO = (1108, 'lo-LA', 'The Lao language.') +``` + +The Lao language. + +### `LATIN` + +```python +LATIN = (1142, 'la-Latn', 'The Latin language.') +``` + +The Latin language. + +### `LATVIAN` + +```python +LATVIAN = (1062, 'lv-LV', 'The Latvian language.') +``` + +The Latvian language. + +### `LITHUANIAN` + +```python +LITHUANIAN = (1063, 'lt-LT', 'The Lithuanian language.') +``` + +The Lithuanian language. + +### `MACEDONINAN_FYROM` + +```python +MACEDONINAN_FYROM = (1071, 'mk-MK', 'The Macedonian FYROM language.') +``` + +The Macedonian FYROM language. + +### `MALAYALAM` + +```python +MALAYALAM = (1100, 'ml-IN', 'The Malayalam language.') +``` + +The Malayalam language. + +### `MALAYSIAN` + +```python +MALAYSIAN = (1086, 'ms-MY', 'The Malaysian language.') +``` + +The Malaysian language. + +### `MALAY_BRUNEI_DARUSSALAM` + +```python +MALAY_BRUNEI_DARUSSALAM = (2110, 'ms-BN', 'The Malay Brunei Darussalam language.') +``` + +The Malay Brunei Darussalam language. + +### `MALTESE` + +```python +MALTESE = (1082, 'mt-MT', 'The Maltese language.') +``` + +The Maltese language. + +### `MANIPURI` + +```python +MANIPURI = (1112, 'mni-IN', 'The Manipuri language.') +``` + +The Manipuri language. + +### `MAORI` + +```python +MAORI = (1153, 'mi-NZ', 'The Maori language.') +``` + +The Maori language. + +### `MARATHI` + +```python +MARATHI = (1102, 'mr-IN', 'The Marathi language.') +``` + +The Marathi language. + +### `MEXICAN_SPANISH` + +```python +MEXICAN_SPANISH = (2058, 'es-MX', 'The Mexican Spanish language.') +``` + +The Mexican Spanish language. + +### `MIXED` + +```python +MIXED = (-2, '', 'More than one language in specified range (read-only).') +``` + +More than one language in specified range (read-only). + +### `MONGOLIAN` + +```python +MONGOLIAN = (1104, 'mn-MN', 'The Mongolian language.') +``` + +The Mongolian language. + +### `NEPALI` + +```python +NEPALI = (1121, 'ne-NP', 'The Nepali language.') +``` + +The Nepali language. + +### `NONE` + +```python +NONE = (0, '', 'No language specified.') +``` + +No language specified. + +### `NORWEGIAN_BOKMOL` + +```python +NORWEGIAN_BOKMOL = (1044, 'nb-NO', 'The Norwegian Bokmol language.') +``` + +The Norwegian Bokmol language. + +### `NORWEGIAN_NYNORSK` + +```python +NORWEGIAN_NYNORSK = (2068, 'nn-NO', 'The Norwegian Nynorsk language.') +``` + +The Norwegian Nynorsk language. + +### `NO_PROOFING` + +```python +NO_PROOFING = (1024, 'en-US', 'No proofing.') +``` + +No proofing. + +### `ORIYA` + +```python +ORIYA = (1096, 'or-IN', 'The Oriya language.') +``` + +The Oriya language. + +### `OROMO` + +```python +OROMO = (1138, 'om-Ethi-ET', 'The Oromo language.') +``` + +The Oromo language. + +### `PASHTO` + +```python +PASHTO = (1123, 'ps-AF', 'The Pashto language.') +``` + +The Pashto language. + +### `POLISH` + +```python +POLISH = (1045, 'pl-PL', 'The Polish language.') +``` + +The Polish language. + +### `PORTUGUESE` + +```python +PORTUGUESE = (2070, 'pt-PT', 'The Portuguese language.') +``` + +The Portuguese language. + +### `PUNJABI` + +```python +PUNJABI = (1094, 'pa-IN', 'The Punjabi language.') +``` + +The Punjabi language. + +### `QUECHUA_BOLIVIA` + +```python +QUECHUA_BOLIVIA = (1131, 'quz-BO', 'The Quechua Bolivia language.') +``` + +The Quechua Bolivia language. + +### `QUECHUA_ECUADOR` + +```python +QUECHUA_ECUADOR = (2155, 'quz-EC', 'The Quechua Ecuador language.') +``` + +The Quechua Ecuador language. + +### `QUECHUA_PERU` + +```python +QUECHUA_PERU = (3179, 'quz-PE', 'The Quechua Peru language.') +``` + +The Quechua Peru language. + +### `RHAETO_ROMANIC` + +```python +RHAETO_ROMANIC = (1047, 'rm-CH', 'The Rhaeto Romanic language.') +``` + +The Rhaeto Romanic language. + +### `ROMANIAN` + +```python +ROMANIAN = (1048, 'ro-RO', 'The Romanian language.') +``` + +The Romanian language. + +### `ROMANIAN_MOLDOVA` + +```python +ROMANIAN_MOLDOVA = (2072, 'ro-MO', 'The Romanian Moldova language.') +``` + +The Romanian Moldova language. + +### `RUSSIAN` + +```python +RUSSIAN = (1049, 'ru-RU', 'The Russian language.') +``` + +The Russian language. + +### `RUSSIAN_MOLDOVA` + +```python +RUSSIAN_MOLDOVA = (2073, 'ru-MO', 'The Russian Moldova language.') +``` + +The Russian Moldova language. + +### `SAMI_LAPPISH` + +```python +SAMI_LAPPISH = (1083, 'se-NO', 'The Sami Lappish language.') +``` + +The Sami Lappish language. + +### `SANSKRIT` + +```python +SANSKRIT = (1103, 'sa-IN', 'The Sanskrit language.') +``` + +The Sanskrit language. + +### `SEPEDI` + +```python +SEPEDI = (1132, 'ns-ZA', 'The Sepedi language.') +``` + +The Sepedi language. + +### `SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC` + +```python +SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC = (7194, 'sr-BA', 'The Serbian Bosnia Herzegovina Cyrillic language.') +``` + +The Serbian Bosnia Herzegovina Cyrillic language. + +### `SERBIAN_BOSNIA_HERZEGOVINA_LATIN` + +```python +SERBIAN_BOSNIA_HERZEGOVINA_LATIN = (6170, 'sr-Latn-BA', 'The Serbian Bosnia Herzegovina Latin language.') +``` + +The Serbian Bosnia Herzegovina Latin language. + +### `SERBIAN_CYRILLIC` + +```python +SERBIAN_CYRILLIC = (3098, 'sr-SP', 'The Serbian Cyrillic language.') +``` + +The Serbian Cyrillic language. + +### `SERBIAN_LATIN` + +```python +SERBIAN_LATIN = (2074, 'sr-Latn-CS', 'The Serbian Latin language.') +``` + +The Serbian Latin language. + +### `SESOTHO` + +```python +SESOTHO = (1072, 'st-ZA', 'The Sesotho language.') +``` + +The Sesotho language. + +### `SIMPLIFIED_CHINESE` + +```python +SIMPLIFIED_CHINESE = (2052, 'zh-CN', 'The Simplified Chinese language.') +``` + +The Simplified Chinese language. + +### `SINDHI` + +```python +SINDHI = (1113, 'sd-Deva-IN', 'The Sindhi language.') +``` + +The Sindhi language. + +### `SINDHI_PAKISTAN` + +```python +SINDHI_PAKISTAN = (2137, 'sd-Arab-PK', 'The Sindhi Pakistan language.') +``` + +The Sindhi Pakistan language. + +### `SINHALESE` + +```python +SINHALESE = (1115, 'si-LK', 'The Sinhalese language.') +``` + +The Sinhalese language. + +### `SLOVAK` + +```python +SLOVAK = (1051, 'sk-SK', 'The Slovak language.') +``` + +The Slovak language. + +### `SLOVENIAN` + +```python +SLOVENIAN = (1060, 'sl-SI', 'The Slovenian language.') +``` + +The Slovenian language. + +### `SOMALI` + +```python +SOMALI = (1143, 'so-SO', 'The Somali language.') +``` + +The Somali language. + +### `SORBIAN` + +```python +SORBIAN = (1070, 'wen-DE', 'The Sorbian language.') +``` + +The Sorbian language. + +### `SPANISH` + +```python +SPANISH = (1034, 'es-ES_tradnl', 'The Spanish language.') +``` + +The Spanish language. + +### `SPANISH_ARGENTINA` + +```python +SPANISH_ARGENTINA = (11274, 'es-AR', 'The Spanish Argentina language.') +``` + +The Spanish Argentina language. + +### `SPANISH_BOLIVIA` + +```python +SPANISH_BOLIVIA = (16394, 'es-BO', 'The Spanish Bolivia language.') +``` + +The Spanish Bolivia language. + +### `SPANISH_CHILE` + +```python +SPANISH_CHILE = (13322, 'es-CL', 'The Spanish Chile language.') +``` + +The Spanish Chile language. + +### `SPANISH_COLOMBIA` + +```python +SPANISH_COLOMBIA = (9226, 'es-CO', 'The Spanish Colombia language.') +``` + +The Spanish Colombia language. + +### `SPANISH_COSTA_RICA` + +```python +SPANISH_COSTA_RICA = (5130, 'es-CR', 'The Spanish Costa Rica language.') +``` + +The Spanish Costa Rica language. + +### `SPANISH_DOMINICAN_REPUBLIC` + +```python +SPANISH_DOMINICAN_REPUBLIC = (7178, 'es-DO', 'The Spanish Dominican Republic language.') +``` + +The Spanish Dominican Republic language. + +### `SPANISH_ECUADOR` + +```python +SPANISH_ECUADOR = (12298, 'es-EC', 'The Spanish Ecuador language.') +``` + +The Spanish Ecuador language. + +### `SPANISH_EL_SALVADOR` + +```python +SPANISH_EL_SALVADOR = (17418, 'es-SV', 'The Spanish El Salvador language.') +``` + +The Spanish El Salvador language. + +### `SPANISH_GUATEMALA` + +```python +SPANISH_GUATEMALA = (4106, 'es-GT', 'The Spanish Guatemala language.') +``` + +The Spanish Guatemala language. + +### `SPANISH_HONDURAS` + +```python +SPANISH_HONDURAS = (18442, 'es-HN', 'The Spanish Honduras language.') +``` + +The Spanish Honduras language. + +### `SPANISH_MODERN_SORT` + +```python +SPANISH_MODERN_SORT = (3082, 'es-ES', 'The Spanish Modern Sort language.') +``` + +The Spanish Modern Sort language. + +### `SPANISH_NICARAGUA` + +```python +SPANISH_NICARAGUA = (19466, 'es-NI', 'The Spanish Nicaragua language.') +``` + +The Spanish Nicaragua language. + +### `SPANISH_PANAMA` + +```python +SPANISH_PANAMA = (6154, 'es-PA', 'The Spanish Panama language.') +``` + +The Spanish Panama language. + +### `SPANISH_PARAGUAY` + +```python +SPANISH_PARAGUAY = (15370, 'es-PY', 'The Spanish Paraguay language.') +``` + +The Spanish Paraguay language. + +### `SPANISH_PERU` + +```python +SPANISH_PERU = (10250, 'es-PE', 'The Spanish Peru language.') +``` + +The Spanish Peru language. + +### `SPANISH_PUERTO_RICO` + +```python +SPANISH_PUERTO_RICO = (20490, 'es-PR', 'The Spanish Puerto Rico language.') +``` + +The Spanish Puerto Rico language. + +### `SPANISH_URUGUAY` + +```python +SPANISH_URUGUAY = (14346, 'es-UR', 'The Spanish Uruguay language.') +``` + +The Spanish Uruguay language. + +### `SPANISH_VENEZUELA` + +```python +SPANISH_VENEZUELA = (8202, 'es-VE', 'The Spanish Venezuela language.') +``` + +The Spanish Venezuela language. + +### `SUTU` + +```python +SUTU = (1072, 'st-ZA', 'The Sutu language.') +``` + +The Sutu language. + +### `SWAHILI` + +```python +SWAHILI = (1089, 'sw-KE', 'The Swahili language.') +``` + +The Swahili language. + +### `SWEDISH` + +```python +SWEDISH = (1053, 'sv-SE', 'The Swedish language.') +``` + +The Swedish language. + +### `SWEDISH_FINLAND` + +```python +SWEDISH_FINLAND = (2077, 'sv-FI', 'The Swedish Finland language.') +``` + +The Swedish Finland language. + +### `SWISS_FRENCH` + +```python +SWISS_FRENCH = (4108, 'fr-CH', 'The Swiss French language.') +``` + +The Swiss French language. + +### `SWISS_GERMAN` + +```python +SWISS_GERMAN = (2055, 'de-CH', 'The Swiss German language.') +``` + +The Swiss German language. + +### `SWISS_ITALIAN` + +```python +SWISS_ITALIAN = (2064, 'it-CH', 'The Swiss Italian language.') +``` + +The Swiss Italian language. + +### `SYRIAC` + +```python +SYRIAC = (1114, 'syr-SY', 'The Syriac language.') +``` + +The Syriac language. + +### `TAJIK` + +```python +TAJIK = (1064, 'tg-TJ', 'The Tajik language.') +``` + +The Tajik language. + +### `TAMAZIGHT` + +```python +TAMAZIGHT = (1119, 'tzm-Arab-MA', 'The Tamazight language.') +``` + +The Tamazight language. + +### `TAMAZIGHT_LATIN` + +```python +TAMAZIGHT_LATIN = (2143, 'tmz-DZ', 'The Tamazight Latin language.') +``` + +The Tamazight Latin language. + +### `TAMIL` + +```python +TAMIL = (1097, 'ta-IN', 'The Tamil language.') +``` + +The Tamil language. + +### `TATAR` + +```python +TATAR = (1092, 'tt-RU', 'The Tatar language.') +``` + +The Tatar language. + +### `TELUGU` + +```python +TELUGU = (1098, 'te-IN', 'The Telugu language.') +``` + +The Telugu language. + +### `THAI` + +```python +THAI = (1054, 'th-TH', 'The Thai language.') +``` + +The Thai language. + +### `TIBETAN` + +```python +TIBETAN = (1105, 'bo-CN', 'The Tibetan language.') +``` + +The Tibetan language. + +### `TIGRIGNA_ERITREA` + +```python +TIGRIGNA_ERITREA = (2163, 'ti-ER', 'The Tigrigna Eritrea language.') +``` + +The Tigrigna Eritrea language. + +### `TIGRIGNA_ETHIOPIC` + +```python +TIGRIGNA_ETHIOPIC = (1139, 'ti-ET', 'The Tigrigna Ethiopic language.') +``` + +The Tigrigna Ethiopic language. + +### `TRADITIONAL_CHINESE` + +```python +TRADITIONAL_CHINESE = (1028, 'zh-TW', 'The Traditional Chinese language.') +``` + +The Traditional Chinese language. + +### `TSONGA` + +```python +TSONGA = (1073, 'ts-ZA', 'The Tsonga language.') +``` + +The Tsonga language. + +### `TSWANA` + +```python +TSWANA = (1074, 'tn-ZA', 'The Tswana language.') +``` + +The Tswana language. + +### `TURKISH` + +```python +TURKISH = (1055, 'tr-TR', 'The Turkish language.') +``` + +The Turkish language. + +### `TURKMEN` + +```python +TURKMEN = (1090, 'tk-TM', 'The Turkmen language.') +``` + +The Turkmen language. + +### `UKRAINIAN` + +```python +UKRAINIAN = (1058, 'uk-UA', 'The Ukrainian language.') +``` + +The Ukrainian language. + +### `URDU` + +```python +URDU = (1056, 'ur-PK', 'The Urdu language.') +``` + +The Urdu language. + +### `UZBEK_CYRILLIC` + +```python +UZBEK_CYRILLIC = (2115, 'uz-UZ', 'The Uzbek Cyrillic language.') +``` + +The Uzbek Cyrillic language. + +### `UZBEK_LATIN` + +```python +UZBEK_LATIN = (1091, 'uz-Latn-UZ', 'The Uzbek Latin language.') +``` + +The Uzbek Latin language. + +### `VENDA` + +```python +VENDA = (1075, 've-ZA', 'The Venda language.') +``` + +The Venda language. + +### `VIETNAMESE` + +```python +VIETNAMESE = (1066, 'vi-VN', 'The Vietnamese language.') +``` + +The Vietnamese language. + +### `WELSH` + +```python +WELSH = (1106, 'cy-GB', 'The Welsh language.') +``` + +The Welsh language. + +### `XHOSA` + +```python +XHOSA = (1076, 'xh-ZA', 'The Xhosa language.') +``` + +The Xhosa language. + +### `YI` + +```python +YI = (1144, 'ii-CN', 'The Yi language.') +``` + +The Yi language. + +### `YIDDISH` + +```python +YIDDISH = (1085, 'yi-Hebr', 'The Yiddish language.') +``` + +The Yiddish language. + +### `YORUBA` + +```python +YORUBA = (1130, 'yo-NG', 'The Yoruba language.') +``` + +The Yoruba language. + +### `ZULU` + +```python +ZULU = (1077, 'zu-ZA', 'The Zulu language.') +``` + +The Zulu language. diff --git a/addons/sandbox/skills/pptx/references/api-002.md b/addons/sandbox/skills/pptx/references/api-002.md new file mode 100644 index 000000000..084706ccb --- /dev/null +++ b/addons/sandbox/skills/pptx/references/api-002.md @@ -0,0 +1,6140 @@ + + + + +# `pptx.enum.shapes` + +Enumerations used by shapes and related objects. + +## `MSO` + +```python +MSO = MSO_SHAPE_TYPE +``` + +## `MSO_AUTO_SHAPE_TYPE` + +Bases: `BaseXmlEnum` + +Specifies a type of AutoShape, e.g. DOWN_ARROW. + +Alias: ``MSO_SHAPE`` + +Example:: + + from pptx.enum.shapes import MSO_SHAPE + from pptx.util import Inches + + left = top = width = height = Inches(1.0) + slide.shapes.add_shape( + MSO_SHAPE.ROUNDED_RECTANGLE, left, top, width, height + ) + +MS API Name: `MsoAutoShapeType` + +https://learn.microsoft.com/en-us/office/vba/api/Office.MsoAutoShapeType + +### `ACTION_BUTTON_BACK_OR_PREVIOUS` + +```python +ACTION_BUTTON_BACK_OR_PREVIOUS = (129, 'actionButtonBackPrevious', 'Back or Previous button. Supports mouse-click and mouse-over actions') +``` + +Back or Previous button. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_BEGINNING` + +```python +ACTION_BUTTON_BEGINNING = (131, 'actionButtonBeginning', 'Beginning button. Supports mouse-click and mouse-over actions') +``` + +Beginning button. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_CUSTOM` + +```python +ACTION_BUTTON_CUSTOM = (125, 'actionButtonBlank', 'Button with no default picture or text. Supports mouse-click and mouse-over actions') +``` + +Button with no default picture or text. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_DOCUMENT` + +```python +ACTION_BUTTON_DOCUMENT = (134, 'actionButtonDocument', 'Document button. Supports mouse-click and mouse-over actions') +``` + +Document button. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_END` + +```python +ACTION_BUTTON_END = (132, 'actionButtonEnd', 'End button. Supports mouse-click and mouse-over actions') +``` + +End button. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_FORWARD_OR_NEXT` + +```python +ACTION_BUTTON_FORWARD_OR_NEXT = (130, 'actionButtonForwardNext', 'Forward or Next button. Supports mouse-click and mouse-over actions') +``` + +Forward or Next button. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_HELP` + +```python +ACTION_BUTTON_HELP = (127, 'actionButtonHelp', 'Help button. Supports mouse-click and mouse-over actions') +``` + +Help button. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_HOME` + +```python +ACTION_BUTTON_HOME = (126, 'actionButtonHome', 'Home button. Supports mouse-click and mouse-over actions') +``` + +Home button. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_INFORMATION` + +```python +ACTION_BUTTON_INFORMATION = (128, 'actionButtonInformation', 'Information button. Supports mouse-click and mouse-over actions') +``` + +Information button. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_MOVIE` + +```python +ACTION_BUTTON_MOVIE = (136, 'actionButtonMovie', 'Movie button. Supports mouse-click and mouse-over actions') +``` + +Movie button. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_RETURN` + +```python +ACTION_BUTTON_RETURN = (133, 'actionButtonReturn', 'Return button. Supports mouse-click and mouse-over actions') +``` + +Return button. Supports mouse-click and mouse-over actions + +### `ACTION_BUTTON_SOUND` + +```python +ACTION_BUTTON_SOUND = (135, 'actionButtonSound', 'Sound button. Supports mouse-click and mouse-over actions') +``` + +Sound button. Supports mouse-click and mouse-over actions + +### `ARC` + +```python +ARC = (25, 'arc', 'Arc') +``` + +Arc + +### `BALLOON` + +```python +BALLOON = (137, 'wedgeRoundRectCallout', 'Rounded Rectangular Callout') +``` + +Rounded Rectangular Callout + +### `BENT_ARROW` + +```python +BENT_ARROW = (41, 'bentArrow', 'Block arrow that follows a curved 90-degree angle') +``` + +Block arrow that follows a curved 90-degree angle + +### `BENT_UP_ARROW` + +```python +BENT_UP_ARROW = (44, 'bentUpArrow', 'Block arrow that follows a sharp 90-degree angle. Points up by default') +``` + +Block arrow that follows a sharp 90-degree angle. Points up by default + +### `BEVEL` + +```python +BEVEL = (15, 'bevel', 'Bevel') +``` + +Bevel + +### `BLOCK_ARC` + +```python +BLOCK_ARC = (20, 'blockArc', 'Block arc') +``` + +Block arc + +### `CAN` + +```python +CAN = (13, 'can', 'Can') +``` + +Can + +### `CHART_PLUS` + +```python +CHART_PLUS = (182, 'chartPlus', 'Chart Plus') +``` + +Chart Plus + +### `CHART_STAR` + +```python +CHART_STAR = (181, 'chartStar', 'Chart Star') +``` + +Chart Star + +### `CHART_X` + +```python +CHART_X = (180, 'chartX', 'Chart X') +``` + +Chart X + +### `CHEVRON` + +```python +CHEVRON = (52, 'chevron', 'Chevron') +``` + +Chevron + +### `CHORD` + +```python +CHORD = (161, 'chord', 'Geometric chord shape') +``` + +Geometric chord shape + +### `CIRCULAR_ARROW` + +```python +CIRCULAR_ARROW = (60, 'circularArrow', 'Block arrow that follows a curved 180-degree angle') +``` + +Block arrow that follows a curved 180-degree angle + +### `CLOUD` + +```python +CLOUD = (179, 'cloud', 'Cloud') +``` + +Cloud + +### `CLOUD_CALLOUT` + +```python +CLOUD_CALLOUT = (108, 'cloudCallout', 'Cloud callout') +``` + +Cloud callout + +### `CORNER` + +```python +CORNER = (162, 'corner', 'Corner') +``` + +Corner + +### `CORNER_TABS` + +```python +CORNER_TABS = (169, 'cornerTabs', 'Corner Tabs') +``` + +Corner Tabs + +### `CROSS` + +```python +CROSS = (11, 'plus', 'Cross') +``` + +Cross + +### `CUBE` + +```python +CUBE = (14, 'cube', 'Cube') +``` + +Cube + +### `CURVED_DOWN_ARROW` + +```python +CURVED_DOWN_ARROW = (48, 'curvedDownArrow', 'Block arrow that curves down') +``` + +Block arrow that curves down + +### `CURVED_DOWN_RIBBON` + +```python +CURVED_DOWN_RIBBON = (100, 'ellipseRibbon', 'Ribbon banner that curves down') +``` + +Ribbon banner that curves down + +### `CURVED_LEFT_ARROW` + +```python +CURVED_LEFT_ARROW = (46, 'curvedLeftArrow', 'Block arrow that curves left') +``` + +Block arrow that curves left + +### `CURVED_RIGHT_ARROW` + +```python +CURVED_RIGHT_ARROW = (45, 'curvedRightArrow', 'Block arrow that curves right') +``` + +Block arrow that curves right + +### `CURVED_UP_ARROW` + +```python +CURVED_UP_ARROW = (47, 'curvedUpArrow', 'Block arrow that curves up') +``` + +Block arrow that curves up + +### `CURVED_UP_RIBBON` + +```python +CURVED_UP_RIBBON = (99, 'ellipseRibbon2', 'Ribbon banner that curves up') +``` + +Ribbon banner that curves up + +### `DECAGON` + +```python +DECAGON = (144, 'decagon', 'Decagon') +``` + +Decagon + +### `DIAGONAL_STRIPE` + +```python +DIAGONAL_STRIPE = (141, 'diagStripe', 'Diagonal Stripe') +``` + +Diagonal Stripe + +### `DIAMOND` + +```python +DIAMOND = (4, 'diamond', 'Diamond') +``` + +Diamond + +### `DODECAGON` + +```python +DODECAGON = (146, 'dodecagon', 'Dodecagon') +``` + +Dodecagon + +### `DONUT` + +```python +DONUT = (18, 'donut', 'Donut') +``` + +Donut + +### `DOUBLE_BRACE` + +```python +DOUBLE_BRACE = (27, 'bracePair', 'Double brace') +``` + +Double brace + +### `DOUBLE_BRACKET` + +```python +DOUBLE_BRACKET = (26, 'bracketPair', 'Double bracket') +``` + +Double bracket + +### `DOUBLE_WAVE` + +```python +DOUBLE_WAVE = (104, 'doubleWave', 'Double wave') +``` + +Double wave + +### `DOWN_ARROW` + +```python +DOWN_ARROW = (36, 'downArrow', 'Block arrow that points down') +``` + +Block arrow that points down + +### `DOWN_ARROW_CALLOUT` + +```python +DOWN_ARROW_CALLOUT = (56, 'downArrowCallout', 'Callout with arrow that points down') +``` + +Callout with arrow that points down + +### `DOWN_RIBBON` + +```python +DOWN_RIBBON = (98, 'ribbon', 'Ribbon banner with center area below ribbon ends') +``` + +Ribbon banner with center area below ribbon ends + +### `EXPLOSION1` + +```python +EXPLOSION1 = (89, 'irregularSeal1', 'Explosion') +``` + +Explosion + +### `EXPLOSION2` + +```python +EXPLOSION2 = (90, 'irregularSeal2', 'Explosion') +``` + +Explosion + +### `FLOWCHART_ALTERNATE_PROCESS` + +```python +FLOWCHART_ALTERNATE_PROCESS = (62, 'flowChartAlternateProcess', 'Alternate process flowchart symbol') +``` + +Alternate process flowchart symbol + +### `FLOWCHART_CARD` + +```python +FLOWCHART_CARD = (75, 'flowChartPunchedCard', 'Card flowchart symbol') +``` + +Card flowchart symbol + +### `FLOWCHART_COLLATE` + +```python +FLOWCHART_COLLATE = (79, 'flowChartCollate', 'Collate flowchart symbol') +``` + +Collate flowchart symbol + +### `FLOWCHART_CONNECTOR` + +```python +FLOWCHART_CONNECTOR = (73, 'flowChartConnector', 'Connector flowchart symbol') +``` + +Connector flowchart symbol + +### `FLOWCHART_DATA` + +```python +FLOWCHART_DATA = (64, 'flowChartInputOutput', 'Data flowchart symbol') +``` + +Data flowchart symbol + +### `FLOWCHART_DECISION` + +```python +FLOWCHART_DECISION = (63, 'flowChartDecision', 'Decision flowchart symbol') +``` + +Decision flowchart symbol + +### `FLOWCHART_DELAY` + +```python +FLOWCHART_DELAY = (84, 'flowChartDelay', 'Delay flowchart symbol') +``` + +Delay flowchart symbol + +### `FLOWCHART_DIRECT_ACCESS_STORAGE` + +```python +FLOWCHART_DIRECT_ACCESS_STORAGE = (87, 'flowChartMagneticDrum', 'Direct access storage flowchart symbol') +``` + +Direct access storage flowchart symbol + +### `FLOWCHART_DISPLAY` + +```python +FLOWCHART_DISPLAY = (88, 'flowChartDisplay', 'Display flowchart symbol') +``` + +Display flowchart symbol + +### `FLOWCHART_DOCUMENT` + +```python +FLOWCHART_DOCUMENT = (67, 'flowChartDocument', 'Document flowchart symbol') +``` + +Document flowchart symbol + +### `FLOWCHART_EXTRACT` + +```python +FLOWCHART_EXTRACT = (81, 'flowChartExtract', 'Extract flowchart symbol') +``` + +Extract flowchart symbol + +### `FLOWCHART_INTERNAL_STORAGE` + +```python +FLOWCHART_INTERNAL_STORAGE = (66, 'flowChartInternalStorage', 'Internal storage flowchart symbol') +``` + +Internal storage flowchart symbol + +### `FLOWCHART_MAGNETIC_DISK` + +```python +FLOWCHART_MAGNETIC_DISK = (86, 'flowChartMagneticDisk', 'Magnetic disk flowchart symbol') +``` + +Magnetic disk flowchart symbol + +### `FLOWCHART_MANUAL_INPUT` + +```python +FLOWCHART_MANUAL_INPUT = (71, 'flowChartManualInput', 'Manual input flowchart symbol') +``` + +Manual input flowchart symbol + +### `FLOWCHART_MANUAL_OPERATION` + +```python +FLOWCHART_MANUAL_OPERATION = (72, 'flowChartManualOperation', 'Manual operation flowchart symbol') +``` + +Manual operation flowchart symbol + +### `FLOWCHART_MERGE` + +```python +FLOWCHART_MERGE = (82, 'flowChartMerge', 'Merge flowchart symbol') +``` + +Merge flowchart symbol + +### `FLOWCHART_MULTIDOCUMENT` + +```python +FLOWCHART_MULTIDOCUMENT = (68, 'flowChartMultidocument', 'Multi-document flowchart symbol') +``` + +Multi-document flowchart symbol + +### `FLOWCHART_OFFLINE_STORAGE` + +```python +FLOWCHART_OFFLINE_STORAGE = (139, 'flowChartOfflineStorage', 'Offline Storage') +``` + +Offline Storage + +### `FLOWCHART_OFFPAGE_CONNECTOR` + +```python +FLOWCHART_OFFPAGE_CONNECTOR = (74, 'flowChartOffpageConnector', 'Off-page connector flowchart symbol') +``` + +Off-page connector flowchart symbol + +### `FLOWCHART_OR` + +```python +FLOWCHART_OR = (78, 'flowChartOr', '"Or" flowchart symbol') +``` + +"Or" flowchart symbol + +### `FLOWCHART_PREDEFINED_PROCESS` + +```python +FLOWCHART_PREDEFINED_PROCESS = (65, 'flowChartPredefinedProcess', 'Predefined process flowchart symbol') +``` + +Predefined process flowchart symbol + +### `FLOWCHART_PREPARATION` + +```python +FLOWCHART_PREPARATION = (70, 'flowChartPreparation', 'Preparation flowchart symbol') +``` + +Preparation flowchart symbol + +### `FLOWCHART_PROCESS` + +```python +FLOWCHART_PROCESS = (61, 'flowChartProcess', 'Process flowchart symbol') +``` + +Process flowchart symbol + +### `FLOWCHART_PUNCHED_TAPE` + +```python +FLOWCHART_PUNCHED_TAPE = (76, 'flowChartPunchedTape', 'Punched tape flowchart symbol') +``` + +Punched tape flowchart symbol + +### `FLOWCHART_SEQUENTIAL_ACCESS_STORAGE` + +```python +FLOWCHART_SEQUENTIAL_ACCESS_STORAGE = (85, 'flowChartMagneticTape', 'Sequential access storage flowchart symbol') +``` + +Sequential access storage flowchart symbol + +### `FLOWCHART_SORT` + +```python +FLOWCHART_SORT = (80, 'flowChartSort', 'Sort flowchart symbol') +``` + +Sort flowchart symbol + +### `FLOWCHART_STORED_DATA` + +```python +FLOWCHART_STORED_DATA = (83, 'flowChartOnlineStorage', 'Stored data flowchart symbol') +``` + +Stored data flowchart symbol + +### `FLOWCHART_SUMMING_JUNCTION` + +```python +FLOWCHART_SUMMING_JUNCTION = (77, 'flowChartSummingJunction', 'Summing junction flowchart symbol') +``` + +Summing junction flowchart symbol + +### `FLOWCHART_TERMINATOR` + +```python +FLOWCHART_TERMINATOR = (69, 'flowChartTerminator', 'Terminator flowchart symbol') +``` + +Terminator flowchart symbol + +### `FOLDED_CORNER` + +```python +FOLDED_CORNER = (16, 'foldedCorner', 'Folded corner') +``` + +Folded corner + +### `FRAME` + +```python +FRAME = (158, 'frame', 'Frame') +``` + +Frame + +### `FUNNEL` + +```python +FUNNEL = (174, 'funnel', 'Funnel') +``` + +Funnel + +### `GEAR_6` + +```python +GEAR_6 = (172, 'gear6', 'Gear 6') +``` + +Gear 6 + +### `GEAR_9` + +```python +GEAR_9 = (173, 'gear9', 'Gear 9') +``` + +Gear 9 + +### `HALF_FRAME` + +```python +HALF_FRAME = (159, 'halfFrame', 'Half Frame') +``` + +Half Frame + +### `HEART` + +```python +HEART = (21, 'heart', 'Heart') +``` + +Heart + +### `HEPTAGON` + +```python +HEPTAGON = (145, 'heptagon', 'Heptagon') +``` + +Heptagon + +### `HEXAGON` + +```python +HEXAGON = (10, 'hexagon', 'Hexagon') +``` + +Hexagon + +### `HORIZONTAL_SCROLL` + +```python +HORIZONTAL_SCROLL = (102, 'horizontalScroll', 'Horizontal scroll') +``` + +Horizontal scroll + +### `ISOSCELES_TRIANGLE` + +```python +ISOSCELES_TRIANGLE = (7, 'triangle', 'Isosceles triangle') +``` + +Isosceles triangle + +### `LEFT_ARROW` + +```python +LEFT_ARROW = (34, 'leftArrow', 'Block arrow that points left') +``` + +Block arrow that points left + +### `LEFT_ARROW_CALLOUT` + +```python +LEFT_ARROW_CALLOUT = (54, 'leftArrowCallout', 'Callout with arrow that points left') +``` + +Callout with arrow that points left + +### `LEFT_BRACE` + +```python +LEFT_BRACE = (31, 'leftBrace', 'Left brace') +``` + +Left brace + +### `LEFT_BRACKET` + +```python +LEFT_BRACKET = (29, 'leftBracket', 'Left bracket') +``` + +Left bracket + +### `LEFT_CIRCULAR_ARROW` + +```python +LEFT_CIRCULAR_ARROW = (176, 'leftCircularArrow', 'Left Circular Arrow') +``` + +Left Circular Arrow + +### `LEFT_RIGHT_ARROW` + +```python +LEFT_RIGHT_ARROW = (37, 'leftRightArrow', 'Block arrow with arrowheads that point both left and right') +``` + +Block arrow with arrowheads that point both left and right + +### `LEFT_RIGHT_ARROW_CALLOUT` + +```python +LEFT_RIGHT_ARROW_CALLOUT = (57, 'leftRightArrowCallout', 'Callout with arrowheads that point both left and right') +``` + +Callout with arrowheads that point both left and right + +### `LEFT_RIGHT_CIRCULAR_ARROW` + +```python +LEFT_RIGHT_CIRCULAR_ARROW = (177, 'leftRightCircularArrow', 'Left Right Circular Arrow') +``` + +Left Right Circular Arrow + +### `LEFT_RIGHT_RIBBON` + +```python +LEFT_RIGHT_RIBBON = (140, 'leftRightRibbon', 'Left Right Ribbon') +``` + +Left Right Ribbon + +### `LEFT_RIGHT_UP_ARROW` + +```python +LEFT_RIGHT_UP_ARROW = (40, 'leftRightUpArrow', 'Block arrow with arrowheads that point left, right, and up') +``` + +Block arrow with arrowheads that point left, right, and up + +### `LEFT_UP_ARROW` + +```python +LEFT_UP_ARROW = (43, 'leftUpArrow', 'Block arrow with arrowheads that point left and up') +``` + +Block arrow with arrowheads that point left and up + +### `LIGHTNING_BOLT` + +```python +LIGHTNING_BOLT = (22, 'lightningBolt', 'Lightning bolt') +``` + +Lightning bolt + +### `LINE_CALLOUT_1` + +```python +LINE_CALLOUT_1 = (109, 'borderCallout1', 'Callout with border and horizontal callout line') +``` + +Callout with border and horizontal callout line + +### `LINE_CALLOUT_1_ACCENT_BAR` + +```python +LINE_CALLOUT_1_ACCENT_BAR = (113, 'accentCallout1', 'Callout with vertical accent bar') +``` + +Callout with vertical accent bar + +### `LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR` + +```python +LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR = (121, 'accentBorderCallout1', 'Callout with border and vertical accent bar') +``` + +Callout with border and vertical accent bar + +### `LINE_CALLOUT_1_NO_BORDER` + +```python +LINE_CALLOUT_1_NO_BORDER = (117, 'callout1', 'Callout with horizontal line') +``` + +Callout with horizontal line + +### `LINE_CALLOUT_2` + +```python +LINE_CALLOUT_2 = (110, 'borderCallout2', 'Callout with diagonal straight line') +``` + +Callout with diagonal straight line + +### `LINE_CALLOUT_2_ACCENT_BAR` + +```python +LINE_CALLOUT_2_ACCENT_BAR = (114, 'accentCallout2', 'Callout with diagonal callout line and accent bar') +``` + +Callout with diagonal callout line and accent bar + +### `LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR` + +```python +LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR = (122, 'accentBorderCallout2', 'Callout with border, diagonal straight line, and accent bar') +``` + +Callout with border, diagonal straight line, and accent bar + +### `LINE_CALLOUT_2_NO_BORDER` + +```python +LINE_CALLOUT_2_NO_BORDER = (118, 'callout2', 'Callout with no border and diagonal callout line') +``` + +Callout with no border and diagonal callout line + +### `LINE_CALLOUT_3` + +```python +LINE_CALLOUT_3 = (111, 'borderCallout3', 'Callout with angled line') +``` + +Callout with angled line + +### `LINE_CALLOUT_3_ACCENT_BAR` + +```python +LINE_CALLOUT_3_ACCENT_BAR = (115, 'accentCallout3', 'Callout with angled callout line and accent bar') +``` + +Callout with angled callout line and accent bar + +### `LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR` + +```python +LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR = (123, 'accentBorderCallout3', 'Callout with border, angled callout line, and accent bar') +``` + +Callout with border, angled callout line, and accent bar + +### `LINE_CALLOUT_3_NO_BORDER` + +```python +LINE_CALLOUT_3_NO_BORDER = (119, 'callout3', 'Callout with no border and angled callout line') +``` + +Callout with no border and angled callout line + +### `LINE_CALLOUT_4` + +```python +LINE_CALLOUT_4 = (112, 'borderCallout3', 'Callout with callout line segments forming a U-shape.') +``` + +Callout with callout line segments forming a U-shape. + +### `LINE_CALLOUT_4_ACCENT_BAR` + +```python +LINE_CALLOUT_4_ACCENT_BAR = (116, 'accentCallout3', 'Callout with accent bar and callout line segments forming a U-shape.') +``` + +Callout with accent bar and callout line segments forming a U-shape. + +### `LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR` + +```python +LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR = (124, 'accentBorderCallout3', 'Callout with border, accent bar, and callout line segments forming a U-shape.') +``` + +Callout with border, accent bar, and callout line segments forming a U-shape. + +### `LINE_CALLOUT_4_NO_BORDER` + +```python +LINE_CALLOUT_4_NO_BORDER = (120, 'callout3', 'Callout with no border and callout line segments forming a U-shape.') +``` + +Callout with no border and callout line segments forming a U-shape. + +### `LINE_INVERSE` + +```python +LINE_INVERSE = (183, 'lineInv', 'Straight Connector') +``` + +Straight Connector + +### `MATH_DIVIDE` + +```python +MATH_DIVIDE = (166, 'mathDivide', 'Division') +``` + +Division + +### `MATH_EQUAL` + +```python +MATH_EQUAL = (167, 'mathEqual', 'Equal') +``` + +Equal + +### `MATH_MINUS` + +```python +MATH_MINUS = (164, 'mathMinus', 'Minus') +``` + +Minus + +### `MATH_MULTIPLY` + +```python +MATH_MULTIPLY = (165, 'mathMultiply', 'Multiply') +``` + +Multiply + +### `MATH_NOT_EQUAL` + +```python +MATH_NOT_EQUAL = (168, 'mathNotEqual', 'Not Equal') +``` + +Not Equal + +### `MATH_PLUS` + +```python +MATH_PLUS = (163, 'mathPlus', 'Plus') +``` + +Plus + +### `MOON` + +```python +MOON = (24, 'moon', 'Moon') +``` + +Moon + +### `NON_ISOSCELES_TRAPEZOID` + +```python +NON_ISOSCELES_TRAPEZOID = (143, 'nonIsoscelesTrapezoid', 'Non-isosceles Trapezoid') +``` + +Non-isosceles Trapezoid + +### `NOTCHED_RIGHT_ARROW` + +```python +NOTCHED_RIGHT_ARROW = (50, 'notchedRightArrow', 'Notched block arrow that points right') +``` + +Notched block arrow that points right + +### `NO_SYMBOL` + +```python +NO_SYMBOL = (19, 'noSmoking', "'No' Symbol") +``` + +'No' Symbol + +### `OCTAGON` + +```python +OCTAGON = (6, 'octagon', 'Octagon') +``` + +Octagon + +### `OVAL` + +```python +OVAL = (9, 'ellipse', 'Oval') +``` + +Oval + +### `OVAL_CALLOUT` + +```python +OVAL_CALLOUT = (107, 'wedgeEllipseCallout', 'Oval-shaped callout') +``` + +Oval-shaped callout + +### `PARALLELOGRAM` + +```python +PARALLELOGRAM = (2, 'parallelogram', 'Parallelogram') +``` + +Parallelogram + +### `PENTAGON` + +```python +PENTAGON = (51, 'homePlate', 'Pentagon') +``` + +Pentagon + +### `PIE` + +```python +PIE = (142, 'pie', 'Pie') +``` + +Pie + +### `PIE_WEDGE` + +```python +PIE_WEDGE = (175, 'pieWedge', 'Pie') +``` + +Pie + +### `PLAQUE` + +```python +PLAQUE = (28, 'plaque', 'Plaque') +``` + +Plaque + +### `PLAQUE_TABS` + +```python +PLAQUE_TABS = (171, 'plaqueTabs', 'Plaque Tabs') +``` + +Plaque Tabs + +### `QUAD_ARROW` + +```python +QUAD_ARROW = (39, 'quadArrow', 'Block arrows that point up, down, left, and right') +``` + +Block arrows that point up, down, left, and right + +### `QUAD_ARROW_CALLOUT` + +```python +QUAD_ARROW_CALLOUT = (59, 'quadArrowCallout', 'Callout with arrows that point up, down, left, and right') +``` + +Callout with arrows that point up, down, left, and right + +### `RECTANGLE` + +```python +RECTANGLE = (1, 'rect', 'Rectangle') +``` + +Rectangle + +### `RECTANGULAR_CALLOUT` + +```python +RECTANGULAR_CALLOUT = (105, 'wedgeRectCallout', 'Rectangular callout') +``` + +Rectangular callout + +### `REGULAR_PENTAGON` + +```python +REGULAR_PENTAGON = (12, 'pentagon', 'Pentagon') +``` + +Pentagon + +### `RIGHT_ARROW` + +```python +RIGHT_ARROW = (33, 'rightArrow', 'Block arrow that points right') +``` + +Block arrow that points right + +### `RIGHT_ARROW_CALLOUT` + +```python +RIGHT_ARROW_CALLOUT = (53, 'rightArrowCallout', 'Callout with arrow that points right') +``` + +Callout with arrow that points right + +### `RIGHT_BRACE` + +```python +RIGHT_BRACE = (32, 'rightBrace', 'Right brace') +``` + +Right brace + +### `RIGHT_BRACKET` + +```python +RIGHT_BRACKET = (30, 'rightBracket', 'Right bracket') +``` + +Right bracket + +### `RIGHT_TRIANGLE` + +```python +RIGHT_TRIANGLE = (8, 'rtTriangle', 'Right triangle') +``` + +Right triangle + +### `ROUNDED_RECTANGLE` + +```python +ROUNDED_RECTANGLE = (5, 'roundRect', 'Rounded rectangle') +``` + +Rounded rectangle + +### `ROUNDED_RECTANGULAR_CALLOUT` + +```python +ROUNDED_RECTANGULAR_CALLOUT = (106, 'wedgeRoundRectCallout', 'Rounded rectangle-shaped callout') +``` + +Rounded rectangle-shaped callout + +### `ROUND_1_RECTANGLE` + +```python +ROUND_1_RECTANGLE = (151, 'round1Rect', 'Round Single Corner Rectangle') +``` + +Round Single Corner Rectangle + +### `ROUND_2_DIAG_RECTANGLE` + +```python +ROUND_2_DIAG_RECTANGLE = (153, 'round2DiagRect', 'Round Diagonal Corner Rectangle') +``` + +Round Diagonal Corner Rectangle + +### `ROUND_2_SAME_RECTANGLE` + +```python +ROUND_2_SAME_RECTANGLE = (152, 'round2SameRect', 'Round Same Side Corner Rectangle') +``` + +Round Same Side Corner Rectangle + +### `SMILEY_FACE` + +```python +SMILEY_FACE = (17, 'smileyFace', 'Smiley face') +``` + +Smiley face + +### `SNIP_1_RECTANGLE` + +```python +SNIP_1_RECTANGLE = (155, 'snip1Rect', 'Snip Single Corner Rectangle') +``` + +Snip Single Corner Rectangle + +### `SNIP_2_DIAG_RECTANGLE` + +```python +SNIP_2_DIAG_RECTANGLE = (157, 'snip2DiagRect', 'Snip Diagonal Corner Rectangle') +``` + +Snip Diagonal Corner Rectangle + +### `SNIP_2_SAME_RECTANGLE` + +```python +SNIP_2_SAME_RECTANGLE = (156, 'snip2SameRect', 'Snip Same Side Corner Rectangle') +``` + +Snip Same Side Corner Rectangle + +### `SNIP_ROUND_RECTANGLE` + +```python +SNIP_ROUND_RECTANGLE = (154, 'snipRoundRect', 'Snip and Round Single Corner Rectangle') +``` + +Snip and Round Single Corner Rectangle + +### `SQUARE_TABS` + +```python +SQUARE_TABS = (170, 'squareTabs', 'Square Tabs') +``` + +Square Tabs + +### `STAR_10_POINT` + +```python +STAR_10_POINT = (149, 'star10', '10-Point Star') +``` + +10-Point Star + +### `STAR_12_POINT` + +```python +STAR_12_POINT = (150, 'star12', '12-Point Star') +``` + +12-Point Star + +### `STAR_16_POINT` + +```python +STAR_16_POINT = (94, 'star16', '16-point star') +``` + +16-point star + +### `STAR_24_POINT` + +```python +STAR_24_POINT = (95, 'star24', '24-point star') +``` + +24-point star + +### `STAR_32_POINT` + +```python +STAR_32_POINT = (96, 'star32', '32-point star') +``` + +32-point star + +### `STAR_4_POINT` + +```python +STAR_4_POINT = (91, 'star4', '4-point star') +``` + +4-point star + +### `STAR_5_POINT` + +```python +STAR_5_POINT = (92, 'star5', '5-point star') +``` + +5-point star + +### `STAR_6_POINT` + +```python +STAR_6_POINT = (147, 'star6', '6-Point Star') +``` + +6-Point Star + +### `STAR_7_POINT` + +```python +STAR_7_POINT = (148, 'star7', '7-Point Star') +``` + +7-Point Star + +### `STAR_8_POINT` + +```python +STAR_8_POINT = (93, 'star8', '8-point star') +``` + +8-point star + +### `STRIPED_RIGHT_ARROW` + +```python +STRIPED_RIGHT_ARROW = (49, 'stripedRightArrow', 'Block arrow that points right with stripes at the tail') +``` + +Block arrow that points right with stripes at the tail + +### `SUN` + +```python +SUN = (23, 'sun', 'Sun') +``` + +Sun + +### `SWOOSH_ARROW` + +```python +SWOOSH_ARROW = (178, 'swooshArrow', 'Swoosh Arrow') +``` + +Swoosh Arrow + +### `TEAR` + +```python +TEAR = (160, 'teardrop', 'Teardrop') +``` + +Teardrop + +### `TRAPEZOID` + +```python +TRAPEZOID = (3, 'trapezoid', 'Trapezoid') +``` + +Trapezoid + +### `UP_ARROW` + +```python +UP_ARROW = (35, 'upArrow', 'Block arrow that points up') +``` + +Block arrow that points up + +### `UP_ARROW_CALLOUT` + +```python +UP_ARROW_CALLOUT = (55, 'upArrowCallout', 'Callout with arrow that points up') +``` + +Callout with arrow that points up + +### `UP_DOWN_ARROW` + +```python +UP_DOWN_ARROW = (38, 'upDownArrow', 'Block arrow that points up and down') +``` + +Block arrow that points up and down + +### `UP_DOWN_ARROW_CALLOUT` + +```python +UP_DOWN_ARROW_CALLOUT = (58, 'upDownArrowCallout', 'Callout with arrows that point up and down') +``` + +Callout with arrows that point up and down + +### `UP_RIBBON` + +```python +UP_RIBBON = (97, 'ribbon2', 'Ribbon banner with center area above ribbon ends') +``` + +Ribbon banner with center area above ribbon ends + +### `U_TURN_ARROW` + +```python +U_TURN_ARROW = (42, 'uturnArrow', 'Block arrow forming a U shape') +``` + +Block arrow forming a U shape + +### `VERTICAL_SCROLL` + +```python +VERTICAL_SCROLL = (101, 'verticalScroll', 'Vertical scroll') +``` + +Vertical scroll + +### `WAVE` + +```python +WAVE = (103, 'wave', 'Wave') +``` + +Wave + +## `MSO_CONNECTOR` + +```python +MSO_CONNECTOR = MSO_CONNECTOR_TYPE +``` + +## `MSO_CONNECTOR_TYPE` + +Bases: `BaseXmlEnum` + +Specifies a type of connector. + +Alias: ``MSO_CONNECTOR`` + +Example:: + + from pptx.enum.shapes import MSO_CONNECTOR + from pptx.util import Cm + + shapes = prs.slides[0].shapes + connector = shapes.add_connector( + MSO_CONNECTOR.STRAIGHT, Cm(2), Cm(2), Cm(10), Cm(10) + ) + assert connector.left.cm == 2 + +MS API Name: `MsoConnectorType` + +http://msdn.microsoft.com/en-us/library/office/ff860918.aspx + +### `CURVE` + +```python +CURVE = (3, 'curvedConnector3', 'Curved connector.') +``` + +Curved connector. + +### `ELBOW` + +```python +ELBOW = (2, 'bentConnector3', 'Elbow connector.') +``` + +Elbow connector. + +### `MIXED` + +```python +MIXED = (-2, '', 'Return value only; indicates a combination of other states.') +``` + +Return value only; indicates a combination of other states. + +### `STRAIGHT` + +```python +STRAIGHT = (1, 'line', 'Straight line connector.') +``` + +Straight line connector. + +## `MSO_SHAPE` + +```python +MSO_SHAPE = MSO_AUTO_SHAPE_TYPE +``` + +## `MSO_SHAPE_TYPE` + +Bases: `BaseEnum` + +Specifies the type of a shape, more specifically than the five base types. + +Alias: ``MSO`` + +Example:: + + from pptx.enum.shapes import MSO_SHAPE_TYPE + + assert shape.type == MSO_SHAPE_TYPE.PICTURE + +MS API Name: `MsoShapeType` + +http://msdn.microsoft.com/en-us/library/office/ff860759(v=office.15).aspx + +### `AUTO_SHAPE` + +```python +AUTO_SHAPE = (1, 'AutoShape') +``` + +AutoShape + +### `CALLOUT` + +```python +CALLOUT = (2, 'Callout shape') +``` + +Callout shape + +### `CANVAS` + +```python +CANVAS = (20, 'Drawing canvas') +``` + +Drawing canvas + +### `CHART` + +```python +CHART = (3, 'Chart, e.g. pie chart, bar chart') +``` + +Chart, e.g. pie chart, bar chart + +### `COMMENT` + +```python +COMMENT = (4, 'Comment') +``` + +Comment + +### `DIAGRAM` + +```python +DIAGRAM = (21, 'Diagram') +``` + +Diagram + +### `EMBEDDED_OLE_OBJECT` + +```python +EMBEDDED_OLE_OBJECT = (7, 'Embedded OLE object') +``` + +Embedded OLE object + +### `FORM_CONTROL` + +```python +FORM_CONTROL = (8, 'Form control') +``` + +Form control + +### `FREEFORM` + +```python +FREEFORM = (5, 'Freeform') +``` + +Freeform + +### `GROUP` + +```python +GROUP = (6, 'Group shape') +``` + +Group shape + +### `IGX_GRAPHIC` + +```python +IGX_GRAPHIC = (24, 'SmartArt graphic') +``` + +SmartArt graphic + +### `INK` + +```python +INK = (22, 'Ink') +``` + +Ink + +### `INK_COMMENT` + +```python +INK_COMMENT = (23, 'Ink Comment') +``` + +Ink Comment + +### `LINE` + +```python +LINE = (9, 'Line') +``` + +Line + +### `LINKED_OLE_OBJECT` + +```python +LINKED_OLE_OBJECT = (10, 'Linked OLE object') +``` + +Linked OLE object + +### `LINKED_PICTURE` + +```python +LINKED_PICTURE = (11, 'Linked picture') +``` + +Linked picture + +### `MEDIA` + +```python +MEDIA = (16, 'Media') +``` + +Media + +### `MIXED` + +```python +MIXED = (-2, 'Multiple shape types (read-only).') +``` + +Multiple shape types (read-only). + +### `OLE_CONTROL_OBJECT` + +```python +OLE_CONTROL_OBJECT = (12, 'OLE control object') +``` + +OLE control object + +### `PICTURE` + +```python +PICTURE = (13, 'Picture') +``` + +Picture + +### `PLACEHOLDER` + +```python +PLACEHOLDER = (14, 'Placeholder') +``` + +Placeholder + +### `SCRIPT_ANCHOR` + +```python +SCRIPT_ANCHOR = (18, 'Script anchor') +``` + +Script anchor + +### `TABLE` + +```python +TABLE = (19, 'Table') +``` + +Table + +### `TEXT_BOX` + +```python +TEXT_BOX = (17, 'Text box') +``` + +Text box + +### `TEXT_EFFECT` + +```python +TEXT_EFFECT = (15, 'Text effect') +``` + +Text effect + +### `WEB_VIDEO` + +```python +WEB_VIDEO = (26, 'Web video') +``` + +Web video + +## `PP_MEDIA_TYPE` + +Bases: `BaseEnum` + +Indicates the OLE media type. + +Example:: + + from pptx.enum.shapes import PP_MEDIA_TYPE + + movie = slide.shapes[0] + assert movie.media_type == PP_MEDIA_TYPE.MOVIE + +MS API Name: `PpMediaType` + +https://msdn.microsoft.com/en-us/library/office/ff746008.aspx + +### `MIXED` + +```python +MIXED = (-2, 'Return value only; indicates multiple media types, typically for a collection of shapes. May not be applicable in python-pptx.') +``` + +Return value only; indicates multiple media types. + +Typically for a collection of shapes. May not be applicable in python-pptx. + +### `MOVIE` + +```python +MOVIE = (3, 'Video media such as MP4.') +``` + +Video media such as MP4. + +### `OTHER` + +```python +OTHER = (1, 'Other media types') +``` + +Other media types + +### `SOUND` + +```python +SOUND = (1, 'Audio media such as MP3.') +``` + +Audio media such as MP3. + +## `PP_PLACEHOLDER` + +```python +PP_PLACEHOLDER = PP_PLACEHOLDER_TYPE +``` + +## `PP_PLACEHOLDER_TYPE` + +Bases: `BaseXmlEnum` + +Specifies one of the 18 distinct types of placeholder. + +Alias: ``PP_PLACEHOLDER`` + +Example:: + + from pptx.enum.shapes import PP_PLACEHOLDER + + placeholder = slide.placeholders[0] + assert placeholder.type == PP_PLACEHOLDER.TITLE + +MS API name: `PpPlaceholderType` + +http://msdn.microsoft.com/en-us/library/office/ff860759(v=office.15 ").aspx" + +### `BITMAP` + +```python +BITMAP = (9, 'clipArt', 'Clip art placeholder') +``` + +Clip art placeholder + +### `BODY` + +```python +BODY = (2, 'body', 'Body') +``` + +Body + +### `CENTER_TITLE` + +```python +CENTER_TITLE = (3, 'ctrTitle', 'Center Title') +``` + +Center Title + +### `CHART` + +```python +CHART = (8, 'chart', 'Chart') +``` + +Chart + +### `DATE` + +```python +DATE = (16, 'dt', 'Date') +``` + +Date + +### `FOOTER` + +```python +FOOTER = (15, 'ftr', 'Footer') +``` + +Footer + +### `HEADER` + +```python +HEADER = (14, 'hdr', 'Header') +``` + +Header + +### `MEDIA_CLIP` + +```python +MEDIA_CLIP = (10, 'media', 'Media Clip') +``` + +Media Clip + +### `MIXED` + +```python +MIXED = (-2, '', 'Return value only; multiple placeholders of differing types.') +``` + +Return value only; multiple placeholders of differing types. + +### `OBJECT` + +```python +OBJECT = (7, 'obj', 'Object') +``` + +Object + +### `ORG_CHART` + +```python +ORG_CHART = (11, 'dgm', 'SmartArt placeholder. Organization chart is a legacy name.') +``` + +SmartArt placeholder. Organization chart is a legacy name. + +### `PICTURE` + +```python +PICTURE = (18, 'pic', 'Picture') +``` + +Picture + +### `SLIDE_IMAGE` + +```python +SLIDE_IMAGE = (101, 'sldImg', 'Slide Image') +``` + +Slide Image + +### `SLIDE_NUMBER` + +```python +SLIDE_NUMBER = (13, 'sldNum', 'Slide Number') +``` + +Slide Number + +### `SUBTITLE` + +```python +SUBTITLE = (4, 'subTitle', 'Subtitle') +``` + +Subtitle + +### `TABLE` + +```python +TABLE = (12, 'tbl', 'Table') +``` + +Table + +### `TITLE` + +```python +TITLE = (1, 'title', 'Title') +``` + +Title + +### `VERTICAL_BODY` + +```python +VERTICAL_BODY = (6, '', 'Vertical Body (read-only).') +``` + +Vertical Body (read-only). + +### `VERTICAL_OBJECT` + +```python +VERTICAL_OBJECT = (17, '', 'Vertical Object (read-only).') +``` + +Vertical Object (read-only). + +### `VERTICAL_TITLE` + +```python +VERTICAL_TITLE = (5, '', 'Vertical Title (read-only).') +``` + +Vertical Title (read-only). + +## `PROG_ID` + +Bases: `Enum` + +One-off Enum-like object for progId values. + +Indicates the type of an OLE object in terms of the program used to open it. + +A member of this enumeration can be used in a `SlideShapes.add_ole_object()` call to +specify a Microsoft Office file-type (Excel, PowerPoint, or Word), which will +then not require several of the arguments required to embed other object types. + +Example:: + + from pptx.enum.shapes import PROG_ID + from pptx.util import Inches + + embedded_xlsx_shape = slide.shapes.add_ole_object( + "workbook.xlsx", PROG_ID.XLSX, left=Inches(1), top=Inches(1) + ) + assert embedded_xlsx_shape.ole_format.prog_id == "Excel.Sheet.12" + +### `DOCX` + +```python +DOCX = ('DOCX', 'Word.Document.12', 'docx-icon.emf', 965200, 609600) +``` + +`progId` for an embedded Word 2007+ (.docx) document. + +### `PPTX` + +```python +PPTX = ('PPTX', 'PowerPoint.Show.12', 'pptx-icon.emf', 965200, 609600) +``` + +`progId` for an embedded PowerPoint 2007+ (.pptx) document. + +### `XLSX` + +```python +XLSX = ('XLSX', 'Excel.Sheet.12', 'xlsx-icon.emf', 965200, 609600) +``` + +`progId` for an embedded Excel 2007+ (.xlsx) document. + +### `height` + +```python +height +``` + +### `icon_filename` + +```python +icon_filename +``` + +### `progId` + +```python +progId +``` + +### `width` + +```python +width +``` + + + + + +# `pptx.enum.text` + +Enumerations used by text and related objects. + +## `MSO_ANCHOR` + +```python +MSO_ANCHOR = MSO_VERTICAL_ANCHOR +``` + +## `MSO_AUTO_SIZE` + +Bases: `BaseEnum` + +Determines the type of automatic sizing allowed. + +The following names can be used to specify the automatic sizing behavior used to fit a shape's +text within the shape bounding box, for example:: + + from pptx.enum.text import MSO_AUTO_SIZE + + shape.text_frame.auto_size = MSO_AUTO_SIZE.TEXT_TO_FIT_SHAPE + +The word-wrap setting of the text frame interacts with the auto-size setting to determine the +specific auto-sizing behavior. + +Note that `TextFrame.auto_size` can also be set to `None`, which removes the auto size setting +altogether. This causes the setting to be inherited, either from the layout placeholder, in the +case of a placeholder shape, or from the theme. + +MS API Name: `MsoAutoSize` + +http://msdn.microsoft.com/en-us/library/office/ff865367(v=office.15).aspx + +### `MIXED` + +```python +MIXED = (-2, 'Return value only; indicates a combination of automatic sizing schemes are used.') +``` + +Return value only; indicates a combination of automatic sizing schemes are used. + +### `NONE` + +```python +NONE = (0, 'No automatic sizing of the shape or text will be done.\n\nText can freely extend beyond the horizontal and vertical edges of the shape bounding box.') +``` + +No automatic sizing of the shape or text will be done. + +Text can freely extend beyond the horizontal and vertical edges of the shape bounding box. + +### `SHAPE_TO_FIT_TEXT` + +```python +SHAPE_TO_FIT_TEXT = (1, 'The shape height and possibly width are adjusted to fit the text.\n\nNote this setting interacts with the TextFrame.word_wrap property setting. If word wrap is turned on, only the height of the shape will be adjusted; soft line breaks will be used to fit the text horizontally.') +``` + +The shape height and possibly width are adjusted to fit the text. + +Note this setting interacts with the TextFrame.word_wrap property setting. If word wrap is +turned on, only the height of the shape will be adjusted; soft line breaks will be used to fit +the text horizontally. + +### `TEXT_TO_FIT_SHAPE` + +```python +TEXT_TO_FIT_SHAPE = (2, 'The font size is reduced as necessary to fit the text within the shape.') +``` + +The font size is reduced as necessary to fit the text within the shape. + +## `MSO_TEXT_UNDERLINE_TYPE` + +Bases: `BaseXmlEnum` + +Indicates the type of underline for text. Used with +`.Font.underline` to specify the style of text underlining. + +Alias: ``MSO_UNDERLINE`` + +Example:: + + from pptx.enum.text import MSO_UNDERLINE + + run.font.underline = MSO_UNDERLINE.DOUBLE_LINE + +MS API Name: `MsoTextUnderlineType` + +http://msdn.microsoft.com/en-us/library/aa432699.aspx + +### `DASH_HEAVY_LINE` + +```python +DASH_HEAVY_LINE = (8, 'dashHeavy', 'Specifies a dash underline.') +``` + +Specifies a dash underline. + +### `DASH_LINE` + +```python +DASH_LINE = (7, 'dash', 'Specifies a dash line underline.') +``` + +Specifies a dash line underline. + +### `DASH_LONG_HEAVY_LINE` + +```python +DASH_LONG_HEAVY_LINE = (10, 'dashLongHeavy', 'Specifies a long heavy line underline.') +``` + +Specifies a long heavy line underline. + +### `DASH_LONG_LINE` + +```python +DASH_LONG_LINE = (9, 'dashLong', 'Specifies a dashed long line underline.') +``` + +Specifies a dashed long line underline. + +### `DOTTED_HEAVY_LINE` + +```python +DOTTED_HEAVY_LINE = (6, 'dottedHeavy', 'Specifies a dotted heavy line underline.') +``` + +Specifies a dotted heavy line underline. + +### `DOTTED_LINE` + +```python +DOTTED_LINE = (5, 'dotted', 'Specifies a dotted line underline.') +``` + +Specifies a dotted line underline. + +### `DOT_DASH_HEAVY_LINE` + +```python +DOT_DASH_HEAVY_LINE = (12, 'dotDashHeavy', 'Specifies a dot dash heavy line underline.') +``` + +Specifies a dot dash heavy line underline. + +### `DOT_DASH_LINE` + +```python +DOT_DASH_LINE = (11, 'dotDash', 'Specifies a dot dash line underline.') +``` + +Specifies a dot dash line underline. + +### `DOT_DOT_DASH_HEAVY_LINE` + +```python +DOT_DOT_DASH_HEAVY_LINE = (14, 'dotDotDashHeavy', 'Specifies a dot dot dash heavy line underline.') +``` + +Specifies a dot dot dash heavy line underline. + +### `DOT_DOT_DASH_LINE` + +```python +DOT_DOT_DASH_LINE = (13, 'dotDotDash', 'Specifies a dot dot dash line underline.') +``` + +Specifies a dot dot dash line underline. + +### `DOUBLE_LINE` + +```python +DOUBLE_LINE = (3, 'dbl', 'Specifies a double line underline.') +``` + +Specifies a double line underline. + +### `HEAVY_LINE` + +```python +HEAVY_LINE = (4, 'heavy', 'Specifies a heavy line underline.') +``` + +Specifies a heavy line underline. + +### `MIXED` + +```python +MIXED = (-2, '', 'Specifies a mix of underline types (read-only).') +``` + +Specifies a mix of underline types (read-only). + +### `NONE` + +```python +NONE = (0, 'none', 'Specifies no underline.') +``` + +Specifies no underline. + +### `SINGLE_LINE` + +```python +SINGLE_LINE = (2, 'sng', 'Specifies a single line underline.') +``` + +Specifies a single line underline. + +### `WAVY_DOUBLE_LINE` + +```python +WAVY_DOUBLE_LINE = (17, 'wavyDbl', 'Specifies a wavy double line underline.') +``` + +Specifies a wavy double line underline. + +### `WAVY_HEAVY_LINE` + +```python +WAVY_HEAVY_LINE = (16, 'wavyHeavy', 'Specifies a wavy heavy line underline.') +``` + +Specifies a wavy heavy line underline. + +### `WAVY_LINE` + +```python +WAVY_LINE = (15, 'wavy', 'Specifies a wavy line underline.') +``` + +Specifies a wavy line underline. + +### `WORDS` + +```python +WORDS = (1, 'words', 'Specifies underlining words.') +``` + +Specifies underlining words. + +## `MSO_UNDERLINE` + +```python +MSO_UNDERLINE = MSO_TEXT_UNDERLINE_TYPE +``` + +## `MSO_VERTICAL_ANCHOR` + +Bases: `BaseXmlEnum` + +Specifies the vertical alignment of text in a text frame. + +Used with the `.vertical_anchor` property of the `TextFrame` object. Note that the +`vertical_anchor` property can also have the value None, indicating there is no directly +specified vertical anchor setting and its effective value is inherited from its placeholder if +it has one or from the theme. `None` may also be assigned to remove an explicitly specified +vertical anchor setting. + +MS API Name: `MsoVerticalAnchor` + +http://msdn.microsoft.com/en-us/library/office/ff865255.aspx + +### `BOTTOM` + +```python +BOTTOM = (4, 'b', 'Aligns text to bottom of text frame') +``` + +Aligns text to bottom of text frame + +### `MIDDLE` + +```python +MIDDLE = (3, 'ctr', 'Centers text vertically') +``` + +Centers text vertically + +### `MIXED` + +```python +MIXED = (-2, '', 'Return value only; indicates a combination of the other states.') +``` + +Return value only; indicates a combination of the other states. + +### `TOP` + +```python +TOP = (1, 't', 'Aligns text to top of text frame') +``` + +Aligns text to top of text frame + +## `PP_ALIGN` + +```python +PP_ALIGN = PP_PARAGRAPH_ALIGNMENT +``` + +## `PP_BULLET_TYPE` + +Bases: `BaseEnum` + +Kind of bullet explicitly set on a paragraph's own properties (paper-pptx addition). + +Reported by `paragraph.bullet.type`. Reflects local `a:pPr` state only: a paragraph whose +bullet rendering is inherited from the placeholder/list-style chain reports `None`, not a +member of this enumeration. + +Example:: + + from pptx.enum.text import PP_BULLET_TYPE + + paragraph.bullet.set_character() + assert paragraph.bullet.type == PP_BULLET_TYPE.CHARACTER + +### `CHARACTER` + +```python +CHARACTER = (1, "Character bullet (`a:buChar`), e.g. the classic '•'.") +``` + +Character bullet (`a:buChar`), e.g. the classic '•'. + +### `NONE` + +```python +NONE = (0, "Explicit 'no bullet' (`a:buNone`), overriding any inherited bullet.") +``` + +Explicit 'no bullet' (`a:buNone`), overriding any inherited bullet. + +### `NUMBERED` + +```python +NUMBERED = (2, 'Automatic numbering (`a:buAutoNum`).') +``` + +Automatic numbering (`a:buAutoNum`). + +### `PICTURE` + +```python +PICTURE = (3, 'Picture bullet (`a:buBlip`). Recognized on read; not writable in v0.') +``` + +Picture bullet (`a:buBlip`). Recognized on read; not writable in v0. + +## `PP_PARAGRAPH_ALIGNMENT` + +Bases: `BaseXmlEnum` + +Specifies the horizontal alignment for one or more paragraphs. + +Alias: `PP_ALIGN` + +Example:: + + from pptx.enum.text import PP_ALIGN + + shape.paragraphs[0].alignment = PP_ALIGN.CENTER + +MS API Name: `PpParagraphAlignment` + +http://msdn.microsoft.com/en-us/library/office/ff745375(v=office.15).aspx + +### `CENTER` + +```python +CENTER = (2, 'ctr', 'Center align') +``` + +Center align + +### `DISTRIBUTE` + +```python +DISTRIBUTE = (5, 'dist', 'Evenly distributes e.g. Japanese characters from left to right within a line') +``` + +Evenly distributes e.g. Japanese characters from left to right within a line + +### `JUSTIFY` + +```python +JUSTIFY = (4, 'just', 'Justified, i.e. each line both begins and ends at the margin.\n\nSpacing between words is adjusted such that the line exactly fills the width of the paragraph.') +``` + +Justified, i.e. each line both begins and ends at the margin. + +Spacing between words is adjusted such that the line exactly fills the width of the paragraph. + +### `JUSTIFY_LOW` + +```python +JUSTIFY_LOW = (7, 'justLow', 'Justify using a small amount of space between words.') +``` + +Justify using a small amount of space between words. + +### `LEFT` + +```python +LEFT = (1, 'l', 'Left aligned') +``` + +Left aligned + +### `MIXED` + +```python +MIXED = (-2, '', 'Multiple alignments are present in a set of paragraphs (read-only).') +``` + +Multiple alignments are present in a set of paragraphs (read-only). + +### `RIGHT` + +```python +RIGHT = (3, 'r', 'Right aligned') +``` + +Right aligned + +### `THAI_DISTRIBUTE` + +```python +THAI_DISTRIBUTE = (6, 'thaiDist', 'Thai distributed') +``` + +Thai distributed + + + + + +# `pptx.errors` + +Typed safe-refusal exceptions for paper-pptx APIs. + +## `AmbiguousTargetError` + +Bases: `PaperRefusal` + +The addressing given matches more than one target; refusing to pick one. + +## `BoundaryViolationError` + +Bases: `PaperRefusal` + +An operation ran outside the scope where it is safe. + +Today that means one thing: saving while a `batch()` block is open on the package. Those edits +are not validated yet and may still roll back, so save after the block closes. + +## `PackageLimitError` + +Bases: `PaperRefusal` + +The package archive has no single unambiguous reading, or is unsafe to expand. + +Raised reading a package (ambiguous ZIP end records, duplicate or overlapping members, +encryption, malformed `[Content_Types].xml`) and writing one (parts that would collide on a +single ZIP member name). + +## `PaperRefusal` + +Bases: `Exception` + +Base class for all safe refusals raised by paper-pptx APIs. + +## `RelationshipPolicyError` + +Bases: `PaperRefusal` + +The relationship graph cannot be carried across as asked. + +Either the source carries relationship types this operation's ledger does not support, or the +graph itself is unusable: a malformed relationship collection, an invalid target mode, or an +internal relationship pointing outside its own package. + +## `StaleAnchorError` + +Bases: `TargetNotFoundError` + +The block at an anchor's position no longer matches the anchor's content hash. + +The document changed since the anchor was produced. Refusing beats guessing: use +`pptx.edit.refind()` to recover a fresh anchor explicitly. (Subclass of +`TargetNotFoundError` so existing handlers keep working.) + +## `TargetNotFoundError` + +Bases: `PaperRefusal` + +The target could not be resolved in this document. + +Either the addressing given (name, index, id, section) matches nothing, or a proxy handed in has +gone stale because the shape, part, or content it wrapped is no longer reachable. See +`StaleAnchorError` for the content-hash case. + +## `UnsupportedStructureError` + +Bases: `PaperRefusal` + +This API cannot operate safely on the document as it stands. + +Covers input it will not touch (unsupported structure, an unreadable package, a signed deck a +rewrite would invalidate) and, at commit or `batch()` exit, edits whose result would not reopen +as a presentation. In that second case the edits roll back. + +## `materialize_slides` + +```python +materialize_slides(prs, operation: str) +``` + +Return `list(prs.slides)`, refusing typed when the relationship graph is broken. + +paper-pptx internal helper. Paper organs traverse the whole deck up front; +corrupt input (a `p:sldId` referencing a missing relationship) must speak from those +APIs as a typed, specific refusal - never a raw traceback. Upstream loader and +traversal behavior on such files is unchanged (the additive contract): only the +paper entry points route through this guard. + + + + + +# `pptx.exc` + +Exceptions used with python-pptx. + +## `InvalidXmlError` + +Bases: `PythonPptxError` + +Raised when a value is encountered in the XML that is not valid according +to the schema. + +## `PackageNotFoundError` + +Bases: `PythonPptxError` + +Raised when a package cannot be found at the specified path. + +## `PythonPptxError` + +Bases: `Exception` + +Generic error class. + + + + + +# `pptx.hf` + +Footer, date, and slide-number application machinery (paper-pptx addition). + +## `DATETIME_FIELD_FORMATS` + +```python +DATETIME_FIELD_FORMATS: 'Dict[str, str]' = {'datetime': '%m/%d/%Y', 'datetime1': '%m/%d/%Y', 'datetime2': '%A, %B %d, %Y', 'datetime3': '%d %B %Y', 'datetime4': '%B %d, %Y', 'datetime5': '%d-%b-%y', 'datetime6': '%B %y', 'datetime7': '%b-%y', 'datetime8': '%m/%d/%Y %I:%M %p', 'datetime9': '%m/%d/%Y %I:%M:%S %p', 'datetime10': '%H:%M', 'datetime11': '%H:%M:%S', 'datetime12': '%I:%M %p', 'datetime13': '%I:%M:%S %p'} +``` + +## `apply_presentation_footers` + +```python +apply_presentation_footers(prs: 'Presentation', *, footer: 'Optional[str]' = None, slide_number: bool = False, date_format: 'Optional[str]' = None, fixed_date: 'Optional[str]' = None, skip_title_slides: bool = False, now: 'Optional[datetime]' = None) -> None +``` + +Apply the complete footer state to every slide (the dialog's "Apply to All"). + +## `apply_slide_footers` + +```python +apply_slide_footers(slide: 'Slide', *, footer: 'Optional[str]' = None, slide_number: bool = False, date_format: 'Optional[str]' = None, fixed_date: 'Optional[str]' = None, now: 'Optional[datetime]' = None) -> None +``` + +Apply the complete footer state to one slide (the dialog's per-slide "Apply"). + + + + + +# paper-pptx API reference + +The complete public API of `pptx` 0.2.0, generated from docstrings. The distribution is `paper-pptx`, a fork of python-pptx; the import name is `pptx`. Both what the fork adds and the API it inherits from python-pptx are documented here. + +This index names every symbol documented here. Open the one page you need rather than reading them all. + +## Modules + +| Page | Surface | +| --- | --- | +| [`pptx.action`](api-001.md#source-2ff08e8ad4252e35) | 2 members | +| [`pptx.api`](api-001.md#source-54221fb89f7eb2be) | 1 member | +| [`pptx.chart.axis`](api-001.md#source-9118ae13cf8314b0) | 6 members | +| [`pptx.chart.category`](api-001.md#source-8dee24aaee01b88c) | 3 members | +| [`pptx.chart.chart`](api-001.md#source-89e7d711ed15a370) | 2 members | +| [`pptx.chart.data`](api-001.md#source-d76816c4762d3876) | 12 members | +| [`pptx.chart.datalabel`](api-001.md#source-9e89dcc0459d9b73) | 2 members | +| [`pptx.chart.legend`](api-001.md#source-ecb5a51f2ecc4bf7) | 1 member | +| [`pptx.chart.marker`](api-001.md#source-6cab2c6b1a4a1250) | 1 member | +| [`pptx.chart.plot`](api-001.md#source-11e5906e988644eb) | 11 members | +| [`pptx.chart.point`](api-001.md#source-2377de03498f7784) | 4 members | +| [`pptx.chart.series`](api-001.md#source-5a3d6f3e2c43691a) | 8 members | +| [`pptx.chart.xlsx`](api-001.md#source-21ab6bfedcdec9c3) | 3 members | +| [`pptx.chart.xmlwriter`](api-001.md#source-a5280ef39ca5756d) | 2 members | +| [`pptx.compose`](api-001.md#source-dc72e6b5a4c9aeb7) | 6 members | +| [`pptx.diff`](api-001.md#source-d7afcdbc99d99466) | 10 members | +| [`pptx.dml.chtfmt`](api-001.md#source-b2539aba320810e9) | 1 member | +| [`pptx.dml.color`](api-001.md#source-83f28c18da7fa00a) | 2 members | +| [`pptx.dml.effect`](api-001.md#source-fd3a24128e2451fd) | 1 member | +| [`pptx.dml.fill`](api-001.md#source-d3ad8803bc50edd0) | 1 member | +| [`pptx.dml.line`](api-001.md#source-37ef7e94dbf5293c) | 1 member | +| [`pptx.edit`](api-001.md#source-49bf2030e825c719) | 6 members | +| [`pptx.enum.action`](api-001.md#source-c56e51ee96add455) | 2 members | +| [`pptx.enum.base`](api-001.md#source-e3cf2347788123d0) | 3 members | +| [`pptx.enum.chart`](api-001.md#source-69df9adb5a6361da) | 9 members | +| [`pptx.enum.dml`](api-001.md#source-d1db4231c014498d) | 9 members | +| [`pptx.enum.lang`](api-001.md#source-1262a37dc68e18a0) | 1 member | +| [`pptx.enum.shapes`](api-002.md#source-89575e3e5103a25b) | 10 members | +| [`pptx.enum.text`](api-002.md#source-291b3937811b1f64) | 8 members | +| [`pptx.errors`](api-002.md#source-122db168dc0ce49e) | 9 members | +| [`pptx.exc`](api-002.md#source-ed8153008804ef1f) | 3 members | +| [`pptx.hf`](api-002.md#source-511bb93703e9b2ac) | 3 members | +| [`pptx.inspect`](api-002.md#source-3bfd250d7ff4fdfd) | 25 members | +| [`pptx.media`](api-002.md#source-f7fd4e165e028bd9) | 2 members | +| [`pptx.opc.constants`](api-002.md#source-b464d01ec597ecae) | 4 members | +| [`pptx.opc.oxml`](api-003.md#source-86b4861df7b1f077) | 9 members | +| [`pptx.opc.package`](api-003.md#source-5a9871cc4e6c3d66) | 4 members | +| [`pptx.opc.packuri`](api-003.md#source-63e80df0d91d462c) | 3 members | +| [`pptx.opc.serialized`](api-003.md#source-35792d9504efae5d) | 4 members | +| [`pptx.opc.shared`](api-003.md#source-12d7471663bc8a39) | 1 member | +| [`pptx.opc.spec`](api-003.md#source-9316cc7ef21393f0) | 2 members | +| [`pptx.oxml`](api-003.md#source-bae1743dc9ddb82f) | 5 members | +| [`pptx.oxml.action`](api-003.md#source-c804902fbb787f54) | 1 member | +| [`pptx.oxml.chart.axis`](api-003.md#source-566f3b63c7e768e3) | 12 members | +| [`pptx.oxml.chart.chart`](api-003.md#source-20c707c7c6bfd9bf) | 5 members | +| [`pptx.oxml.chart.datalabel`](api-003.md#source-9b9fa7848c5b8421) | 3 members | +| [`pptx.oxml.chart.legend`](api-003.md#source-7a24123fbbd345ca) | 2 members | +| [`pptx.oxml.chart.marker`](api-003.md#source-10d46fe6d4d2326e) | 3 members | +| [`pptx.oxml.chart.plot`](api-003.md#source-a49f289a1ad3ea52) | 15 members | +| [`pptx.oxml.chart.series`](api-003.md#source-247322b154f45010) | 6 members | +| [`pptx.oxml.chart.shared`](api-003.md#source-5a0df2b41da4068f) | 10 members | +| [`pptx.oxml.coreprops`](api-003.md#source-5aa806ae9ec22ad6) | 1 member | +| [`pptx.oxml.dml.color`](api-003.md#source-38ea91b08c444f69) | 8 members | +| [`pptx.oxml.dml.fill`](api-003.md#source-573913bc7bca648f) | 11 members | +| [`pptx.oxml.dml.line`](api-003.md#source-953e640c9323192f) | 1 member | +| [`pptx.oxml.ns`](api-003.md#source-dbcf11c38dbcbca9) | 7 members | +| [`pptx.oxml.presentation`](api-003.md#source-8352fd2c2ce5d006) | 8 members | +| [`pptx.oxml.shapes`](api-003.md#source-3318e1ceb735b25b) | 1 member | +| [`pptx.oxml.shapes.autoshape`](api-003.md#source-5bf238d976cbd6be) | 13 members | +| [`pptx.oxml.shapes.connector`](api-003.md#source-8b80e8e0e82d5ca2) | 4 members | +| [`pptx.oxml.shapes.graphfrm`](api-003.md#source-e3e5c89083e07e1f) | 5 members | +| [`pptx.oxml.shapes.groupshape`](api-003.md#source-b3eab28136715bb4) | 3 members | +| [`pptx.oxml.shapes.picture`](api-003.md#source-0a4c2f502c254a31) | 2 members | +| [`pptx.oxml.shapes.shared`](api-003.md#source-d45d2ccf7e798734) | 9 members | +| [`pptx.oxml.simpletypes`](api-003.md#source-96bc334681dede4f) | 63 members | +| [`pptx.oxml.slide`](api-003.md#source-98bbdca02b344ee5) | 15 members | +| [`pptx.oxml.table`](api-003.md#source-5bd2facac75a3388) | 8 members | +| [`pptx.oxml.text`](api-004.md#source-e5428ffda937292b) | 17 members | +| [`pptx.oxml.theme`](api-004.md#source-b3a1aa7e82da1084) | 1 member | +| [`pptx.oxml.xmlchemy`](api-004.md#source-4c6faebd72b104d8) | 15 members | +| [`pptx.package`](api-004.md#source-22b32522760a4aff) | 6 members | +| [`pptx.parts.chart`](api-004.md#source-250e95b19f45835f) | 2 members | +| [`pptx.parts.coreprops`](api-004.md#source-96363677f68ee31b) | 1 member | +| [`pptx.parts.embeddedpackage`](api-004.md#source-af8e4490ae9517c3) | 4 members | +| [`pptx.parts.image`](api-004.md#source-29abb0ee84ed146a) | 2 members | +| [`pptx.parts.media`](api-004.md#source-741ea168e196c168) | 1 member | +| [`pptx.parts.presentation`](api-004.md#source-dbd76b439e857b96) | 1 member | +| [`pptx.parts.slide`](api-004.md#source-5c62c890b70bb9fc) | 6 members | +| [`pptx.presentation`](api-004.md#source-811af5046b26a15e) | 1 member | +| [`pptx.rebind`](api-004.md#source-e73fd44ae5d51784) | 5 members | +| [`pptx.shapes`](api-004.md#source-340d6c3c7ab9df91) | 1 member | +| [`pptx.shapes.autoshape`](api-004.md#source-8c0292548da51159) | 4 members | +| [`pptx.shapes.base`](api-004.md#source-dcdd2ab735f49200) | 1 member | +| [`pptx.shapes.connector`](api-004.md#source-32573f9d12411719) | 1 member | +| [`pptx.shapes.freeform`](api-004.md#source-7a00ad9c2fe27b44) | 3 members | +| [`pptx.shapes.graphfrm`](api-004.md#source-b094fa81b443b0fe) | 1 member | +| [`pptx.shapes.group`](api-004.md#source-b20070cf5f17e348) | 1 member | +| [`pptx.shapes.picture`](api-004.md#source-d1feeccb517dfb14) | 2 members | +| [`pptx.shapes.placeholder`](api-004.md#source-4ca2a6ba8179a22c) | 10 members | +| [`pptx.shapes.shapetree`](api-004.md#source-76804c333460b9bb) | 12 members | +| [`pptx.shared`](api-004.md#source-645aca58a83de6fe) | 3 members | +| [`pptx.slide`](api-004.md#source-c071261f71595b98) | 10 members | +| [`pptx.slideops`](api-004.md#source-d4db30d15a010249) | 3 members | +| [`pptx.spec`](api-004.md#source-cf430719ccbe46f5) | 6 members | +| [`pptx.table`](api-004.md#source-eeaf22cc77d18fa9) | 1 member | +| [`pptx.text.bullet`](api-005.md#source-7265f22343afe4ee) | 3 members | +| [`pptx.text.fonts`](api-005.md#source-c6ff4d26749bee76) | 1 member | +| [`pptx.text.layout`](api-005.md#source-720ef7cbb39d9baa) | 1 member | +| [`pptx.text.text`](api-005.md#source-641574f4f1a6c03b) | 2 members | +| [`pptx.types`](api-005.md#source-8c8b08f561ed110c) | 2 members | +| [`pptx.util`](api-005.md#source-c6f3b84c67d06ef5) | 8 members | + +## `pptx.action` + +Objects related to mouse click and hover actions on a shape or text. + +Full contract: [action.md](api-001.md#source-2ff08e8ad4252e35) + +- `ActionSetting` — Properties specifying how a shape or run reacts to mouse actions. +- `Hyperlink` — Represents a hyperlink action on a shape or text run. + +## `pptx.api` + +Directly exposed API classes, Presentation for now. + +Full contract: [api.md](api-001.md#source-54221fb89f7eb2be) + +- `Presentation(pptx=None) -> presentation.Presentation` — Return a `Presentation` object loaded from *pptx*, where *pptx* can be + +## `pptx.chart.axis` + +Axis-related chart objects. + +Full contract: [chart.axis.md](api-001.md#source-9118ae13cf8314b0) + +- `AxisTitle` — Provides properties for manipulating axis title. +- `CategoryAxis` — A category axis of a chart. +- `DateAxis` — A category axis with dates as its category labels. +- `MajorGridlines` — Provides access to the properties of the major gridlines appearing on an axis. +- `TickLabels` — A service class providing access to formatting of axis tick mark labels. +- `ValueAxis` — An axis having continuous (as opposed to discrete) values. + +## `pptx.chart.category` + +Category-related objects. + +Full contract: [chart.category.md](api-001.md#source-8dee24aaee01b88c) + +- `Categories` — A sequence of `category.Category` objects, each representing a category +- `Category` — An extension of `str` that provides the category label as its string +- `CategoryLevel` — A sequence of `category.Category` objects representing a single level in + +## `pptx.chart.chart` + +Chart-related objects such as Chart and ChartTitle. + +Full contract: [chart.chart.md](api-001.md#source-89e7d711ed15a370) + +- `Chart` — A chart object. +- `ChartTitle` — Provides properties for manipulating a chart title. + +## `pptx.chart.data` + +ChartData and related objects. + +Full contract: [chart.data.md](api-001.md#source-d76816c4762d3876) + +- `BubbleChartData` — A specialized ChartData object suitable for use with a bubble chart. +- `BubbleDataPoint` — A data point in a bubble chart series. Provides access to the x, y, and +- `BubbleSeriesData` — The data specific to a particular Bubble chart series. It provides access +- `Categories` — A sequence of `data.Category` objects, also having certain hierarchical +- `Category` — A chart category, primarily having a label to be displayed on the +- `CategoryChartData` — Accumulates data specifying the categories and series values for a chart +- `CategoryDataPoint` — A data point in a category chart series. Provides access to the value of +- `CategorySeriesData` — The data specific to a particular category chart series. It provides +- `ChartData` — `ChartData` is simply an alias for `CategoryChartData` and may be removed +- `XyChartData` — A specialized ChartData object suitable for use with an XY (aka. scatter) +- `XyDataPoint` — A data point in an XY chart series. Provides access to the x and y values +- `XySeriesData` — The data specific to a particular XY chart series. It provides access to + +## `pptx.chart.datalabel` + +Data label-related objects. + +Full contract: [chart.datalabel.md](api-001.md#source-9e89dcc0459d9b73) + +- `DataLabel` — The data label associated with an individual data point. +- `DataLabels` — Provides access to properties of data labels for a plot or a series. + +## `pptx.chart.legend` + +Legend of a chart. + +Full contract: [chart.legend.md](api-001.md#source-ecb5a51f2ecc4bf7) + +- `Legend` — Represents the legend in a chart. A chart can have at most one legend. + +## `pptx.chart.marker` + +Marker-related objects. + +Full contract: [chart.marker.md](api-001.md#source-6cab2c6b1a4a1250) + +- `Marker` — Represents a data point marker, such as a diamond or circle, on + +## `pptx.chart.plot` + +Plot-related objects. + +Full contract: [chart.plot.md](api-001.md#source-11e5906e988644eb) + +- `Area3DPlot` — A 3-dimensional area plot. +- `AreaPlot` — An area plot. +- `BarPlot` — A bar chart-style plot. +- `BubblePlot` — A bubble chart plot. +- `DoughnutPlot` — An doughnut plot. +- `LinePlot` — A line chart-style plot. +- `PiePlot` — A pie chart-style plot. +- `PlotFactory(xChart, chart)` — Return an instance of the appropriate subclass of _BasePlot based on the +- `PlotTypeInspector` — "One-shot" service object that knows how to identify the type of a plot +- `RadarPlot` — A radar-style plot. +- `XyPlot` — An XY (scatter) plot. + +## `pptx.chart.point` + +Data point-related objects. + +Full contract: [chart.point.md](api-001.md#source-2377de03498f7784) + +- `BubblePoints` — Sequence providing access to the individual data points in +- `CategoryPoints` — Sequence providing access to individual `Point` objects, each +- `Point` — Provides access to the properties of an individual data point in +- `XyPoints` — Sequence providing access to the individual data points in an `XySeries` + +## `pptx.chart.series` + +Series-related objects. + +Full contract: [chart.series.md](api-001.md#source-5a3d6f3e2c43691a) + +- `AreaSeries` — A data point series belonging to an area plot. +- `BarSeries` — A data point series belonging to a bar plot. +- `BubbleSeries` — A data point series belonging to a bubble plot. +- `LineSeries` — A data point series belonging to a line plot. +- `PieSeries` — A data point series belonging to a pie plot. +- `RadarSeries` — A data point series belonging to a radar plot. +- `SeriesCollection` — A sequence of `Series` objects. +- `XySeries` — A data point series belonging to an XY (scatter) plot. + +## `pptx.chart.xlsx` + +Chart builder and related objects. + +Full contract: [chart.xlsx.md](api-001.md#source-21ab6bfedcdec9c3) + +- `BubbleWorkbookWriter` — Service object that knows how to write an Excel workbook from bubble +- `CategoryWorkbookWriter` — Determines Excel worksheet layout and can write an Excel workbook from +- `XyWorkbookWriter` — Determines Excel worksheet layout and can write an Excel workbook from XY + +## `pptx.chart.xmlwriter` + +Composers for default chart XML for various chart types. + +Full contract: [chart.xmlwriter.md](api-001.md#source-a5280ef39ca5756d) + +- `ChartXmlWriter(chart_type, chart_data)` — Factory function returning appropriate XML writer object for +- `SeriesXmlRewriterFactory(chart_type, chart_data)` — Return a `_BaseSeriesXmlRewriter` subclass appropriate to *chart_type*. + +## `pptx.compose` + +Cross-presentation slide import and deck merge (paper-pptx addition). + +Full contract: [compose.md](api-001.md#source-dc72e6b5a4c9aeb7) + +- `ImportReport` — What one import did. Deterministic; `.to_dict()` is goldenable. +- `PackageTransaction` — Restore a package's original live graph if the guarded operation raises. +- `SCHEMA_NAME = 'paper-import-report'` +- `SCHEMA_VERSION = 3` +- `append_deck(dest_prs, source_prs, *, mode, notes=True) -> 'Tuple[ImportReport, ...]'` — Import every `source_prs` slide, in order, at the end of `dest_prs`. +- `import_slide(dest_prs, source_prs, slide, *, mode, position=None, notes=True, section=None, section_id=None, target_layout=None, placeholder_map='auto') -> ImportReport` — Import one slide from `source_prs` into `dest_prs`; return the `ImportReport`. + +## `pptx.diff` + +Deck diff - the verification mirror (paper-pptx addition). + +Full contract: [diff.md](api-001.md#source-d7afcdbc99d99466) + +- `BulletShift` — One paragraph whose resolved bullet changed between the two decks. +- `DeckDiff` — The whole comparison. `.to_dict()` is deterministic and goldenable. +- `EffectiveShift` — One uniquely matched run in a unique unchanged paragraph whose resolved font changed. +- `MovedSlide` — A slide that kept its identity and changed position. +- `SCHEMA_NAME = 'paper-deck-diff'` +- `SCHEMA_VERSION = 5` +- `ShapeRef` — Identifies a slide-scoped shape by stable id and display name. +- `SlideChange` — Within-slide deltas for one id-matched slide pair. Empty facets are omitted +- `SlideRef` — Identifies a slide by id, position, and title. +- `diff_decks(path_a, path_b, *, detail='structure') -> DeckDiff` — Compare two decks; return the typed `DeckDiff`. + +## `pptx.dml.chtfmt` + +`ChartFormat` and related objects. + +Full contract: [dml.chtfmt.md](api-001.md#source-b2539aba320810e9) + +- `ChartFormat` — The `ChartFormat` object provides access to visual shape properties for + +## `pptx.dml.color` + +DrawingML objects related to color, ColorFormat being the most prominent. + +Full contract: [dml.color.md](api-001.md#source-83f28c18da7fa00a) + +- `ColorFormat` — Provides access to color settings such as RGB color, theme color, and +- `RGBColor` — Immutable value object defining a particular RGB color. + +## `pptx.dml.effect` + +Visual effects on a shape such as shadow, glow, and reflection. + +Full contract: [dml.effect.md](api-001.md#source-fd3a24128e2451fd) + +- `ShadowFormat` — Provides access to shadow effect on a shape. + +## `pptx.dml.fill` + +DrawingML objects related to fill. + +Full contract: [dml.fill.md](api-001.md#source-d3ad8803bc50edd0) + +- `FillFormat` — Provides access to the current fill properties. + +## `pptx.dml.line` + +DrawingML objects related to line formatting. + +Full contract: [dml.line.md](api-001.md#source-37ef7e94dbf5293c) + +- `LineFormat` — Provides access to line properties such as color, style, and width. + +## `pptx.edit` + +Structural-anchor write APIs: formatting-preserving text replacement (paper-pptx addition). + +Full contract: [edit.md](api-001.md#source-49bf2030e825c719) + +- `RESULT_SCHEMA_NAME = 'paper-replace-result'` +- `RESULT_SCHEMA_VERSION = 2` +- `ReplaceResult` — Outcome of a text replacement. +- `refind(prs, anchor) -> BlockAnchor` — Return a fresh current anchor for an exact unique fingerprint match. +- `replace_text(prs, find, replace, *, include_notes=False) -> ReplaceResult` — Replace literal `find` with `replace` across `prs`; return a `ReplaceResult`. +- `replace_text_at(prs, anchor, find, replace) -> ReplaceResult` — Replace literal `find` in the block at `anchor`; return a `ReplaceResult`. + +## `pptx.enum.action` + +Enumerations that describe click-action settings. + +Full contract: [enum.action.md](api-001.md#source-c56e51ee96add455) + +- `PP_ACTION = PP_ACTION_TYPE` +- `PP_ACTION_TYPE` — Specifies the type of a mouse action (click or hover action). + +## `pptx.enum.base` + +Base classes and other objects used by enumerations. + +Full contract: [enum.base.md](api-001.md#source-e3cf2347788123d0) + +- `BaseEnum` — Base class for Enums that do not map XML attr values. +- `BaseXmlEnum` — Base class for Enums that also map XML attr values. +- `DocsPageFormatter` — Formats a reStructuredText documention page (string) for an enumeration. + +## `pptx.enum.chart` + +Enumerations used by charts and related objects. + +Full contract: [enum.chart.md](api-001.md#source-69df9adb5a6361da) + +- `XL_AXIS_CROSSES` — Specifies the point on an axis where the other axis crosses. +- `XL_CATEGORY_TYPE` — Specifies the type of the category axis. +- `XL_CHART_TYPE` — Specifies the type of a chart. +- `XL_DATA_LABEL_POSITION` — Specifies where the data label is positioned. +- `XL_LABEL_POSITION = XL_DATA_LABEL_POSITION` +- `XL_LEGEND_POSITION` — Specifies the position of the legend on a chart. +- `XL_MARKER_STYLE` — Specifies the marker style for a point or series in a line, scatter, or radar chart. +- `XL_TICK_LABEL_POSITION` — Specifies the position of tick-mark labels on a chart axis. +- `XL_TICK_MARK` — Specifies a type of axis tick for a chart. + +## `pptx.enum.dml` + +Enumerations used by DrawingML objects. + +Full contract: [enum.dml.md](api-001.md#source-d1db4231c014498d) + +- `MSO_COLOR_TYPE` — Specifies the color specification scheme +- `MSO_FILL = MSO_FILL_TYPE` +- `MSO_FILL_TYPE` — Specifies the type of bitmap used for the fill of a shape. +- `MSO_LINE = MSO_LINE_DASH_STYLE` +- `MSO_LINE_DASH_STYLE` — Specifies the dash style for a line. +- `MSO_PATTERN = MSO_PATTERN_TYPE` +- `MSO_PATTERN_TYPE` — Specifies the fill pattern used in a shape. +- `MSO_THEME_COLOR = MSO_THEME_COLOR_INDEX` +- `MSO_THEME_COLOR_INDEX` — An Office theme color, one of those shown in the color gallery on the formatting ribbon. + +## `pptx.enum.lang` + +Enumerations used for specifying language. + +Full contract: [enum.lang.md](api-001.md#source-1262a37dc68e18a0) + +- `MSO_LANGUAGE_ID` — Specifies the language identifier. + +## `pptx.enum.shapes` + +Enumerations used by shapes and related objects. + +Full contract: [enum.shapes.md](api-002.md#source-89575e3e5103a25b) + +- `MSO = MSO_SHAPE_TYPE` +- `MSO_AUTO_SHAPE_TYPE` — Specifies a type of AutoShape, e.g. DOWN_ARROW. +- `MSO_CONNECTOR = MSO_CONNECTOR_TYPE` +- `MSO_CONNECTOR_TYPE` — Specifies a type of connector. +- `MSO_SHAPE = MSO_AUTO_SHAPE_TYPE` +- `MSO_SHAPE_TYPE` — Specifies the type of a shape, more specifically than the five base types. +- `PP_MEDIA_TYPE` — Indicates the OLE media type. +- `PP_PLACEHOLDER = PP_PLACEHOLDER_TYPE` +- `PP_PLACEHOLDER_TYPE` — Specifies one of the 18 distinct types of placeholder. +- `PROG_ID` — One-off Enum-like object for progId values. + +## `pptx.enum.text` + +Enumerations used by text and related objects. + +Full contract: [enum.text.md](api-002.md#source-291b3937811b1f64) + +- `MSO_ANCHOR = MSO_VERTICAL_ANCHOR` +- `MSO_AUTO_SIZE` — Determines the type of automatic sizing allowed. +- `MSO_TEXT_UNDERLINE_TYPE` — Indicates the type of underline for text. Used with +- `MSO_UNDERLINE = MSO_TEXT_UNDERLINE_TYPE` +- `MSO_VERTICAL_ANCHOR` — Specifies the vertical alignment of text in a text frame. +- `PP_ALIGN = PP_PARAGRAPH_ALIGNMENT` +- `PP_BULLET_TYPE` — Kind of bullet explicitly set on a paragraph's own properties (paper-pptx addition). +- `PP_PARAGRAPH_ALIGNMENT` — Specifies the horizontal alignment for one or more paragraphs. + +## `pptx.errors` + +Typed safe-refusal exceptions for paper-pptx APIs. + +Full contract: [errors.md](api-002.md#source-122db168dc0ce49e) + +- `AmbiguousTargetError` — The addressing given matches more than one target; refusing to pick one. +- `BoundaryViolationError` — An operation ran outside the scope where it is safe. +- `PackageLimitError` — The package archive has no single unambiguous reading, or is unsafe to expand. +- `PaperRefusal` — Base class for all safe refusals raised by paper-pptx APIs. +- `RelationshipPolicyError` — The relationship graph cannot be carried across as asked. +- `StaleAnchorError` — The block at an anchor's position no longer matches the anchor's content hash. +- `TargetNotFoundError` — The target could not be resolved in this document. +- `UnsupportedStructureError` — This API cannot operate safely on the document as it stands. +- `materialize_slides(prs, operation)` — Return `list(prs.slides)`, refusing typed when the relationship graph is broken. + +## `pptx.exc` + +Exceptions used with python-pptx. + +Full contract: [exc.md](api-002.md#source-ed8153008804ef1f) + +- `InvalidXmlError` — Raised when a value is encountered in the XML that is not valid according +- `PackageNotFoundError` — Raised when a package cannot be found at the specified path. +- `PythonPptxError` — Generic error class. + +## `pptx.hf` + +Footer, date, and slide-number application machinery (paper-pptx addition). + +Full contract: [hf.md](api-002.md#source-511bb93703e9b2ac) + +- `DATETIME_FIELD_FORMATS = {'datetime': '%m/%d/%Y', 'datetime1': '%m/%d/%Y', 'datetime2': '%A, %B %d, %Y', 'datetime3': '%d %B %Y', 'datetime4': '%B %d, %Y', 'datetime5': '%d-%b-%y', 'datetime6': '%B %y', 'datetime7': '%b-%y', 'datetime8': '%m/%d/%Y %I:%M %p', 'datetime9': '%m/%d/%Y %I:%M:%S %p', 'datetime10': '%H:%M', 'datetime11': '%H:%M:%S', 'datetime12': '%I:%M %p', 'datetime13': '%I:%M:%S %p'}` +- `apply_presentation_footers(prs, *, footer=None, slide_number=False, date_format=None, fixed_date=None, skip_title_slides=False, now=None) -> None` — Apply the complete footer state to every slide (the dialog's "Apply to All"). +- `apply_slide_footers(slide, *, footer=None, slide_number=False, date_format=None, fixed_date=None, now=None) -> None` — Apply the complete footer state to one slide (the dialog's per-slide "Apply"). + +## `pptx.inspect` + +Effective-style inspection: resolved font values with provenance (paper-pptx). + +Full contract: [inspect.md](api-002.md#source-3bfd250d7ff4fdfd) + +- `BULLET_FOLLOWS_TEXT = 'follow text'` +- `BlockAnchor` — A structural current anchor or conservative three-field legacy anchor. +- `DECK_MANIFEST_SCHEMA = 'paper-deck-manifest'` +- `DECK_MANIFEST_VERSION = 1` +- `DeckManifest` — Structural survey of a whole deck. `.to_dict()` is deterministic (golden-tested). +- `EffectiveBullet` — The bullet that actually renders on one paragraph, with its provenance chain. +- `EffectiveFont` — Effective size, name, color, and emphasis of one run. +- `EffectiveParagraphFormat` — Effective alignment, line spacing, and bullet of one paragraph (paper-pptx addition). +- `EffectiveShapeFormat` — Effective solid fill and line color of one shape (paper-pptx addition). +- `EffectiveValue` — A resolved (or honestly-unresolved) effective value with its provenance chain. +- `InspectedRun` — One run of text paired with the font that renders it. +- `ProvenanceStep` — One consulted level of an inheritance walk. +- `SCHEMA_NAME = 'paper-text-inspection'` +- `SCHEMA_VERSION = 3` +- `ShapeManifest` — Structural facts of one shape (paper-pptx addition). Group children nest. +- `SlideManifest` — Structural facts of one slide. +- `TextBlock` — One paragraph of one text body, with anchor and per-run effective fonts. +- `TextInspection` — Inspection payload for one slide. `.to_dict()` is deterministic (golden-tested). +- `content_hash(text) -> str` — First 8 hex chars of SHA-256 over the NFC-normalized text (the pinned anchor hash). +- `effective_font(run) -> EffectiveFont` — Return the `EffectiveFont` for `run`, a `_Run` on a slide shape. +- `effective_paragraph_format(paragraph) -> EffectiveParagraphFormat` — Return effective alignment, line spacing, and bullet for `paragraph`, with provenance. +- `effective_shape_format(shape) -> EffectiveShapeFormat` — Return the effective solid fill and line color of `shape`, with provenance. +- `inspect_deck(prs) -> DeckManifest` — Return a structural `DeckManifest` of `prs` (paper-pptx addition). +- `inspect_text(slide) -> TextInspection` — Return a `TextInspection` of every text block on `slide`, visibility-complete. +- `iter_text_bodies(spTree)` — Yield `(kind, owner_elm, txBody, group_path, cell_coordinates)` in document order. + +## `pptx.media` + +Objects related to images, audio, and video. + +Full contract: [media.md](api-002.md#source-f7fd4e165e028bd9) + +- `SPEAKER_IMAGE_BYTES = base64.b64decode('iVBORw0KGgoAAAANSUhEUgAAAHgAAAA3CAYAAADHao5rAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAACJ5JREFUeNrsm19oW9cdx7/n/tO9uleS9ceWZMdO68Su0jiEmNCGLVsDg+J16xhkYx0UM1ayvS19SQZ7WfK6PWR7Gax0S9n24JGFlbGNPIRgEkKWZC1u6rizHMXxv1iWJdnWvbqS7p9z9uDokqzs1bWd84GDQEigez465/x+v3MOYYyBs3shXDAXzOGCOVwwhwvmcMEcLpjDBXPBHC6YwwVzuOAt4dGjRy/MzMwMmqZpSJLkZbPZYn9//8NkMlnmgncwt27d+tKlS5e+W6lUEolEYjQUCoExBsuy4Lru+319fXMjIyNXjh49+m8ueAfRarXUCxcuvHvv3r3DR44ceavRaMCyLDDGIAgCFEVBOBwGIQSFQuH9PXv2PD516tRvu7u7H3PB2xzXdZXz58//vFKp/Gzfvn1YXFyEYRgwDAOSJEEQBDDG4LouPM+DpmnwPA/5fP73o6Ojf3zttdfGueBtzAcffPCD8fHxi0NDQ1hZWUE6nYYoiiCEQBCEZ14JIfA8D77vAwAmJib+cPLkyctvvvnm33ZLf0i7Se7s7Gz/tWvXvpbL5bC+vo5sNgtFUTb/yU/EthshBAAgyzIAoNls4tChQ6OXL1+GKIreG2+88U8ueJsxPj5+QlXVt0OhEGRZhqIoEEXxGbFPC6aUBuJVVYVlWThw4MDo2NiYkMlkisPDwx/v9D4Rdotc0zSj9+7dO5RMJgEA4XAYkiRBkqRA9tNNluVArKIokCQJ8Xgc8Xgc+/fvf/u999778fr6egcXvE0ol8spx3HeNQwDoihClmXIsgxRFCFJ0ucEE0KgqipCodAz0pPJJFKpFGKx2I8uXrz4Qy54m1CpVBK+70MUxUDW0yO1Lbz9XnuUPz2625/JZDLo7OzExMTE4cnJySG+Bm8DarVa1Pd9EEIgy3IwPYuiCFEANFWEIGw2x6PQNA2qqqKdRTDGwBgDpTSQXKvVRj/88MOZoaGhSS74C8a27XA75ZEk6YloBYoswHQNfPy4Fx4JoTdmYjBRhSozsP+ZwCil8DwPlFIkk0kkEglMTEwM5PP5wcHBwTwX/AXhOI5i23bY930wxqAoymbVijA0/DD+mj8C048iqjMUHYbFRg0n+uaQ0FzQJ5IdxwGlNFi/AaCzsxPpdHr0+vXrN3aq4F2xBs/Pz/eFQqE/t0egIAjQdR2SQDFVzmKlHoEme1BEH3uyDJFsHFdnX4SLECRRhOM4EAQBhmFA1/UgvUomk4jH4/j0008PeZ4nccFbTKPRCH/00UdHi8Viph1gNZtNUEqhKAp0XUfRNMAYQCng+0DNAhp1H4s1A3fmkwhrMmKxGGKxGFRVDdZvWZYRiUQQjUZRq9V+Mjc39wIXvIWsra0lxsfHTzx48OAuY+yGKIpQVRX1eh2O4wQBFmMUjsvQ8oCWC5RWGWZmKVyX4e58DLarIBzWnomy23mxoiiIRqPQdR2FQqGfr8FbhOu6SrFYzJim+Y9mswnHcSCKImKxGFZWVmBZFgRBgCQTpPU6LNOCquhgjMERAUIAnzJUWgrmqzJeTclouRSUUrQj8XbQZRgGwuEwFhYW+vgI3iJarZbS2dl5v1Qqwfd9uK4LAEgmk2g0GlhfX99cV0UFL2dNCLSGmtlEvUFg2oBpA5YNmHWCikmgKNLncuH2VN2udFWr1QQXvEV4nicxxlCv19FsNoOtv0QiAUVRsLq6ikqlAtel2JvycOxFCyulFZh1CqtBNuXaBPV6EyHRhyAIaLVaQST99MZEWzQPsrZ2BKu2bYMQgmq1Cs/z4DgOwuEwMpkMSqUSlpeXwQBoegTfe9XEgayDhaUHWNuoo1YHKus1hEgVuR4GLRxFPB6HrusQRRGU0uBwQLsAslO3VXdskNVsNtHR0YHl5WU0Gg24rgvGGLLZLCilWFpawuLiIggR0d1l4KffMPH6yz5a5iNUVqcR8ot4+9UKcv0pCOLmlBwKhaBpGjRNC1Kl9p9H07QmD7K2CFVVm2tra0in07AsCysrK0ilUnBdF5FIBD09PVhYWMDDhw+RyWTQ07MH/X0qznyripNFhnKNYU8SeOVwL6Idm9+jdFNm+yBAO9CybRumaeLw4cOPueAtIhKJ1Hzf/4phGDe6urowOTmJY8eOBbXk9jRdKBQQiUTQ0dGBeDyOSCyB4z0aZEmErKhoNDfX7v83BXueh2q1ilKpBF7J2sofLQi0p6dn0bZtDAwMYGNjA1NTU/B9H61WC4qioK+vDxsbG5iZmcHdu3dh2zZEUUTL8QFBAYgIQSAolUrBsR1KadCe5NpYXl6Gqqp/yuVy/+GCt5C9e/fOy7L8dVmWkcvlMD09jc8++yxYM3VdR29vL+bn53H//n3cunULtm0HGwqu6wY169XVVTiOE4hmjKHRaGB2dhaFQgHHjx+/EQ6H7Z3YT+K5c+d2pGBCCOvu7n48NTX1gFL6bcMwUCgUUCqVgkpUu/Q4NzeHZrOJVquFSCQCwzCCIzuSJMH3fViWBUII2ulXoVDAnTt3UC6X/3L27NlfaJrW4IK3GFmW3ZdeeilvWda/HMe5u2/fvhFFUWCa5m/279///vDw8K8ymczfCSH56enpr5bL5UC0IAhPSpksCKparRbK5TJmZmZw+/ZtfPLJJ1fPnDnzy506PQO76NhstVpNFIvFDGNMSKfTxVQqVX66tHnp0qXvjI2NfZ8Q8s3e3l709/ejq6sL0WgUoVAIruuiVqthaWkJ09PTWFpaunL69Olfj4yMXNnJ/fJcXT7L5/ODY2Njb928efPLoii+3t5IkGUZnufBNE2sra1dHR4e/vidd9753cDAQH6nP/Nzebtwdna2//bt269MTk4eKpVKXZ7nSbquW7lcbvrEiRPjBw8enNwtz/rcXx9ljAlPypJ0Nz4fvx+8y+GCuWAOF8zhgjlcMIcL5nDBHC6YC+ZwwRwumLMN+O8AX65uqCMleo4AAAAASUVORK5CYII=')` +- `Video` — Immutable value object representing a video such as MP4. + +## `pptx.opc.constants` + +Constant values related to the Open Packaging Convention. + +Full contract: [opc.constants.md](api-002.md#source-b464d01ec597ecae) + +- `CONTENT_TYPE` — Content type URIs (like MIME-types) that specify a part's format. +- `NAMESPACE` — Constant values for OPC XML namespaces +- `RELATIONSHIP_TARGET_MODE` — Open XML relationship target modes +- `RELATIONSHIP_TYPE` + +## `pptx.opc.oxml` + +OPC-local oxml module to handle OPC-local concerns like relationship parsing. + +Full contract: [opc.oxml.md](api-003.md#source-86b4861df7b1f077) + +- `CT_Default` — `` element. +- `CT_Override` — `` element. +- `CT_Relationship` — `` element. +- `CT_Relationships` — `` element, the root element in a .rels file. +- `CT_Types` — `` element. +- `nsmap = {'ct': NS.OPC_CONTENT_TYPES, 'pr': NS.OPC_RELATIONSHIPS, 'r': NS.OFC_RELATIONSHIPS}` +- `oxml_to_encoded_bytes(element, encoding='utf-8', pretty_print=False, standalone=None) -> bytes` +- `oxml_tostring(elm, encoding=None, pretty_print=False, standalone=None)` +- `serialize_part_xml(part_elm) -> bytes` — Produce XML-file bytes for `part_elm`, suitable for writing directly to a `.xml` file. + +## `pptx.opc.package` + +Fundamental Open Packaging Convention (OPC) objects. + +Full contract: [opc.package.md](api-003.md#source-5a9871cc4e6c3d66) + +- `OpcPackage` — Main API class for `python-opc`. +- `Part` — Base class for package parts. +- `PartFactory` — Constructs a registered subtype of `Part`. +- `XmlPart` — Base class for package parts containing an XML payload, which is most of them. + +## `pptx.opc.packuri` + +Provides the PackURI value type and known pack-URI strings such as PACKAGE_URI. + +Full contract: [opc.packuri.md](api-003.md#source-63e80df0d91d462c) + +- `CONTENT_TYPES_URI = PackURI('/[Content_Types].xml')` +- `PACKAGE_URI = PackURI('/')` +- `PackURI` — Proxy for a pack URI (partname). + +## `pptx.opc.serialized` + +API for reading/writing serialized Open Packaging Convention (OPC) package. + +Full contract: [opc.serialized.md](api-003.md#source-35792d9504efae5d) + +- `GuardedZipReader` — Validate and stream every member of an already-open ``ZipFile``. +- `PackageReader` — Provides access to package-parts of an OPC package with dict semantics. +- `PackageWriter` — Writes a zip-format OPC package to `pkg_file`. +- `preflight_zip(source) -> None` — Validate central-directory metadata before ``ZipFile`` parses it. + +## `pptx.opc.shared` + +Objects shared by modules in the pptx.opc sub-package. + +Full contract: [opc.shared.md](api-003.md#source-12d7471663bc8a39) + +- `CaseInsensitiveDict` — Mapping type like dict except it matches key without respect to case. + +## `pptx.opc.spec` + +Provides mappings that embody aspects of the Open XML spec ISO/IEC 29500. + +Full contract: [opc.spec.md](api-003.md#source-9316cc7ef21393f0) + +- `default_content_types = (('bin', CT.PML_PRINTER_SETTINGS), ('bin', CT.SML_PRINTER_SETTINGS), ('bin', CT.WML_PRINTER_SETTINGS), ('bmp', CT.BMP), ('emf', CT.X_EMF), ('fntdata', CT.X_FONTDATA), ('gif', CT.GIF), ('jpe', CT.JPEG), ('jpeg', CT.JPEG), ('jpg', CT.JPEG), ('mov', CT.MOV), ('mp4', CT.MP4), ('mpg', CT.MPG), ('png', CT.PNG), ('rels', CT.OPC_RELATIONSHIPS), ('tif', CT.TIFF), ('tiff', CT.TIFF), ('vid', CT.VIDEO), ('wdp', CT.MS_PHOTO), ('wmf', CT.X_WMF), ('wmv', CT.WMV), ('xlsx', CT.SML_SHEET), ('xml', CT.XML))` +- `image_content_types = {'bmp': CT.BMP, 'emf': CT.X_EMF, 'gif': CT.GIF, 'jpe': CT.JPEG, 'jpeg': CT.JPEG, 'jpg': CT.JPEG, 'png': CT.PNG, 'tif': CT.TIFF, 'tiff': CT.TIFF, 'wdp': CT.MS_PHOTO, 'wmf': CT.X_WMF}` + +## `pptx.oxml` + +Initializes lxml parser, particularly the custom element classes. + +Full contract: [oxml.md](api-003.md#source-bae1743dc9ddb82f) + +- `element_class_lookup = etree.ElementNamespaceClassLookup()` +- `oxml_parser = etree.XMLParser(remove_blank_text=True, resolve_entities=False)` +- `parse_from_template(template_file_name)` — Return an element loaded from the XML in the template file identified by `template_name`. +- `parse_xml(xml)` — Return root lxml element obtained by parsing XML character string in `xml`. +- `register_element_cls(nsptagname)` — Register `cls` to be constructed when oxml parser encounters element having `nsptag_name`. + +## `pptx.oxml.action` + +lxml custom element classes for text-related XML elements. + +Full contract: [oxml.action.md](api-003.md#source-c804902fbb787f54) + +- `CT_Hyperlink` — Custom element class for elements. + +## `pptx.oxml.chart.axis` + +Axis-related oxml objects. + +Full contract: [oxml.chart.axis.md](api-003.md#source-566f3b63c7e768e3) + +- `BaseAxisElement` — Base class for catAx, dateAx, valAx, and perhaps other axis elements. +- `CT_AxisUnit` — Used for `c:majorUnit` and `c:minorUnit` elements, and others. +- `CT_CatAx` — `c:catAx` element, defining a category axis. +- `CT_ChartLines` — Used for `c:majorGridlines` and `c:minorGridlines`. +- `CT_Crosses` — `c:crosses` element, specifying where the other axis crosses this one. +- `CT_DateAx` — `c:dateAx` element, defining a date (category) axis. +- `CT_LblOffset` — `c:lblOffset` custom element class. +- `CT_Orientation` — `c:xAx/c:scaling/c:orientation` element, defining category order. +- `CT_Scaling` — `c:scaling` element. +- `CT_TickLblPos` — `c:tickLblPos` element. +- `CT_TickMark` — Used for `c:minorTickMark` and `c:majorTickMark`. +- `CT_ValAx` — `c:valAx` element, defining a value axis. + +## `pptx.oxml.chart.chart` + +Custom element classes for top-level chart-related XML elements. + +Full contract: [oxml.chart.chart.md](api-003.md#source-20c707c7c6bfd9bf) + +- `CT_Chart` — `c:chart` custom element class. +- `CT_ChartSpace` — `c:chartSpace` root element of a chart part. +- `CT_ExternalData` — `` element, defining link to embedded Excel package part +- `CT_PlotArea` — ```` element. +- `CT_Style` — ```` element; defines the chart style. + +## `pptx.oxml.chart.datalabel` + +Chart data-label related oxml objects. + +Full contract: [oxml.chart.datalabel.md](api-003.md#source-9b9fa7848c5b8421) + +- `CT_DLbl` — ```` element specifying the properties of the data label for an +- `CT_DLblPos` — ```` element specifying the positioning of a data label with +- `CT_DLbls` — `c:dLbls` element specifying properties for a set of data labels. + +## `pptx.oxml.chart.legend` + +lxml custom element classes for legend-related XML elements. + +Full contract: [oxml.chart.legend.md](api-003.md#source-7a24123fbbd345ca) + +- `CT_Legend` — ```` custom element class +- `CT_LegendPos` — ```` element specifying position of legend with respect to + +## `pptx.oxml.chart.marker` + +Series-related oxml objects. + +Full contract: [oxml.chart.marker.md](api-003.md#source-10d46fe6d4d2326e) + +- `CT_Marker` — `c:marker` custom element class, containing visual properties for a data +- `CT_MarkerSize` — `c:size` custom element class, specifying the size (in points) of a data +- `CT_MarkerStyle` — `c:symbol` custom element class, specifying the shape of a data point + +## `pptx.oxml.chart.plot` + +Plot-related oxml objects. + +Full contract: [oxml.chart.plot.md](api-003.md#source-a49f289a1ad3ea52) + +- `BaseChartElement` — Base class for barChart, lineChart, and other plot elements. +- `CT_Area3DChart` — ```` element. +- `CT_AreaChart` — ```` element. +- `CT_BarChart` — ```` element. +- `CT_BarDir` — ```` child of a barChart element, specifying the orientation of +- `CT_BubbleChart` — ```` custom element class +- `CT_BubbleScale` — ```` custom element class +- `CT_DoughnutChart` — ```` element. +- `CT_GapAmount` — ```` child of ```` element, also used for other +- `CT_Grouping` — ```` child of an xChart element, specifying a value like +- `CT_LineChart` — ```` custom element class +- `CT_Overlap` — ```` element specifying bar overlap as an integer percentage +- `CT_PieChart` — ```` custom element class +- `CT_RadarChart` — ```` custom element class +- `CT_ScatterChart` — ```` custom element class + +## `pptx.oxml.chart.series` + +Series-related oxml objects. + +Full contract: [oxml.chart.series.md](api-003.md#source-247322b154f45010) + +- `CT_AxDataSource` — ```` custom element class used in category charts to specify +- `CT_DPt` — ```` custom element class, containing visual properties for a data +- `CT_Lvl` — ```` custom element class used in multi-level categories to +- `CT_NumDataSource` — ```` custom element class used in XY and bubble charts, and +- `CT_SeriesComposite` — ```` custom element class. Note there are several different series +- `CT_StrVal_NumVal_Composite` — ```` element, can be either CT_StrVal or CT_NumVal complex type. + +## `pptx.oxml.chart.shared` + +Shared oxml objects for charts. + +Full contract: [oxml.chart.shared.md](api-003.md#source-5a0df2b41da4068f) + +- `CT_Boolean` — Common complex type used for elements having a True/False value. +- `CT_Boolean_Explicit` — Always spells out the `val` attribute, e.g. `val=1`. +- `CT_Double` — Used for floating point values. +- `CT_Layout` — ```` custom element class +- `CT_LayoutMode` — Used for ````, ````, ````, and ```` +- `CT_ManualLayout` — ```` custom element class +- `CT_NumFmt` — ```` element specifying the formatting for number labels on a +- `CT_Title` — `c:title` custom element class. +- `CT_Tx` — ```` element containing the text for a label on a data point or +- `CT_UnsignedInt` — ```` element and others. + +## `pptx.oxml.coreprops` + +lxml custom element classes for core properties-related XML elements. + +Full contract: [oxml.coreprops.md](api-003.md#source-5aa806ae9ec22ad6) + +- `CT_CoreProperties` — `cp:coreProperties` element. + +## `pptx.oxml.dml.color` + +lxml custom element classes for DrawingML-related XML elements. + +Full contract: [oxml.dml.color.md](api-003.md#source-38ea91b08c444f69) + +- `CT_Color` — Custom element class for `a:fgClr`, `a:bgClr` and perhaps others. +- `CT_HslColor` — Custom element class for element. +- `CT_Percentage` — Custom element class for and elements. +- `CT_PresetColor` — Custom element class for element. +- `CT_SRgbColor` — Custom element class for element. +- `CT_ScRgbColor` — Custom element class for element. +- `CT_SchemeColor` — Custom element class for element. +- `CT_SystemColor` — Custom element class for element. + +## `pptx.oxml.dml.fill` + +lxml custom element classes for DrawingML-related XML elements. + +Full contract: [oxml.dml.fill.md](api-003.md#source-573913bc7bca648f) + +- `CT_Blip` — element +- `CT_BlipFillProperties` — Custom element class for element. +- `CT_GradientFillProperties` — `a:gradFill` custom element class. +- `CT_GradientStop` — `a:gs` custom element class. +- `CT_GradientStopList` — `a:gsLst` custom element class. +- `CT_GroupFillProperties` — `a:grpFill` custom element class +- `CT_LinearShadeProperties` — `a:lin` custom element class +- `CT_NoFillProperties` — `a:noFill` custom element class +- `CT_PatternFillProperties` — `a:pattFill` custom element class +- `CT_RelativeRect` — `a:srcRect` element and perhaps others. +- `CT_SolidColorFillProperties` — `a:solidFill` custom element class. + +## `pptx.oxml.dml.line` + +lxml custom element classes for DrawingML line-related XML elements. + +Full contract: [oxml.dml.line.md](api-003.md#source-953e640c9323192f) + +- `CT_PresetLineDashProperties` — `a:prstDash` custom element class + +## `pptx.oxml.ns` + +Namespace related objects. + +Full contract: [oxml.ns.md](api-003.md#source-dbcf11c38dbcbca9) + +- `NamespacePrefixedTag` — Value object that knows the semantics of an XML tag having a namespace prefix. +- `namespaces(*prefixes)` — Return a dict containing the subset namespace prefix mappings specified by *prefixes*. +- `nsdecls(*prefixes)` +- `nsmap = namespaces` +- `nsuri(nspfx)` — Return the namespace URI corresponding to `nspfx`. +- `pfxmap = {value: key for key, value in _nsmap.items()}` +- `qn(namespace_prefixed_tag) -> str` — Return a Clark-notation qualified tag name corresponding to `namespace_prefixed_tag`. + +## `pptx.oxml.presentation` + +Custom element classes for presentation-related XML elements. + +Full contract: [oxml.presentation.md](api-003.md#source-8352fd2c2ce5d006) + +- `CT_NotesMasterIdList` — `p:notesMasterIdLst` element, child of `p:presentation` (paper-pptx addition). +- `CT_NotesMasterIdListEntry` — `p:notesMasterId` element - the reference to the notes master (paper-pptx addition). +- `CT_Presentation` — `p:presentation` element, root of the Presentation part stored as `/ppt/presentation.xml`. +- `CT_SlideId` — `p:sldId` element. +- `CT_SlideIdList` — `p:sldIdLst` element. +- `CT_SlideMasterIdList` — `p:sldMasterIdLst` element. +- `CT_SlideMasterIdListEntry` — ```` element, child of ```` containing +- `CT_SlideSize` — `p:sldSz` element. + +## `pptx.oxml.shapes` + +Base shape-related objects such as BaseShape. + +Full contract: [oxml.shapes.md](api-003.md#source-3318e1ceb735b25b) + +- `ShapeElement = 'CT_Connector | CT_GraphicalObjectFrame | CT_GroupShape | CT_Picture | CT_Shape'` + +## `pptx.oxml.shapes.autoshape` + +lxml custom element classes for shape-related XML elements. + +Full contract: [oxml.shapes.autoshape.md](api-003.md#source-5bf238d976cbd6be) + +- `CT_AdjPoint2D` — `a:pt` custom element class. +- `CT_CustomGeometry2D` — `a:custGeom` custom element class. +- `CT_GeomGuide` — `a:gd` custom element class. +- `CT_GeomGuideList` — `a:avLst` custom element class. +- `CT_NonVisualDrawingShapeProps` — `p:cNvSpPr` custom element class. +- `CT_Path2D` — `a:path` custom element class. +- `CT_Path2DClose` — `a:close` custom element class. +- `CT_Path2DLineTo` — `a:lnTo` custom element class. +- `CT_Path2DList` — `a:pathLst` custom element class. +- `CT_Path2DMoveTo` — `a:moveTo` custom element class. +- `CT_PresetGeometry2D` — `a:prstGeom` custom element class. +- `CT_Shape` — `p:sp` custom element class. +- `CT_ShapeNonVisual` — `p:nvSpPr` custom element class. + +## `pptx.oxml.shapes.connector` + +lxml custom element classes for XML elements related to the Connector shape. + +Full contract: [oxml.shapes.connector.md](api-003.md#source-8b80e8e0e82d5ca2) + +- `CT_Connection` — A `a:stCxn` or `a:endCxn` element. +- `CT_Connector` — A line/connector shape `p:cxnSp` element +- `CT_ConnectorNonVisual` — `p:nvCxnSpPr` element, container for the non-visual properties of +- `CT_NonVisualConnectorProperties` — `p:cNvCxnSpPr` element, container for the non-visual properties specific + +## `pptx.oxml.shapes.graphfrm` + +lxml custom element class for CT_GraphicalObjectFrame XML element. + +Full contract: [oxml.shapes.graphfrm.md](api-003.md#source-e3e5c89083e07e1f) + +- `CT_GraphicalObject` — `a:graphic` element. +- `CT_GraphicalObjectData` — `p:graphicData` element. +- `CT_GraphicalObjectFrame` — `p:graphicFrame` element. +- `CT_GraphicalObjectFrameNonVisual` — `p:nvGraphicFramePr` element. +- `CT_OleObject` — `p:oleObj` element, container for an OLE object (e.g. Excel file). + +## `pptx.oxml.shapes.groupshape` + +lxml custom element classes for shape-tree-related XML elements. + +Full contract: [oxml.shapes.groupshape.md](api-003.md#source-b3eab28136715bb4) + +- `CT_GroupShape` — Used for shape tree (`p:spTree`) as well as the group shape (`p:grpSp`) elements. +- `CT_GroupShapeNonVisual` — `p:nvGrpSpPr` element. +- `CT_GroupShapeProperties` — p:grpSpPr element + +## `pptx.oxml.shapes.picture` + +lxml custom element classes for picture-related XML elements. + +Full contract: [oxml.shapes.picture.md](api-003.md#source-0a4c2f502c254a31) + +- `CT_Picture` — `p:pic` element. +- `CT_PictureNonVisual` — ```` element, containing non-visual properties for a picture + +## `pptx.oxml.shapes.shared` + +Common shape-related oxml objects. + +Full contract: [oxml.shapes.shared.md](api-003.md#source-d45d2ccf7e798734) + +- `BaseShapeElement` — Provides common behavior for shape element classes like CT_Shape, CT_Picture, etc. +- `CT_ApplicationNonVisualDrawingProps` — `p:nvPr` element. +- `CT_LineProperties` — Custom element class for element +- `CT_NonVisualDrawingProps` — `p:cNvPr` custom element class. +- `CT_Placeholder` — `p:ph` custom element class. +- `CT_Point2D` — Custom element class for element. +- `CT_PositiveSize2D` — Custom element class for element. +- `CT_ShapeProperties` — Custom element class for `p:spPr` element. +- `CT_Transform2D` — `a:xfrm` custom element class. + +## `pptx.oxml.simpletypes` + +Simple-type classes. + +Full contract: [oxml.simpletypes.md](api-003.md#source-96bc334681dede4f) + +- `BaseFloatType` +- `BaseIntType` +- `BaseSimpleType` +- `BaseStringEnumerationType` +- `BaseStringType` +- `ST_Angle` — Valid values for `rot` attribute on `` element. 60000ths of +- `ST_AxisUnit` — Valid values for val attribute on c:majorUnit and others. +- `ST_BarDir` — Valid values for attribute +- `ST_BubbleScale` — String value is an integer in range 0-300, representing a percent, +- `ST_ContentType` — Has a pretty wicked regular expression it needs to match in the schema, +- `ST_Coordinate` +- `ST_Coordinate32` — xsd:union of ST_Coordinate32Unqualified, ST_UniversalMeasure +- `ST_Coordinate32Unqualified` +- `ST_CoordinateUnqualified` +- `ST_Direction` — Valid values for `` attribute. +- `ST_DrawingElementId` +- `ST_Extension` — Has a regular expression it needs to match in the schema, but figuring +- `ST_GapAmount` — String value is an integer in range 0-500, representing a percent, +- `ST_Grouping` — Valid values for attribute. Overloaded for use as +- `ST_HexColorRGB` +- `ST_LayoutMode` — Valid values for `val` attribute on c:xMode and other elements of type +- `ST_LblOffset` — Unsigned integer value between 0 and 1000 inclusive, with optional +- `ST_LineWidth` +- `ST_MarkerSize` +- `ST_Orientation` — Valid values for `val` attribute on c:orientation (CT_Orientation). +- `ST_Overlap` — String value is an integer in range -100..100, representing a percent, +- `ST_Percentage` — Percentage value like 42000 or '42.0%' +- `ST_PlaceholderSize` — Valid values for sz (size) attribute +- `ST_PositiveCoordinate` +- `ST_PositiveFixedAngle` — Valid values for `a:lin@ang`. +- `ST_PositiveFixedPercentage` — Percentage value between 0 and 100% like 42000 or '42.0%' +- `ST_RelationshipId` +- `ST_SlideId` +- `ST_SlideSizeCoordinate` +- `ST_Style` +- `ST_TargetMode` — The valid values for the ``TargetMode`` attribute in a Relationship +- `ST_TextAutonumberScheme` — Valid values for `a:buAutoNum/@type` (ECMA-376 ST_TextAutonumberScheme). +- `ST_TextBulletSizePercent` — Valid values for `a:buSzPct/@val`, as a fraction of the text size (e.g. 0.75 for 75%). +- `ST_TextBulletStartAtNum` — Valid values for `a:buAutoNum/@startAt`. +- `ST_TextFontScalePercentOrPercentString` — Valid values for the `fontScale` attribute of ````. +- `ST_TextFontSize` +- `ST_TextIndent` — Valid values for `a:pPr/@indent`, an EMU `Length` (negative = hanging indent). +- `ST_TextIndentLevelType` +- `ST_TextLineSpaceReductionPercentOrPercentString` — Valid values for `a:normAutofit/@lnSpcReduction`, as a percent float (20.0 = 20%). +- `ST_TextMargin` — Valid values for `a:pPr/@marL` and `@marR`, an EMU `Length`. +- `ST_TextSpacingPercentOrPercentString` +- `ST_TextSpacingPoint` +- `ST_TextTypeface` +- `ST_TextWrappingType` — Valid values for attribute +- `ST_UniversalMeasure` +- `XsdAnyUri` — There's a regular expression this is supposed to meet but so far thinking +- `XsdBoolean` +- `XsdDouble` +- `XsdId` — String that must begin with a letter or underscore and cannot contain any +- `XsdInt` +- `XsdLong` +- `XsdString` +- `XsdStringEnumeration` — Set of enumerated xsd:string values. +- `XsdToken` — xsd:string with whitespace collapsing, e.g. multiple spaces reduced to +- `XsdTokenEnumeration` — xsd:string with whitespace collapsing, e.g. multiple spaces reduced to +- `XsdUnsignedByte` +- `XsdUnsignedInt` +- `XsdUnsignedShort` + +## `pptx.oxml.slide` + +Slide-related custom element classes, including those for masters. + +Full contract: [oxml.slide.md](api-003.md#source-98bbdca02b344ee5) + +- `CT_Background` — `p:bg` element. +- `CT_BackgroundProperties` — `p:bgPr` element. +- `CT_CommonSlideData` — `p:cSld` element. +- `CT_HeaderFooter` — `p:hf` element, header/footer placeholder visibility flags (paper-pptx addition). +- `CT_NotesMaster` — `p:notesMaster` element, root of a notes master part. +- `CT_NotesSlide` — `p:notes` element, root of a notes slide part. +- `CT_Slide` — `p:sld` element, root element of a slide part (XML document). +- `CT_SlideLayout` — `p:sldLayout` element, root of a slide layout part. +- `CT_SlideLayoutIdList` — `p:sldLayoutIdLst` element, child of `p:sldMaster`. +- `CT_SlideLayoutIdListEntry` — `p:sldLayoutId` element, child of `p:sldLayoutIdLst`. +- `CT_SlideMaster` — `p:sldMaster` element, root of a slide master part. +- `CT_SlideMasterTextStyles` — `p:txStyles` element, holding the master's title/body/other text list-styles. +- `CT_SlideTiming` — `p:timing` element, specifying animations and timed behaviors. +- `CT_TLMediaNodeVideo` — `p:video` element, specifying video media details. +- `CT_TimeNodeList` — `p:tnLst` or `p:childTnList` element. + +## `pptx.oxml.table` + +Custom element classes for table-related XML elements + +Full contract: [oxml.table.md](api-003.md#source-5bd2facac75a3388) + +- `CT_Table` — `a:tbl` custom element class +- `CT_TableCell` — `a:tc` custom element class +- `CT_TableCellProperties` — `a:tcPr` custom element class +- `CT_TableCol` — `a:gridCol` custom element class. +- `CT_TableGrid` — `a:tblGrid` custom element class. +- `CT_TableProperties` — `a:tblPr` custom element class. +- `CT_TableRow` — `a:tr` custom element class. +- `TcRange` — A 2D block of `a:tc` cell elements in a table. + +## `pptx.oxml.text` + +Custom element classes for text-related XML elements + +Full contract: [oxml.text.md](api-004.md#source-e5428ffda937292b) + +- `CT_RegularTextRun` — `a:r` custom element class +- `CT_TextAutonumberBullet` — `a:buAutoNum` element, specifying automatic numbering for a paragraph. +- `CT_TextBody` — `p:txBody` custom element class. +- `CT_TextBodyProperties` — `a:bodyPr` custom element class. +- `CT_TextBulletSizePercent` — `a:buSzPct` element, bullet size as a fraction of the paragraph's text size. +- `CT_TextCharBullet` — `a:buChar` element, specifying the character to use as a paragraph's bullet. +- `CT_TextCharacterProperties` — Custom element class for `a:rPr`, `a:defRPr`, and `a:endParaRPr`. +- `CT_TextField` — `a:fld` field element, for either a slide number or date field. +- `CT_TextFont` — Custom element class for `a:latin`, `a:ea`, `a:cs`, and `a:sym`. +- `CT_TextLineBreak` — `a:br` line break element +- `CT_TextListStyle` — `a:lstStyle` custom element class. +- `CT_TextNormalAutofit` — `a:normAutofit` element specifying fit text to shape font reduction, etc. +- `CT_TextParagraph` — `a:p` custom element class +- `CT_TextParagraphProperties` — `a:pPr` custom element class. +- `CT_TextSpacing` — Used for `a:lnSpc`, `a:spcBef`, and `a:spcAft` elements. +- `CT_TextSpacingPercent` — `a:spcPct` element, specifying spacing in thousandths of a percent in its `val` attribute. +- `CT_TextSpacingPoint` — `a:spcPts` element, specifying spacing in centipoints in its `val` attribute. + +## `pptx.oxml.theme` + +lxml custom element classes for theme-related XML elements. + +Full contract: [oxml.theme.md](api-004.md#source-b3a1aa7e82da1084) + +- `CT_OfficeStyleSheet` — ```` element, root of a theme part + +## `pptx.oxml.xmlchemy` + +Base and meta classes enabling declarative definition of custom element classes. + +Full contract: [oxml.xmlchemy.md](api-004.md#source-4c6faebd72b104d8) + +- `AttributeType` — Interface for an object that can act as an attribute type. +- `BaseAttribute` — Base class for OptionalAttribute and RequiredAttribute, providing common methods. +- `BaseOxmlElement` — Effective base class for all custom element classes. +- `Choice` — Defines a child element belonging to a group, only one of which may appear as a child. +- `MetaOxmlElement` — Metaclass for BaseOxmlElement. +- `OneAndOnlyOne` — Defines a required child element for MetaOxmlElement. +- `OneOrMore` — Defines a repeating child element for MetaOxmlElement that must appear at least once. +- `OptionalAttribute` — Defines an optional attribute on a custom element class. +- `OxmlElement(nsptag_str, nsmap=None) -> BaseOxmlElement` — Return a "loose" lxml element having the tag specified by `nsptag_str`. +- `RequiredAttribute` — Defines a required attribute on a custom element class. +- `XmlString` — Provides string comparison override suitable for serialized XML; useful for tests. +- `ZeroOrMore` — Defines an optional repeating child element for MetaOxmlElement. +- `ZeroOrOne` — Defines an optional child element for MetaOxmlElement. +- `ZeroOrOneChoice` — An `EG_*` element group where at most one of its members may appear as a child. +- `serialize_for_reading(element)` — Serialize *element* to human-readable XML suitable for tests. No XML + +## `pptx.package` + +Overall .pptx package. + +Full contract: [package.md](api-004.md#source-22b32522760a4aff) + +- `Package` — An overall .pptx package. +- `PackageDiff` — Part-by-part semantic diff between two packages. Schema "paper-package-diff" v1. +- `PartDelta` — One differing package member. +- `diff_package(path_a, path_b) -> PackageDiff` — Return the `PackageDiff` between the packages at `path_a` and `path_b`. +- `patch_save(original_path, document, out_path) -> PackageDiff` — Save `document` to `out_path`, restoring original bytes for unchanged XML parts. +- `xml_equivalent(a, b) -> bool` — Return True when `a` and `b` are semantically equivalent XML documents. + +## `pptx.parts.chart` + +Chart part objects, including Chart and Charts. + +Full contract: [parts.chart.md](api-004.md#source-250e95b19f45835f) + +- `ChartPart` — A chart part. +- `ChartWorkbook` — Provides access to external chart data in a linked or embedded Excel workbook. + +## `pptx.parts.coreprops` + +Core properties part, corresponds to ``/docProps/core.xml`` part in package. + +Full contract: [parts.coreprops.md](api-004.md#source-96363677f68ee31b) + +- `CorePropertiesPart` — Corresponds to part named `/docProps/core.xml`. + +## `pptx.parts.embeddedpackage` + +Embedded Package part objects. + +Full contract: [parts.embeddedpackage.md](api-004.md#source-af8e4490ae9517c3) + +- `EmbeddedDocxPart` — A Word .docx file stored in a part. +- `EmbeddedPackagePart` — A distinct OPC package, e.g. an Excel file, embedded in this PPTX package. +- `EmbeddedPptxPart` — A PowerPoint file stored in a part. +- `EmbeddedXlsxPart` — An Excel file stored in a part. + +## `pptx.parts.image` + +ImagePart and related objects. + +Full contract: [parts.image.md](api-004.md#source-29abb0ee84ed146a) + +- `Image` — Immutable value object representing an image such as a JPEG, PNG, or GIF. +- `ImagePart` — An image part. + +## `pptx.parts.media` + +MediaPart and related objects. + +Full contract: [parts.media.md](api-004.md#source-741ea168e196c168) + +- `MediaPart` — A media part, containing an audio or video resource. + +## `pptx.parts.presentation` + +Presentation part, the main part in a .pptx package. + +Full contract: [parts.presentation.md](api-004.md#source-dbd76b439e857b96) + +- `PresentationPart` — Top level class in object model. + +## `pptx.parts.slide` + +Slide and related objects. + +Full contract: [parts.slide.md](api-004.md#source-5c62c890b70bb9fc) + +- `BaseSlidePart` — Base class for slide parts. +- `NotesMasterPart` — Notes master part. +- `NotesSlidePart` — Notes slide part. +- `SlideLayoutPart` — Slide layout part. +- `SlideMasterPart` — Slide master part. +- `SlidePart` — Slide part. Corresponds to package files ppt/slides/slide[1-9][0-9]*.xml. + +## `pptx.presentation` + +Main presentation object. + +Full contract: [presentation.md](api-004.md#source-811af5046b26a15e) + +- `Presentation` — PresentationML (PML) presentation. + +## `pptx.rebind` + +Layout rebind - the template-migration primitive (paper-pptx addition). + +Full contract: [rebind.md](api-004.md#source-e73fd44ae5d51784) + +- `RebindReport` — What one rebind did: the mapping used, orphan handling, and every resolution shift. +- `RunShift` — One run whose resolved effective values changed across the rebind. +- `SCHEMA_NAME = 'paper-rebind-report'` +- `SCHEMA_VERSION = 1` +- `rebind_layout(slide, target_layout, *, placeholder_map='auto', orphan_policy='refuse') -> RebindReport` — Rebind `slide` to `target_layout`; return the required shift report. + +## `pptx.shapes` + +Objects used across sub-package. + +Full contract: [shapes.md](api-004.md#source-340d6c3c7ab9df91) + +- `Subshape` — Provides access to the containing part for drawing elements that occur below a shape. + +## `pptx.shapes.autoshape` + +Autoshape-related objects such as Shape and Adjustment. + +Full contract: [shapes.autoshape.md](api-004.md#source-8c0292548da51159) + +- `Adjustment` — An adjustment value for an autoshape. +- `AdjustmentCollection` — Sequence of `Adjustment` instances for an auto shape. +- `AutoShapeType` — Provides access to metadata for an auto-shape of type identified by `autoshape_type_id`. +- `Shape` — A shape that can appear on a slide. + +## `pptx.shapes.base` + +Base shape-related objects such as BaseShape. + +Full contract: [shapes.base.md](api-004.md#source-dcdd2ab735f49200) + +- `BaseShape` — Base class for shape objects. + +## `pptx.shapes.connector` + +Connector (line) shape and related objects. + +Full contract: [shapes.connector.md](api-004.md#source-32573f9d12411719) + +- `Connector` — Connector (line) shape. + +## `pptx.shapes.freeform` + +Objects related to construction of freeform shapes. + +Full contract: [shapes.freeform.md](api-004.md#source-7a00ad9c2fe27b44) + +- `CT_DrawingOperation = 'CT_Path2DClose | CT_Path2DLineTo | CT_Path2DMoveTo'` +- `DrawingOperation = '_LineSegment | _MoveTo | _Close'` +- `FreeformBuilder` — Allows a freeform shape to be specified and created. + +## `pptx.shapes.graphfrm` + +Graphic Frame shape and related objects. + +Full contract: [shapes.graphfrm.md](api-004.md#source-b094fa81b443b0fe) + +- `GraphicFrame` — Container shape for table, chart, smart art, and media objects. + +## `pptx.shapes.group` + +GroupShape and related objects. + +Full contract: [shapes.group.md](api-004.md#source-b20070cf5f17e348) + +- `GroupShape` — A shape that acts as a container for other shapes. + +## `pptx.shapes.picture` + +Shapes based on the `p:pic` element, including Picture and Movie. + +Full contract: [shapes.picture.md](api-004.md#source-d1feeccb517dfb14) + +- `Movie` — A movie shape, one that places a video on a slide. +- `Picture` — A picture shape, one that places an image on a slide. + +## `pptx.shapes.placeholder` + +Placeholder-related objects. + +Full contract: [shapes.placeholder.md](api-004.md#source-4ca2a6ba8179a22c) + +- `BasePlaceholder` — NOTE: This class is deprecated and will be removed from a future release +- `ChartPlaceholder` — Placeholder shape that can only accept a chart. +- `LayoutPlaceholder` — Placeholder shape on a slide layout. +- `MasterPlaceholder` — Placeholder shape on a slide master. +- `NotesSlidePlaceholder` — Placeholder shape on a notes slide. Inherits shape properties from the +- `PicturePlaceholder` — Placeholder shape that can only accept a picture. +- `PlaceholderGraphicFrame` — Placeholder shape populated with a table, chart, or smart art. +- `PlaceholderPicture` — Placeholder shape populated with a picture. +- `SlidePlaceholder` — Placeholder shape on a slide. Inherits shape properties from its +- `TablePlaceholder` — Placeholder shape that can only accept a table. + +## `pptx.shapes.shapetree` + +The shape tree, the structure that holds a slide's shapes. + +Full contract: [shapes.shapetree.md](api-004.md#source-76804c333460b9bb) + +- `BasePlaceholders` — Base class for placeholder collections. +- `BaseShapeFactory(shape_elm, parent) -> BaseShape` — Return an instance of the appropriate shape proxy class for `shape_elm`. +- `GroupShapes` — The sequence of child shapes belonging to a group shape. +- `LayoutPlaceholders` — Sequence of `LayoutPlaceholder` instance for each placeholder shape on a slide layout. +- `LayoutShapes` — Sequence of shapes appearing on a slide layout. +- `MasterPlaceholders` — Sequence of MasterPlaceholder representing the placeholder shapes on a slide master. +- `MasterShapes` — Sequence of shapes appearing on a slide master. +- `NotesSlidePlaceholders` — Sequence of placeholder shapes on a notes slide. +- `NotesSlideShapes` — Sequence of shapes appearing on a notes slide. +- `SlidePlaceholders` — Collection of placeholder shapes on a slide. +- `SlideShapeFactory(shape_elm, parent) -> BaseShape` — Return appropriate shape object for `shape_elm` on a slide. +- `SlideShapes` — Sequence of shapes appearing on a slide. + +## `pptx.shared` + +Objects shared by pptx modules. + +Full contract: [shared.md](api-004.md#source-645aca58a83de6fe) + +- `ElementProxy` — Base class for lxml element proxy classes. +- `ParentedElementProxy` — Provides access to ancestor objects and part. +- `PartElementProxy` — Provides common members for proxy-objects that wrap a part's root element, e.g. `p:sld`. + +## `pptx.slide` + +Slide-related objects, including masters, layouts, and notes. + +Full contract: [slide.md](api-004.md#source-c071261f71595b98) + +- `HeaderFooters` — Header/footer placeholder visibility flags of a layout or master (paper-pptx addition). +- `NotesMaster` — Proxy for the notes master XML document. +- `NotesSlide` — Notes slide object. +- `Slide` — Slide object. Provides access to shapes and slide-level properties. +- `SlideClonePolicy` — Relationship policy for `Slides.clone` (paper-pptx addition). +- `SlideLayout` — Slide layout object. +- `SlideLayouts` — Sequence of slide layouts belonging to a slide-master. +- `SlideMaster` — Slide master object. +- `SlideMasters` — Sequence of `SlideMaster` objects belonging to a presentation. +- `Slides` — Sequence of slides belonging to an instance of `Presentation`. + +## `pptx.slideops` + +Internal machinery for slide clone/delete/reorder (paper-pptx). Not public API. + +Full contract: [slideops.md](api-004.md#source-d4db30d15a010249) + +- `clone_slide_part(source_part, policy) -> 'SlidePart'` — Return a new `SlidePart` that is a policy-governed deep copy of `source_part`. +- `enroll_clone_in_section(presentation_elm, source_slide_id, clone_slide_id) -> None` — Add `clone_slide_id` to the section holding `source_slide_id`, directly after it. +- `remove_slide_from_id_lists(presentation_elm, slide_id, rId) -> None` — Purge `slide_id`/`rId` bookkeeping for a deleted slide from auxiliary ID lists. + +## `pptx.spec` + +Mappings from the ISO/IEC 29500 spec. + +Full contract: [spec.md](api-004.md#source-cf430719ccbe46f5) + +- `AdjustmentValue = 'tuple[str, int]'` +- `GRAPHIC_DATA_URI_CHART = 'http://schemas.openxmlformats.org/drawingml/2006/chart'` +- `GRAPHIC_DATA_URI_OLEOBJ = 'http://schemas.openxmlformats.org/presentationml/2006/ole'` +- `GRAPHIC_DATA_URI_TABLE = 'http://schemas.openxmlformats.org/drawingml/2006/table'` +- `ShapeSpec` +- `autoshape_types = {MSO_SHAPE.ACTION_BUTTON_BACK_OR_PREVIOUS: {'basename': 'Action Button: Back or Previous', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_BEGINNING: {'basename': 'Action Button: Beginning', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_CUSTOM: {'basename': 'Action Button: Custom', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_DOCUMENT: {'basename': 'Action Button: Document', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_END: {'basename': 'Action Button: End', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_FORWARD_OR_NEXT: {'basename': 'Action Button: Forward or Next', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_HELP: {'basename': 'Action Button: Help', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_HOME: {'basename': 'Action Button: Home', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_INFORMATION: {'basename': 'Action Button: Information', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_MOVIE: {'basename': 'Action Button: Movie', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_RETURN: {'basename': 'Action Button: Return', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_SOUND: {'basename': 'Action Button: Sound', 'avLst': ()}, MSO_SHAPE.ARC: {'basename': 'Arc', 'avLst': (('adj1', 16200000), ('adj2', 0))}, MSO_SHAPE.BALLOON: {'basename': 'Rounded Rectangular Callout', 'avLst': (('adj1', -20833), ('adj2', 62500), ('adj3', 16667))}, MSO_SHAPE.BENT_ARROW: {'basename': 'Bent Arrow', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 43750))}, MSO_SHAPE.BENT_UP_ARROW: {'basename': 'Bent-Up Arrow', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000))}, MSO_SHAPE.BEVEL: {'basename': 'Bevel', 'avLst': (('adj', 12500),)}, MSO_SHAPE.BLOCK_ARC: {'basename': 'Block Arc', 'avLst': (('adj1', 10800000), ('adj2', 0), ('adj3', 25000))}, MSO_SHAPE.CAN: {'basename': 'Can', 'avLst': (('adj', 25000),)}, MSO_SHAPE.CHART_PLUS: {'basename': 'Chart Plus', 'avLst': ()}, MSO_SHAPE.CHART_STAR: {'basename': 'Chart Star', 'avLst': ()}, MSO_SHAPE.CHART_X: {'basename': 'Chart X', 'avLst': ()}, MSO_SHAPE.CHEVRON: {'basename': 'Chevron', 'avLst': (('adj', 50000),)}, MSO_SHAPE.CHORD: {'basename': 'Chord', 'avLst': (('adj1', 2700000), ('adj2', 16200000))}, MSO_SHAPE.CIRCULAR_ARROW: {'basename': 'Circular Arrow', 'avLst': (('adj1', 12500), ('adj2', 1142319), ('adj3', 20457681), ('adj4', 10800000), ('adj5', 12500))}, MSO_SHAPE.CLOUD: {'basename': 'Cloud', 'avLst': ()}, MSO_SHAPE.CLOUD_CALLOUT: {'basename': 'Cloud Callout', 'avLst': (('adj1', -20833), ('adj2', 62500))}, MSO_SHAPE.CORNER: {'basename': 'Corner', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.CORNER_TABS: {'basename': 'Corner Tabs', 'avLst': ()}, MSO_SHAPE.CROSS: {'basename': 'Cross', 'avLst': (('adj', 25000),)}, MSO_SHAPE.CUBE: {'basename': 'Cube', 'avLst': (('adj', 25000),)}, MSO_SHAPE.CURVED_DOWN_ARROW: {'basename': 'Curved Down Arrow', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 25000))}, MSO_SHAPE.CURVED_DOWN_RIBBON: {'basename': 'Curved Down Ribbon', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 12500))}, MSO_SHAPE.CURVED_LEFT_ARROW: {'basename': 'Curved Left Arrow', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 25000))}, MSO_SHAPE.CURVED_RIGHT_ARROW: {'basename': 'Curved Right Arrow', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 25000))}, MSO_SHAPE.CURVED_UP_ARROW: {'basename': 'Curved Up Arrow', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 25000))}, MSO_SHAPE.CURVED_UP_RIBBON: {'basename': 'Curved Up Ribbon', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 12500))}, MSO_SHAPE.DECAGON: {'basename': 'Decagon', 'avLst': (('vf', 105146),)}, MSO_SHAPE.DIAGONAL_STRIPE: {'basename': 'Diagonal Stripe', 'avLst': (('adj', 50000),)}, MSO_SHAPE.DIAMOND: {'basename': 'Diamond', 'avLst': ()}, MSO_SHAPE.DODECAGON: {'basename': 'Dodecagon', 'avLst': ()}, MSO_SHAPE.DONUT: {'basename': 'Donut', 'avLst': (('adj', 25000),)}, MSO_SHAPE.DOUBLE_BRACE: {'basename': 'Double Brace', 'avLst': (('adj', 8333),)}, MSO_SHAPE.DOUBLE_BRACKET: {'basename': 'Double Bracket', 'avLst': (('adj', 16667),)}, MSO_SHAPE.DOUBLE_WAVE: {'basename': 'Double Wave', 'avLst': (('adj1', 6250), ('adj2', 0))}, MSO_SHAPE.DOWN_ARROW: {'basename': 'Down Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.DOWN_ARROW_CALLOUT: {'basename': 'Down Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 64977))}, MSO_SHAPE.DOWN_RIBBON: {'basename': 'Down Ribbon', 'avLst': (('adj1', 16667), ('adj2', 50000))}, MSO_SHAPE.EXPLOSION1: {'basename': 'Explosion', 'avLst': ()}, MSO_SHAPE.EXPLOSION2: {'basename': 'Explosion', 'avLst': ()}, MSO_SHAPE.FLOWCHART_ALTERNATE_PROCESS: {'basename': 'Alternate process', 'avLst': ()}, MSO_SHAPE.FLOWCHART_CARD: {'basename': 'Card', 'avLst': ()}, MSO_SHAPE.FLOWCHART_COLLATE: {'basename': 'Collate', 'avLst': ()}, MSO_SHAPE.FLOWCHART_CONNECTOR: {'basename': 'Connector', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DATA: {'basename': 'Data', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DECISION: {'basename': 'Decision', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DELAY: {'basename': 'Delay', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DIRECT_ACCESS_STORAGE: {'basename': 'Direct Access Storage', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DISPLAY: {'basename': 'Display', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DOCUMENT: {'basename': 'Document', 'avLst': ()}, MSO_SHAPE.FLOWCHART_EXTRACT: {'basename': 'Extract', 'avLst': ()}, MSO_SHAPE.FLOWCHART_INTERNAL_STORAGE: {'basename': 'Internal Storage', 'avLst': ()}, MSO_SHAPE.FLOWCHART_MAGNETIC_DISK: {'basename': 'Magnetic Disk', 'avLst': ()}, MSO_SHAPE.FLOWCHART_MANUAL_INPUT: {'basename': 'Manual Input', 'avLst': ()}, MSO_SHAPE.FLOWCHART_MANUAL_OPERATION: {'basename': 'Manual Operation', 'avLst': ()}, MSO_SHAPE.FLOWCHART_MERGE: {'basename': 'Merge', 'avLst': ()}, MSO_SHAPE.FLOWCHART_MULTIDOCUMENT: {'basename': 'Multidocument', 'avLst': ()}, MSO_SHAPE.FLOWCHART_OFFLINE_STORAGE: {'basename': 'Offline Storage', 'avLst': ()}, MSO_SHAPE.FLOWCHART_OFFPAGE_CONNECTOR: {'basename': 'Off-page Connector', 'avLst': ()}, MSO_SHAPE.FLOWCHART_OR: {'basename': 'Or', 'avLst': ()}, MSO_SHAPE.FLOWCHART_PREDEFINED_PROCESS: {'basename': 'Predefined Process', 'avLst': ()}, MSO_SHAPE.FLOWCHART_PREPARATION: {'basename': 'Preparation', 'avLst': ()}, MSO_SHAPE.FLOWCHART_PROCESS: {'basename': 'Process', 'avLst': ()}, MSO_SHAPE.FLOWCHART_PUNCHED_TAPE: {'basename': 'Punched Tape', 'avLst': ()}, MSO_SHAPE.FLOWCHART_SEQUENTIAL_ACCESS_STORAGE: {'basename': 'Sequential Access Storage', 'avLst': ()}, MSO_SHAPE.FLOWCHART_SORT: {'basename': 'Sort', 'avLst': ()}, MSO_SHAPE.FLOWCHART_STORED_DATA: {'basename': 'Stored Data', 'avLst': ()}, MSO_SHAPE.FLOWCHART_SUMMING_JUNCTION: {'basename': 'Summing Junction', 'avLst': ()}, MSO_SHAPE.FLOWCHART_TERMINATOR: {'basename': 'Terminator', 'avLst': ()}, MSO_SHAPE.FOLDED_CORNER: {'basename': 'Folded Corner', 'avLst': ()}, MSO_SHAPE.FRAME: {'basename': 'Frame', 'avLst': (('adj1', 12500),)}, MSO_SHAPE.FUNNEL: {'basename': 'Funnel', 'avLst': ()}, MSO_SHAPE.GEAR_6: {'basename': 'Gear 6', 'avLst': (('adj1', 15000), ('adj2', 3526))}, MSO_SHAPE.GEAR_9: {'basename': 'Gear 9', 'avLst': (('adj1', 10000), ('adj2', 1763))}, MSO_SHAPE.HALF_FRAME: {'basename': 'Half Frame', 'avLst': (('adj1', 33333), ('adj2', 33333))}, MSO_SHAPE.HEART: {'basename': 'Heart', 'avLst': ()}, MSO_SHAPE.HEPTAGON: {'basename': 'Heptagon', 'avLst': (('hf', 102572), ('vf', 105210))}, MSO_SHAPE.HEXAGON: {'basename': 'Hexagon', 'avLst': (('adj', 25000), ('vf', 115470))}, MSO_SHAPE.HORIZONTAL_SCROLL: {'basename': 'Horizontal Scroll', 'avLst': (('adj', 12500),)}, MSO_SHAPE.ISOSCELES_TRIANGLE: {'basename': 'Isosceles Triangle', 'avLst': (('adj', 50000),)}, MSO_SHAPE.LEFT_ARROW: {'basename': 'Left Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.LEFT_ARROW_CALLOUT: {'basename': 'Left Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 64977))}, MSO_SHAPE.LEFT_BRACE: {'basename': 'Left Brace', 'avLst': (('adj1', 8333), ('adj2', 50000))}, MSO_SHAPE.LEFT_BRACKET: {'basename': 'Left Bracket', 'avLst': (('adj', 8333),)}, MSO_SHAPE.LEFT_CIRCULAR_ARROW: {'basename': 'Left Circular Arrow', 'avLst': (('adj1', 12500), ('adj2', -1142319), ('adj3', 1142319), ('adj4', 10800000), ('adj5', 12500))}, MSO_SHAPE.LEFT_RIGHT_ARROW: {'basename': 'Left-Right Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.LEFT_RIGHT_ARROW_CALLOUT: {'basename': 'Left-Right Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 48123))}, MSO_SHAPE.LEFT_RIGHT_CIRCULAR_ARROW: {'basename': 'Left Right Circular Arrow', 'avLst': (('adj1', 12500), ('adj2', 1142319), ('adj3', 20457681), ('adj4', 11942319), ('adj5', 12500))}, MSO_SHAPE.LEFT_RIGHT_RIBBON: {'basename': 'Left Right Ribbon', 'avLst': (('adj1', 50000), ('adj2', 50000), ('adj3', 16667))}, MSO_SHAPE.LEFT_RIGHT_UP_ARROW: {'basename': 'Left-Right-Up Arrow', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000))}, MSO_SHAPE.LEFT_UP_ARROW: {'basename': 'Left-Up Arrow', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000))}, MSO_SHAPE.LIGHTNING_BOLT: {'basename': 'Lightning Bolt', 'avLst': ()}, MSO_SHAPE.LINE_CALLOUT_1: {'basename': 'Line Callout 1', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 112500), ('adj4', -38333))}, MSO_SHAPE.LINE_CALLOUT_1_ACCENT_BAR: {'basename': 'Line Callout 1 (Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 112500), ('adj4', -38333))}, MSO_SHAPE.LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR: {'basename': 'Line Callout 1 (Border and Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 112500), ('adj4', -38333))}, MSO_SHAPE.LINE_CALLOUT_1_NO_BORDER: {'basename': 'Line Callout 1 (No Border)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 112500), ('adj4', -38333))}, MSO_SHAPE.LINE_CALLOUT_2: {'basename': 'Line Callout 2', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 112500), ('adj6', -46667))}, MSO_SHAPE.LINE_CALLOUT_2_ACCENT_BAR: {'basename': 'Line Callout 2 (Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 112500), ('adj6', -46667))}, MSO_SHAPE.LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR: {'basename': 'Line Callout 2 (Border and Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 112500), ('adj6', -46667))}, MSO_SHAPE.LINE_CALLOUT_2_NO_BORDER: {'basename': 'Line Callout 2 (No Border)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 112500), ('adj6', -46667))}, MSO_SHAPE.LINE_CALLOUT_3: {'basename': 'Line Callout 3', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_3_ACCENT_BAR: {'basename': 'Line Callout 3 (Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR: {'basename': 'Line Callout 3 (Border and Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_3_NO_BORDER: {'basename': 'Line Callout 3 (No Border)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_4: {'basename': 'Line Callout 3', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_4_ACCENT_BAR: {'basename': 'Line Callout 3 (Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR: {'basename': 'Line Callout 3 (Border and Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_4_NO_BORDER: {'basename': 'Line Callout 3 (No Border)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_INVERSE: {'basename': 'Straight Connector', 'avLst': ()}, MSO_SHAPE.MATH_DIVIDE: {'basename': 'Division', 'avLst': (('adj1', 23520), ('adj2', 5880), ('adj3', 11760))}, MSO_SHAPE.MATH_EQUAL: {'basename': 'Equal', 'avLst': (('adj1', 23520), ('adj2', 11760))}, MSO_SHAPE.MATH_MINUS: {'basename': 'Minus', 'avLst': (('adj1', 23520),)}, MSO_SHAPE.MATH_MULTIPLY: {'basename': 'Multiply', 'avLst': (('adj1', 23520),)}, MSO_SHAPE.MATH_NOT_EQUAL: {'basename': 'Not Equal', 'avLst': (('adj1', 23520), ('adj2', 6600000), ('adj3', 11760))}, MSO_SHAPE.MATH_PLUS: {'basename': 'Plus', 'avLst': (('adj1', 23520),)}, MSO_SHAPE.MOON: {'basename': 'Moon', 'avLst': (('adj', 50000),)}, MSO_SHAPE.NON_ISOSCELES_TRAPEZOID: {'basename': 'Non-isosceles Trapezoid', 'avLst': (('adj1', 25000), ('adj2', 25000))}, MSO_SHAPE.NOTCHED_RIGHT_ARROW: {'basename': 'Notched Right Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.NO_SYMBOL: {'basename': '"No" Symbol', 'avLst': (('adj', 18750),)}, MSO_SHAPE.OCTAGON: {'basename': 'Octagon', 'avLst': (('adj', 29289),)}, MSO_SHAPE.OVAL: {'basename': 'Oval', 'avLst': ()}, MSO_SHAPE.OVAL_CALLOUT: {'basename': 'Oval Callout', 'avLst': (('adj1', -20833), ('adj2', 62500))}, MSO_SHAPE.PARALLELOGRAM: {'basename': 'Parallelogram', 'avLst': (('adj', 25000),)}, MSO_SHAPE.PENTAGON: {'basename': 'Pentagon', 'avLst': (('adj', 50000),)}, MSO_SHAPE.PIE: {'basename': 'Pie', 'avLst': (('adj1', 0), ('adj2', 16200000))}, MSO_SHAPE.PIE_WEDGE: {'basename': 'Pie', 'avLst': ()}, MSO_SHAPE.PLAQUE: {'basename': 'Plaque', 'avLst': (('adj', 16667),)}, MSO_SHAPE.PLAQUE_TABS: {'basename': 'Plaque Tabs', 'avLst': ()}, MSO_SHAPE.QUAD_ARROW: {'basename': 'Quad Arrow', 'avLst': (('adj1', 22500), ('adj2', 22500), ('adj3', 22500))}, MSO_SHAPE.QUAD_ARROW_CALLOUT: {'basename': 'Quad Arrow Callout', 'avLst': (('adj1', 18515), ('adj2', 18515), ('adj3', 18515), ('adj4', 48123))}, MSO_SHAPE.RECTANGLE: {'basename': 'Rectangle', 'avLst': ()}, MSO_SHAPE.RECTANGULAR_CALLOUT: {'basename': 'Rectangular Callout', 'avLst': (('adj1', -20833), ('adj2', 62500))}, MSO_SHAPE.REGULAR_PENTAGON: {'basename': 'Regular Pentagon', 'avLst': (('hf', 105146), ('vf', 110557))}, MSO_SHAPE.RIGHT_ARROW: {'basename': 'Right Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.RIGHT_ARROW_CALLOUT: {'basename': 'Right Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 64977))}, MSO_SHAPE.RIGHT_BRACE: {'basename': 'Right Brace', 'avLst': (('adj1', 8333), ('adj2', 50000))}, MSO_SHAPE.RIGHT_BRACKET: {'basename': 'Right Bracket', 'avLst': (('adj', 8333),)}, MSO_SHAPE.RIGHT_TRIANGLE: {'basename': 'Right Triangle', 'avLst': ()}, MSO_SHAPE.ROUNDED_RECTANGLE: {'basename': 'Rounded Rectangle', 'avLst': (('adj', 16667),)}, MSO_SHAPE.ROUNDED_RECTANGULAR_CALLOUT: {'basename': 'Rounded Rectangular Callout', 'avLst': (('adj1', -20833), ('adj2', 62500), ('adj3', 16667))}, MSO_SHAPE.ROUND_1_RECTANGLE: {'basename': 'Round Single Corner Rectangle', 'avLst': (('adj', 16667),)}, MSO_SHAPE.ROUND_2_DIAG_RECTANGLE: {'basename': 'Round Diagonal Corner Rectangle', 'avLst': (('adj1', 16667), ('adj2', 0))}, MSO_SHAPE.ROUND_2_SAME_RECTANGLE: {'basename': 'Round Same Side Corner Rectangle', 'avLst': (('adj1', 16667), ('adj2', 0))}, MSO_SHAPE.SMILEY_FACE: {'basename': 'Smiley Face', 'avLst': (('adj', 4653),)}, MSO_SHAPE.SNIP_1_RECTANGLE: {'basename': 'Snip Single Corner Rectangle', 'avLst': (('adj', 16667),)}, MSO_SHAPE.SNIP_2_DIAG_RECTANGLE: {'basename': 'Snip Diagonal Corner Rectangle', 'avLst': (('adj1', 0), ('adj2', 16667))}, MSO_SHAPE.SNIP_2_SAME_RECTANGLE: {'basename': 'Snip Same Side Corner Rectangle', 'avLst': (('adj1', 16667), ('adj2', 0))}, MSO_SHAPE.SNIP_ROUND_RECTANGLE: {'basename': 'Snip and Round Single Corner Rectangle', 'avLst': (('adj1', 16667), ('adj2', 16667))}, MSO_SHAPE.SQUARE_TABS: {'basename': 'Square Tabs', 'avLst': ()}, MSO_SHAPE.STAR_10_POINT: {'basename': '10-Point Star', 'avLst': (('adj', 42533), ('hf', 105146))}, MSO_SHAPE.STAR_12_POINT: {'basename': '12-Point Star', 'avLst': (('adj', 37500),)}, MSO_SHAPE.STAR_16_POINT: {'basename': '16-Point Star', 'avLst': (('adj', 37500),)}, MSO_SHAPE.STAR_24_POINT: {'basename': '24-Point Star', 'avLst': (('adj', 37500),)}, MSO_SHAPE.STAR_32_POINT: {'basename': '32-Point Star', 'avLst': (('adj', 37500),)}, MSO_SHAPE.STAR_4_POINT: {'basename': '4-Point Star', 'avLst': (('adj', 12500),)}, MSO_SHAPE.STAR_5_POINT: {'basename': '5-Point Star', 'avLst': (('adj', 19098), ('hf', 105146), ('vf', 110557))}, MSO_SHAPE.STAR_6_POINT: {'basename': '6-Point Star', 'avLst': (('adj', 28868), ('hf', 115470))}, MSO_SHAPE.STAR_7_POINT: {'basename': '7-Point Star', 'avLst': (('adj', 34601), ('hf', 102572), ('vf', 105210))}, MSO_SHAPE.STAR_8_POINT: {'basename': '8-Point Star', 'avLst': (('adj', 37500),)}, MSO_SHAPE.STRIPED_RIGHT_ARROW: {'basename': 'Striped Right Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.SUN: {'basename': 'Sun', 'avLst': (('adj', 25000),)}, MSO_SHAPE.SWOOSH_ARROW: {'basename': 'Swoosh Arrow', 'avLst': (('adj1', 25000), ('adj2', 16667))}, MSO_SHAPE.TEAR: {'basename': 'Teardrop', 'avLst': (('adj', 100000),)}, MSO_SHAPE.TRAPEZOID: {'basename': 'Trapezoid', 'avLst': (('adj', 25000),)}, MSO_SHAPE.UP_ARROW: {'basename': 'Up Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.UP_ARROW_CALLOUT: {'basename': 'Up Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 64977))}, MSO_SHAPE.UP_DOWN_ARROW: {'basename': 'Up-Down Arrow', 'avLst': (('adj1', 50000), ('adj1', 50000), ('adj2', 50000), ('adj2', 50000))}, MSO_SHAPE.UP_DOWN_ARROW_CALLOUT: {'basename': 'Up-Down Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 48123))}, MSO_SHAPE.UP_RIBBON: {'basename': 'Up Ribbon', 'avLst': (('adj1', 16667), ('adj2', 50000))}, MSO_SHAPE.U_TURN_ARROW: {'basename': 'U-Turn Arrow', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 43750), ('adj5', 75000))}, MSO_SHAPE.VERTICAL_SCROLL: {'basename': 'Vertical Scroll', 'avLst': (('adj', 12500),)}, MSO_SHAPE.WAVE: {'basename': 'Wave', 'avLst': (('adj1', 12500), ('adj2', 0))}}` + +## `pptx.table` + +Table-related objects such as Table and Cell. + +Full contract: [table.md](api-004.md#source-eeaf22cc77d18fa9) + +- `Table` — A DrawingML table object. + +## `pptx.text.bullet` + +BulletFormat proxy, providing bullet and numbering control for a paragraph (paper-pptx). + +Full contract: [text.bullet.md](api-005.md#source-7265f22343afe4ee) + +- `BulletFormat` — Bullet and numbering state of a single paragraph. +- `DEFAULT_BULLET_HANGING_INDENT = Emu(171450)` +- `DEFAULT_BULLET_LEFT_MARGIN = Emu(342900)` + +## `pptx.text.fonts` + +Objects related to system font file lookup. + +Full contract: [text.fonts.md](api-005.md#source-c6ff4d26749bee76) + +- `FontFiles` — A class-based singleton serving as a lazy cache for system font details. + +## `pptx.text.layout` + +Objects related to layout of rendered text, such as TextFitter. + +Full contract: [text.layout.md](api-005.md#source-720ef7cbb39d9baa) + +- `TextFitter` — Value object that knows how to fit text into given rectangular extents. + +## `pptx.text.text` + +Text-related objects such as TextFrame and Paragraph. + +Full contract: [text.text.md](api-005.md#source-641574f4f1a6c03b) + +- `Font` — Character properties object, providing font size, font name, bold, italic, etc. +- `TextFrame` — The part of a shape that contains its text. + +## `pptx.types` + +Abstract types used by `python-pptx`. + +Full contract: [types.md](api-005.md#source-8c8b08f561ed110c) + +- `ProvidesExtents` — An object that has width and height. +- `ProvidesPart` — An object that provides access to its XmlPart. + +## `pptx.util` + +Utility functions and classes. + +Full contract: [util.md](api-005.md#source-c6f3b84c67d06ef5) + +- `Centipoints` — Convenience constructor for length in hundredths of a point. +- `Cm` — Convenience constructor for length in centimeters. +- `Emu` — Convenience constructor for length in english metric units. +- `Inches` — Convenience constructor for length in inches. +- `Length` — Base class for length classes Inches, Emu, Cm, Mm, and Pt. +- `Mm` — Convenience constructor for length in millimeters. +- `Pt` — Convenience value class for specifying a length in points. +- `lazyproperty` — Decorator like @property, but evaluated only on first access. + + + + + +# `pptx.inspect` + +Effective-style inspection: resolved font values with provenance (paper-pptx). + +## `BULLET_FOLLOWS_TEXT` + +```python +BULLET_FOLLOWS_TEXT = 'follow text' +``` + +## `BlockAnchor` + +```python +BlockAnchor(part: str, block_index: int, content_hash: str, version: Optional[int] = None, locator: Optional[dict] = None) -> None +``` + +A structural current anchor or conservative three-field legacy anchor. + +Fields: + +* ``part`` -- partname of the story the block lives in (a slide or notes slide). +* ``block_index`` -- diagnostic 0-based part traversal index. Current anchors never use it + as write identity. +* ``content_hash`` -- a current full structural fingerprint, or the pinned eight-character + text hash on a legacy anchor. +* ``version`` -- current anchor schema version; absent on legacy anchors. +* ``locator`` -- exact container identity and container-local paragraph coordinates. + +Existing ``BlockAnchor(part, block_index, content_hash)`` construction remains valid and +creates a legacy anchor. Legacy writes search the named part for an exact unique hash match. + +### `block_index` + +```python +block_index: int +``` + +### `content_hash` + +```python +content_hash: str +``` + +### `is_legacy` + +```python +is_legacy: bool +``` + +Whether this is an old three-field anchor without structural identity. + +### `locator` + +```python +locator: Optional[dict] = None +``` + +### `part` + +```python +part: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this anchor as a JSON-ready dict. Store it to re-target the same text block on a +later open. + +### `version` + +```python +version: Optional[int] = None +``` + +## `DECK_MANIFEST_SCHEMA` + +```python +DECK_MANIFEST_SCHEMA = 'paper-deck-manifest' +``` + +## `DECK_MANIFEST_VERSION` + +```python +DECK_MANIFEST_VERSION = 1 +``` + +## `DeckManifest` + +```python +DeckManifest(slide_width: Optional[int], slide_height: Optional[int], slides: Tuple[SlideManifest, ...], masters: Tuple[dict, ...]) -> None +``` + +Structural survey of a whole deck. `.to_dict()` is deterministic (golden-tested). + +### `masters` + +```python +masters: Tuple[dict, ...] +``` + +### `slide_count` + +```python +slide_count: int +``` + +Number of slides the manifest describes. + +### `slide_height` + +```python +slide_height: Optional[int] +``` + +### `slide_width` + +```python +slide_width: Optional[int] +``` + +### `slides` + +```python +slides: Tuple[SlideManifest, ...] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the deck manifest as a JSON-ready dict stamped with its schema and version. + +This is the payload to hand a caller that cannot hold Python objects. + +## `EffectiveBullet` + +```python +EffectiveBullet(type: Optional[str], char: Optional[str], number_scheme: Optional[str], start_at: Optional[int], resolved: bool, provenance: Tuple[ProvenanceStep, ...]) -> None +``` + +The bullet that actually renders on one paragraph, with its provenance chain. + +### `char` + +```python +char: Optional[str] +``` + +### `number_scheme` + +```python +number_scheme: Optional[str] +``` + +### `provenance` + +```python +provenance: Tuple[ProvenanceStep, ...] +``` + +### `resolved` + +```python +resolved: bool +``` + +### `start_at` + +```python +start_at: Optional[int] +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the resolved bullet as a JSON-ready dict, recording whether the answer came from +this paragraph or an inherited level. + +### `type` + +```python +type: Optional[str] +``` + +## `EffectiveFont` + +```python +EffectiveFont(size: EffectiveValue, name: EffectiveValue, color_rgb: EffectiveValue, bold: EffectiveValue = None, italic: EffectiveValue = None, underline: EffectiveValue = None) -> None +``` + +Effective size, name, color, and emphasis of one run. + +### `bold` + +```python +bold: EffectiveValue = None +``` + +### `color_rgb` + +```python +color_rgb: EffectiveValue +``` + +### `italic` + +```python +italic: EffectiveValue = None +``` + +### `name` + +```python +name: EffectiveValue +``` + +### `size` + +```python +size: EffectiveValue +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the resolved font as a JSON-ready dict under the `paper-effective-font` schema. + +Use it to report or diff typography without walking the inheritance chain again. + +### `underline` + +```python +underline: EffectiveValue = None +``` + +## `EffectiveParagraphFormat` + +```python +EffectiveParagraphFormat(alignment: EffectiveValue, line_spacing: EffectiveValue, bullet: EffectiveBullet, bullet_font: EffectiveValue, bullet_size: EffectiveValue) -> None +``` + +Effective alignment, line spacing, and bullet of one paragraph (paper-pptx addition). + +### `alignment` + +```python +alignment: EffectiveValue +``` + +### `bullet` + +```python +bullet: EffectiveBullet +``` + +### `bullet_font` + +```python +bullet_font: EffectiveValue +``` + +### `bullet_size` + +```python +bullet_size: EffectiveValue +``` + +### `line_spacing` + +```python +line_spacing: EffectiveValue +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the resolved paragraph format as a JSON-ready dict under the `paper-effective- +paragraph-format` schema. + +## `EffectiveShapeFormat` + +```python +EffectiveShapeFormat(fill_rgb: EffectiveValue, line_rgb: EffectiveValue) -> None +``` + +Effective solid fill and line color of one shape (paper-pptx addition). + +It resolves EXPLICIT `p:spPr` fills fully (solid colors through the scheme/clrMap/ +theme walk; "none" for noFill). A shape whose fill comes only from its `p:style` +fill/line reference reports unresolved — the provenance carries the reference index and +its resolved phClr color, but theme format-scheme modulation is not applied (guessing it +would violate fail-loudly). + +### `fill_rgb` + +```python +fill_rgb: EffectiveValue +``` + +### `line_rgb` + +```python +line_rgb: EffectiveValue +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the resolved fill and line colors as a JSON-ready dict. + +## `EffectiveValue` + +```python +EffectiveValue(value: object, value_pt: Optional[float], resolved: bool, provenance: Tuple[ProvenanceStep, ...], bake_color_xml: Optional[bytes] = None) -> None +``` + +A resolved (or honestly-unresolved) effective value with its provenance chain. + +### `bake_color_xml` + +```python +bake_color_xml: Optional[bytes] = field(default=None, repr=False, compare=False) +``` + +### `provenance` + +```python +provenance: Tuple[ProvenanceStep, ...] +``` + +### `resolved` + +```python +resolved: bool +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this resolved value as a JSON-ready dict, provenance trail included. + +### `value` + +```python +value: object +``` + +### `value_pt` + +```python +value_pt: Optional[float] +``` + +## `InspectedRun` + +```python +InspectedRun(text: str, font: EffectiveFont, field_type: Optional[str] = None) -> None +``` + +One run of text paired with the font that renders it. + +### `field_type` + +```python +field_type: Optional[str] = None +``` + +### `font` + +```python +font: EffectiveFont +``` + +### `text` + +```python +text: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this run as a JSON-ready dict, omitting `field_type` for ordinary text. + +## `ProvenanceStep` + +```python +ProvenanceStep(level: str, part: Optional[str], detail: str, supplied: bool) -> None +``` + +One consulted level of an inheritance walk. + +### `detail` + +```python +detail: str +``` + +### `level` + +```python +level: str +``` + +### `part` + +```python +part: Optional[str] +``` + +### `supplied` + +```python +supplied: bool +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this rung as a JSON-ready dict, for reports that show where a value came from. + +## `SCHEMA_NAME` + +```python +SCHEMA_NAME = 'paper-text-inspection' +``` + +## `SCHEMA_VERSION` + +```python +SCHEMA_VERSION = 3 +``` + +## `ShapeManifest` + +```python +ShapeManifest(shape_id: int, name: str, kind: str, z_index: int, placeholder_type: Optional[str], x: Optional[int], y: Optional[int], cx: Optional[int], cy: Optional[int], rotation: Optional[float], text_block_count: int, autofit: Optional[dict], table: Optional[dict], chart: Optional[dict], image: Optional[dict], children: Tuple['ShapeManifest', ...] = ()) -> None +``` + +Structural facts of one shape (paper-pptx addition). Group children nest. + +### `autofit` + +```python +autofit: Optional[dict] +``` + +### `chart` + +```python +chart: Optional[dict] +``` + +### `children` + +```python +children: Tuple['ShapeManifest', ...] = () +``` + +### `cx` + +```python +cx: Optional[int] +``` + +### `cy` + +```python +cy: Optional[int] +``` + +### `image` + +```python +image: Optional[dict] +``` + +### `kind` + +```python +kind: str +``` + +### `name` + +```python +name: str +``` + +### `placeholder_type` + +```python +placeholder_type: Optional[str] +``` + +### `rotation` + +```python +rotation: Optional[float] +``` + +### `shape_id` + +```python +shape_id: int +``` + +### `table` + +```python +table: Optional[dict] +``` + +### `text_block_count` + +```python +text_block_count: int +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this shape's manifest entry as a JSON-ready dict. + +### `x` + +```python +x: Optional[int] +``` + +### `y` + +```python +y: Optional[int] +``` + +### `z_index` + +```python +z_index: int +``` + +## `SlideManifest` + +```python +SlideManifest(part: str, slide_id: int, layout_name: str, has_notes: bool, shapes: Tuple[ShapeManifest, ...], alternate_content_count: int = 0) -> None +``` + +Structural facts of one slide. + +### `alternate_content_count` + +```python +alternate_content_count: int = 0 +``` + +### `has_notes` + +```python +has_notes: bool +``` + +### `layout_name` + +```python +layout_name: str +``` + +### `part` + +```python +part: str +``` + +### `shapes` + +```python +shapes: Tuple[ShapeManifest, ...] +``` + +### `slide_id` + +```python +slide_id: int +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this slide's manifest entry as a JSON-ready dict, shapes included. + +## `TextBlock` + +```python +TextBlock(anchor: BlockAnchor, shape_id: int, shape_name: str, placeholder_type: Optional[str], level: int, text: str, runs: Tuple[InspectedRun, ...], container: str = 'shape', container_detail: Optional[str] = None, blind: bool = False, fields: Tuple[str, ...] = ()) -> None +``` + +One paragraph of one text body, with anchor and per-run effective fonts. + +`container` says where the text lives: "shape" (a top-level `p:sp`), "group" (a `p:sp` +inside `p:grpSp` nesting; `container_detail` is the slash-joined group-name path), or +"table-cell" (`container_detail` is `"!r{row}c{col}"`). `blind` is True when +the block's *text* is visible but its effective values are unresolvable by design in +this version (table-cell runs inherit through table styles, a chain not yet walked); +a blind block's runs carry `resolved=False` values, never guesses. + +### `anchor` + +```python +anchor: BlockAnchor +``` + +### `blind` + +```python +blind: bool = False +``` + +### `container` + +```python +container: str = 'shape' +``` + +### `container_detail` + +```python +container_detail: Optional[str] = None +``` + +### `fields` + +```python +fields: Tuple[str, ...] = () +``` + +### `level` + +```python +level: int +``` + +### `placeholder_type` + +```python +placeholder_type: Optional[str] +``` + +### `runs` + +```python +runs: Tuple[InspectedRun, ...] +``` + +### `shape_id` + +```python +shape_id: int +``` + +### `shape_name` + +```python +shape_name: str +``` + +### `text` + +```python +text: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this block as a JSON-ready dict, anchor included, for reports and diffs. + +## `TextInspection` + +```python +TextInspection(part: str, blocks: Tuple[TextBlock, ...] = tuple()) -> None +``` + +Inspection payload for one slide. `.to_dict()` is deterministic (golden-tested). + +### `blind_region_count` + +```python +blind_region_count: int +``` + +Number of blocks whose effective values are unresolvable by design (see TextBlock). + +### `blocks` + +```python +blocks: Tuple[TextBlock, ...] = field(default_factory=tuple) +``` + +### `part` + +```python +part: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the whole inspection as a JSON-ready dict stamped with its schema name and +version. + +Hand this to anything outside Python that needs the text of a part. + +## `content_hash` + +```python +content_hash(text: str) -> str +``` + +First 8 hex chars of SHA-256 over the NFC-normalized text (the pinned anchor hash). + +Unicode normalization only — whitespace is content and is never trimmed. + +## `effective_font` + +```python +effective_font(run: '_Run') -> EffectiveFont +``` + +Return the `EffectiveFont` for `run`, a `_Run` on a slide shape. + +Raises `UnsupportedStructureError` for runs outside a `p:sp` shape on a slide part +(table-cell and chart text are not resolved). + +## `effective_paragraph_format` + +```python +effective_paragraph_format(paragraph) -> EffectiveParagraphFormat +``` + +Return effective alignment, line spacing, and bullet for `paragraph`, with provenance. + +Same inheritance walk as `effective_font`, over paragraph-level properties: the +paragraph's own `a:pPr`, the shape's `lstStyle` level entry, the placeholder chain (or +the presentation's `defaultTextStyle`). Exhaustion resolves rather than reporting +unresolved: to the ECMA-376 schema default for alignment (left), and to the rendering +conventions for line spacing (single), bullet (no bullet), and bullet typeface/size +(follow the text), none of which the schema defines. + +The bullet's kind, typeface, and size are three separate XSD choice groups that inherit +independently, so each is walked on its own and carries its own provenance. A paragraph +can take its `buChar` from the master and its `buSzPct` from the layout. + +## `effective_shape_format` + +```python +effective_shape_format(shape) -> EffectiveShapeFormat +``` + +Return the effective solid fill and line color of `shape`, with provenance. + +## `inspect_deck` + +```python +inspect_deck(prs) -> DeckManifest +``` + +Return a structural `DeckManifest` of `prs` (paper-pptx addition). + +The survey every brownfield edit starts with, as one deterministic typed payload: +per-slide shape inventory (identity, kind, z-order, geometry where explicit, placeholder +role, table/chart/image/autofit facts), group children nested, layout and master +inventory. Values that are inherited rather than explicit report None — never a guess. +Read-only. + +## `inspect_text` + +```python +inspect_text(slide: 'Slide') -> TextInspection +``` + +Return a `TextInspection` of every text block on `slide`, visibility-complete. + +Traversal is depth-first document order over the shape tree: top-level `p:sp` shapes, +`p:sp` shapes inside groups (recursively, to any depth), and table cells +(row-major within each table graphic-frame). `block_index` numbers blocks consecutively +in that pinned order for diagnostics only; current anchors address their owning shape or +table cell structurally. Table-cell blocks report their text but are *blind regions* for +effective values (see `TextBlock`); chart text lives in the chart part, not the slide +part, and is out of scope here. + +## `iter_text_bodies` + +```python +iter_text_bodies(spTree) +``` + +Yield `(kind, owner_elm, txBody, group_path, cell_coordinates)` in document order. + +The single source of traversal truth shared by `inspect_text` and `pptx.edit` +(visibility-complete: top-level `p:sp`, grouped `p:sp` recursively to any depth, +table cells row-major). `kind` is "shape" | "group" | "table-cell"; `owner_elm` is the +`p:sp` or `p:graphicFrame`; `cell_coordinates` is ``(row, column)`` for table cells and +`None` otherwise. Display-oriented cell detail is assembled only by inspection callers. + + + + + +# `pptx.media` + +Objects related to images, audio, and video. + +## `SPEAKER_IMAGE_BYTES` + +```python +SPEAKER_IMAGE_BYTES = base64.b64decode('iVBORw0KGgoAAAANSUhEUgAAAHgAAAA3CAYAAADHao5rAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAACJ5JREFUeNrsm19oW9cdx7/n/tO9uleS9ceWZMdO68Su0jiEmNCGLVsDg+J16xhkYx0UM1ayvS19SQZ7WfK6PWR7Gax0S9n24JGFlbGNPIRgEkKWZC1u6rizHMXxv1iWJdnWvbqS7p9z9uDokqzs1bWd84GDQEigez465/x+v3MOYYyBs3shXDAXzOGCOVwwhwvmcMEcLpjDBXPBHC6YwwVzuOAt4dGjRy/MzMwMmqZpSJLkZbPZYn9//8NkMlnmgncwt27d+tKlS5e+W6lUEolEYjQUCoExBsuy4Lru+319fXMjIyNXjh49+m8ueAfRarXUCxcuvHvv3r3DR44ceavRaMCyLDDGIAgCFEVBOBwGIQSFQuH9PXv2PD516tRvu7u7H3PB2xzXdZXz58//vFKp/Gzfvn1YXFyEYRgwDAOSJEEQBDDG4LouPM+DpmnwPA/5fP73o6Ojf3zttdfGueBtzAcffPCD8fHxi0NDQ1hZWUE6nYYoiiCEQBCEZ14JIfA8D77vAwAmJib+cPLkyctvvvnm33ZLf0i7Se7s7Gz/tWvXvpbL5bC+vo5sNgtFUTb/yU/EthshBAAgyzIAoNls4tChQ6OXL1+GKIreG2+88U8ueJsxPj5+QlXVt0OhEGRZhqIoEEXxGbFPC6aUBuJVVYVlWThw4MDo2NiYkMlkisPDwx/v9D4Rdotc0zSj9+7dO5RMJgEA4XAYkiRBkqRA9tNNluVArKIokCQJ8Xgc8Xgc+/fvf/u999778fr6egcXvE0ol8spx3HeNQwDoihClmXIsgxRFCFJ0ucEE0KgqipCodAz0pPJJFKpFGKx2I8uXrz4Qy54m1CpVBK+70MUxUDW0yO1Lbz9XnuUPz2625/JZDLo7OzExMTE4cnJySG+Bm8DarVa1Pd9EEIgy3IwPYuiCFEANFWEIGw2x6PQNA2qqqKdRTDGwBgDpTSQXKvVRj/88MOZoaGhSS74C8a27XA75ZEk6YloBYoswHQNfPy4Fx4JoTdmYjBRhSozsP+ZwCil8DwPlFIkk0kkEglMTEwM5PP5wcHBwTwX/AXhOI5i23bY930wxqAoymbVijA0/DD+mj8C048iqjMUHYbFRg0n+uaQ0FzQJ5IdxwGlNFi/AaCzsxPpdHr0+vXrN3aq4F2xBs/Pz/eFQqE/t0egIAjQdR2SQDFVzmKlHoEme1BEH3uyDJFsHFdnX4SLECRRhOM4EAQBhmFA1/UgvUomk4jH4/j0008PeZ4nccFbTKPRCH/00UdHi8Viph1gNZtNUEqhKAp0XUfRNMAYQCng+0DNAhp1H4s1A3fmkwhrMmKxGGKxGFRVDdZvWZYRiUQQjUZRq9V+Mjc39wIXvIWsra0lxsfHTzx48OAuY+yGKIpQVRX1eh2O4wQBFmMUjsvQ8oCWC5RWGWZmKVyX4e58DLarIBzWnomy23mxoiiIRqPQdR2FQqGfr8FbhOu6SrFYzJim+Y9mswnHcSCKImKxGFZWVmBZFgRBgCQTpPU6LNOCquhgjMERAUIAnzJUWgrmqzJeTclouRSUUrQj8XbQZRgGwuEwFhYW+vgI3iJarZbS2dl5v1Qqwfd9uK4LAEgmk2g0GlhfX99cV0UFL2dNCLSGmtlEvUFg2oBpA5YNmHWCikmgKNLncuH2VN2udFWr1QQXvEV4nicxxlCv19FsNoOtv0QiAUVRsLq6ikqlAtel2JvycOxFCyulFZh1CqtBNuXaBPV6EyHRhyAIaLVaQST99MZEWzQPsrZ2BKu2bYMQgmq1Cs/z4DgOwuEwMpkMSqUSlpeXwQBoegTfe9XEgayDhaUHWNuoo1YHKus1hEgVuR4GLRxFPB6HrusQRRGU0uBwQLsAslO3VXdskNVsNtHR0YHl5WU0Gg24rgvGGLLZLCilWFpawuLiIggR0d1l4KffMPH6yz5a5iNUVqcR8ot4+9UKcv0pCOLmlBwKhaBpGjRNC1Kl9p9H07QmD7K2CFVVm2tra0in07AsCysrK0ilUnBdF5FIBD09PVhYWMDDhw+RyWTQ07MH/X0qznyripNFhnKNYU8SeOVwL6Idm9+jdFNm+yBAO9CybRumaeLw4cOPueAtIhKJ1Hzf/4phGDe6urowOTmJY8eOBbXk9jRdKBQQiUTQ0dGBeDyOSCyB4z0aZEmErKhoNDfX7v83BXueh2q1ilKpBF7J2sofLQi0p6dn0bZtDAwMYGNjA1NTU/B9H61WC4qioK+vDxsbG5iZmcHdu3dh2zZEUUTL8QFBAYgIQSAolUrBsR1KadCe5NpYXl6Gqqp/yuVy/+GCt5C9e/fOy7L8dVmWkcvlMD09jc8++yxYM3VdR29vL+bn53H//n3cunULtm0HGwqu6wY169XVVTiOE4hmjKHRaGB2dhaFQgHHjx+/EQ6H7Z3YT+K5c+d2pGBCCOvu7n48NTX1gFL6bcMwUCgUUCqVgkpUu/Q4NzeHZrOJVquFSCQCwzCCIzuSJMH3fViWBUII2ulXoVDAnTt3UC6X/3L27NlfaJrW4IK3GFmW3ZdeeilvWda/HMe5u2/fvhFFUWCa5m/279///vDw8K8ymczfCSH56enpr5bL5UC0IAhPSpksCKparRbK5TJmZmZw+/ZtfPLJJ1fPnDnzy506PQO76NhstVpNFIvFDGNMSKfTxVQqVX66tHnp0qXvjI2NfZ8Q8s3e3l709/ejq6sL0WgUoVAIruuiVqthaWkJ09PTWFpaunL69Olfj4yMXNnJ/fJcXT7L5/ODY2Njb928efPLoii+3t5IkGUZnufBNE2sra1dHR4e/vidd9753cDAQH6nP/Nzebtwdna2//bt269MTk4eKpVKXZ7nSbquW7lcbvrEiRPjBw8enNwtz/rcXx9ljAlPypJ0Nz4fvx+8y+GCuWAOF8zhgjlcMIcL5nDBHC6YC+ZwwRwumLMN+O8AX65uqCMleo4AAAAASUVORK5CYII=') +``` + +## `Video` + +```python +Video(blob: bytes, mime_type: str | None, filename: str | None) +``` + +Bases: `object` + +Immutable value object representing a video such as MP4. + +### `blob` + +```python +blob +``` + +The bytestream of the media "file". + +### `content_type` + +```python +content_type +``` + +MIME-type of this media, e.g. `'video/mp4'`. + +### `ext` + +```python +ext +``` + +Return the file extension for this video, e.g. 'mp4'. + +The extension is that from the actual filename if known. Otherwise +it is the lowercase canonical extension for the video's MIME type. +'vid' is used if the MIME type is 'video/unknown'. + +### `filename` + +```python +filename: str +``` + +Return a filename.ext string appropriate to this video. + +The base filename from the original path is used if this image was +loaded from the filesystem. If no filename is available, such as when +the video object is created from an in-memory stream, the string +'movie.{ext}' is used where 'ext' is suitable to the video format, +such as 'mp4'. + +### `from_blob` + +```python +from_blob(blob: bytes, mime_type: str | None, filename: str | None = None) +``` + +Return a new `Video` object loaded from image binary in *blob*. + +### `from_path_or_file_like` + +```python +from_path_or_file_like(movie_file: str | IO[bytes], mime_type: str | None) -> Video +``` + +Return a new `Video` object containing video in *movie_file*. + +*movie_file* can be either a path (string) or a file-like +(e.g. StringIO) object. + +### `sha1` + +```python +sha1() +``` + +The SHA1 hash digest for the binary "file" of this video. + +Example: `'1be010ea47803b00e140b852765cdf84f491da47'` + + + + + +# `pptx.opc.constants` + +Constant values related to the Open Packaging Convention. + +## `CONTENT_TYPE` + +Content type URIs (like MIME-types) that specify a part's format. + +### `ASF` + +```python +ASF = 'video/x-ms-asf' +``` + +### `AVI` + +```python +AVI = 'video/avi' +``` + +### `BMP` + +```python +BMP = 'image/bmp' +``` + +### `DML_CHART` + +```python +DML_CHART = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml' +``` + +### `DML_CHARTSHAPES` + +```python +DML_CHARTSHAPES = 'application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml' +``` + +### `DML_DIAGRAM_COLORS` + +```python +DML_DIAGRAM_COLORS = 'application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml' +``` + +### `DML_DIAGRAM_DATA` + +```python +DML_DIAGRAM_DATA = 'application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml' +``` + +### `DML_DIAGRAM_DRAWING` + +```python +DML_DIAGRAM_DRAWING = 'application/vnd.ms-office.drawingml.diagramDrawing+xml' +``` + +### `DML_DIAGRAM_LAYOUT` + +```python +DML_DIAGRAM_LAYOUT = 'application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml' +``` + +### `DML_DIAGRAM_STYLE` + +```python +DML_DIAGRAM_STYLE = 'application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml' +``` + +### `GIF` + +```python +GIF = 'image/gif' +``` + +### `INK` + +```python +INK = 'application/inkml+xml' +``` + +### `JPEG` + +```python +JPEG = 'image/jpeg' +``` + +### `MOV` + +```python +MOV = 'video/quicktime' +``` + +### `MP4` + +```python +MP4 = 'video/mp4' +``` + +### `MPG` + +```python +MPG = 'video/mpeg' +``` + +### `MS_PHOTO` + +```python +MS_PHOTO = 'image/vnd.ms-photo' +``` + +### `MS_VIDEO` + +```python +MS_VIDEO = 'video/msvideo' +``` + +### `OFC_CHART_COLORS` + +```python +OFC_CHART_COLORS = 'application/vnd.ms-office.chartcolorstyle+xml' +``` + +### `OFC_CHART_EX` + +```python +OFC_CHART_EX = 'application/vnd.ms-office.chartex+xml' +``` + +### `OFC_CHART_STYLE` + +```python +OFC_CHART_STYLE = 'application/vnd.ms-office.chartstyle+xml' +``` + +### `OFC_CUSTOM_PROPERTIES` + +```python +OFC_CUSTOM_PROPERTIES = 'application/vnd.openxmlformats-officedocument.custom-properties+xml' +``` + +### `OFC_CUSTOM_XML_PROPERTIES` + +```python +OFC_CUSTOM_XML_PROPERTIES = 'application/vnd.openxmlformats-officedocument.customXmlProperties+xml' +``` + +### `OFC_DRAWING` + +```python +OFC_DRAWING = 'application/vnd.openxmlformats-officedocument.drawing+xml' +``` + +### `OFC_EXTENDED_PROPERTIES` + +```python +OFC_EXTENDED_PROPERTIES = 'application/vnd.openxmlformats-officedocument.extended-properties+xml' +``` + +### `OFC_OLE_OBJECT` + +```python +OFC_OLE_OBJECT = 'application/vnd.openxmlformats-officedocument.oleObject' +``` + +### `OFC_PACKAGE` + +```python +OFC_PACKAGE = 'application/vnd.openxmlformats-officedocument.package' +``` + +### `OFC_THEME` + +```python +OFC_THEME = 'application/vnd.openxmlformats-officedocument.theme+xml' +``` + +### `OFC_THEME_OVERRIDE` + +```python +OFC_THEME_OVERRIDE = 'application/vnd.openxmlformats-officedocument.themeOverride+xml' +``` + +### `OFC_VML_DRAWING` + +```python +OFC_VML_DRAWING = 'application/vnd.openxmlformats-officedocument.vmlDrawing' +``` + +### `OPC_CORE_PROPERTIES` + +```python +OPC_CORE_PROPERTIES = 'application/vnd.openxmlformats-package.core-properties+xml' +``` + +### `OPC_DIGITAL_SIGNATURE_CERTIFICATE` + +```python +OPC_DIGITAL_SIGNATURE_CERTIFICATE = 'application/vnd.openxmlformats-package.digital-signature-certificate' +``` + +### `OPC_DIGITAL_SIGNATURE_ORIGIN` + +```python +OPC_DIGITAL_SIGNATURE_ORIGIN = 'application/vnd.openxmlformats-package.digital-signature-origin' +``` + +### `OPC_DIGITAL_SIGNATURE_XMLSIGNATURE` + +```python +OPC_DIGITAL_SIGNATURE_XMLSIGNATURE = 'application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml' +``` + +### `OPC_RELATIONSHIPS` + +```python +OPC_RELATIONSHIPS = 'application/vnd.openxmlformats-package.relationships+xml' +``` + +### `PML_COMMENTS` + +```python +PML_COMMENTS = 'application/vnd.openxmlformats-officedocument.presentationml.comments+xml' +``` + +### `PML_COMMENT_AUTHORS` + +```python +PML_COMMENT_AUTHORS = 'application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml' +``` + +### `PML_HANDOUT_MASTER` + +```python +PML_HANDOUT_MASTER = 'application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml' +``` + +### `PML_NOTES_MASTER` + +```python +PML_NOTES_MASTER = 'application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml' +``` + +### `PML_NOTES_SLIDE` + +```python +PML_NOTES_SLIDE = 'application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml' +``` + +### `PML_PRESENTATION` + +```python +PML_PRESENTATION = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' +``` + +### `PML_PRESENTATION_MAIN` + +```python +PML_PRESENTATION_MAIN = 'application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml' +``` + +### `PML_PRES_MACRO_MAIN` + +```python +PML_PRES_MACRO_MAIN = 'application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml' +``` + +### `PML_PRES_PROPS` + +```python +PML_PRES_PROPS = 'application/vnd.openxmlformats-officedocument.presentationml.presProps+xml' +``` + +### `PML_PRINTER_SETTINGS` + +```python +PML_PRINTER_SETTINGS = 'application/vnd.openxmlformats-officedocument.presentationml.printerSettings' +``` + +### `PML_SLIDE` + +```python +PML_SLIDE = 'application/vnd.openxmlformats-officedocument.presentationml.slide+xml' +``` + +### `PML_SLIDESHOW_MAIN` + +```python +PML_SLIDESHOW_MAIN = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml' +``` + +### `PML_SLIDE_LAYOUT` + +```python +PML_SLIDE_LAYOUT = 'application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml' +``` + +### `PML_SLIDE_MASTER` + +```python +PML_SLIDE_MASTER = 'application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml' +``` + +### `PML_SLIDE_UPDATE_INFO` + +```python +PML_SLIDE_UPDATE_INFO = 'application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml' +``` + +### `PML_TABLE_STYLES` + +```python +PML_TABLE_STYLES = 'application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml' +``` + +### `PML_TAGS` + +```python +PML_TAGS = 'application/vnd.openxmlformats-officedocument.presentationml.tags+xml' +``` + +### `PML_TEMPLATE_MAIN` + +```python +PML_TEMPLATE_MAIN = 'application/vnd.openxmlformats-officedocument.presentationml.template.main+xml' +``` + +### `PML_VIEW_PROPS` + +```python +PML_VIEW_PROPS = 'application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml' +``` + +### `PNG` + +```python +PNG = 'image/png' +``` + +### `SML_CALC_CHAIN` + +```python +SML_CALC_CHAIN = 'application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml' +``` + +### `SML_CHARTSHEET` + +```python +SML_CHARTSHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml' +``` + +### `SML_COMMENTS` + +```python +SML_COMMENTS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml' +``` + +### `SML_CONNECTIONS` + +```python +SML_CONNECTIONS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml' +``` + +### `SML_CUSTOM_PROPERTY` + +```python +SML_CUSTOM_PROPERTY = 'application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty' +``` + +### `SML_DIALOGSHEET` + +```python +SML_DIALOGSHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml' +``` + +### `SML_EXTERNAL_LINK` + +```python +SML_EXTERNAL_LINK = 'application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml' +``` + +### `SML_PIVOT_CACHE_DEFINITION` + +```python +SML_PIVOT_CACHE_DEFINITION = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml' +``` + +### `SML_PIVOT_CACHE_RECORDS` + +```python +SML_PIVOT_CACHE_RECORDS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml' +``` + +### `SML_PIVOT_TABLE` + +```python +SML_PIVOT_TABLE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml' +``` + +### `SML_PRINTER_SETTINGS` + +```python +SML_PRINTER_SETTINGS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings' +``` + +### `SML_QUERY_TABLE` + +```python +SML_QUERY_TABLE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml' +``` + +### `SML_REVISION_HEADERS` + +```python +SML_REVISION_HEADERS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml' +``` + +### `SML_REVISION_LOG` + +```python +SML_REVISION_LOG = 'application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml' +``` + +### `SML_SHARED_STRINGS` + +```python +SML_SHARED_STRINGS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml' +``` + +### `SML_SHEET` + +```python +SML_SHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' +``` + +### `SML_SHEET_MAIN` + +```python +SML_SHEET_MAIN = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml' +``` + +### `SML_SHEET_METADATA` + +```python +SML_SHEET_METADATA = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml' +``` + +### `SML_STYLES` + +```python +SML_STYLES = 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml' +``` + +### `SML_TABLE` + +```python +SML_TABLE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml' +``` + +### `SML_TABLE_SINGLE_CELLS` + +```python +SML_TABLE_SINGLE_CELLS = 'application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml' +``` + +### `SML_TEMPLATE_MAIN` + +```python +SML_TEMPLATE_MAIN = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml' +``` + +### `SML_USER_NAMES` + +```python +SML_USER_NAMES = 'application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml' +``` + +### `SML_VOLATILE_DEPENDENCIES` + +```python +SML_VOLATILE_DEPENDENCIES = 'application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml' +``` + +### `SML_WORKSHEET` + +```python +SML_WORKSHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml' +``` + +### `SWF` + +```python +SWF = 'application/x-shockwave-flash' +``` + +### `TIFF` + +```python +TIFF = 'image/tiff' +``` + +### `VIDEO` + +```python +VIDEO = 'video/unknown' +``` + +### `WML_COMMENTS` + +```python +WML_COMMENTS = 'application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml' +``` + +### `WML_DOCUMENT` + +```python +WML_DOCUMENT = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' +``` + +### `WML_DOCUMENT_GLOSSARY` + +```python +WML_DOCUMENT_GLOSSARY = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml' +``` + +### `WML_DOCUMENT_MAIN` + +```python +WML_DOCUMENT_MAIN = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml' +``` + +### `WML_ENDNOTES` + +```python +WML_ENDNOTES = 'application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml' +``` + +### `WML_FONT_TABLE` + +```python +WML_FONT_TABLE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml' +``` + +### `WML_FOOTER` + +```python +WML_FOOTER = 'application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml' +``` + +### `WML_FOOTNOTES` + +```python +WML_FOOTNOTES = 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml' +``` + +### `WML_HEADER` + +```python +WML_HEADER = 'application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml' +``` + +### `WML_NUMBERING` + +```python +WML_NUMBERING = 'application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml' +``` + +### `WML_PRINTER_SETTINGS` + +```python +WML_PRINTER_SETTINGS = 'application/vnd.openxmlformats-officedocument.wordprocessingml.printerSettings' +``` + +### `WML_SETTINGS` + +```python +WML_SETTINGS = 'application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml' +``` + +### `WML_STYLES` + +```python +WML_STYLES = 'application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml' +``` + +### `WML_WEB_SETTINGS` + +```python +WML_WEB_SETTINGS = 'application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml' +``` + +### `WMV` + +```python +WMV = 'video/x-ms-wmv' +``` + +### `XML` + +```python +XML = 'application/xml' +``` + +### `X_EMF` + +```python +X_EMF = 'image/x-emf' +``` + +### `X_FONTDATA` + +```python +X_FONTDATA = 'application/x-fontdata' +``` + +### `X_FONT_TTF` + +```python +X_FONT_TTF = 'application/x-font-ttf' +``` + +### `X_MS_VIDEO` + +```python +X_MS_VIDEO = 'video/x-msvideo' +``` + +### `X_WMF` + +```python +X_WMF = 'image/x-wmf' +``` + +## `NAMESPACE` + +Constant values for OPC XML namespaces + +### `DML_WORDPROCESSING_DRAWING` + +```python +DML_WORDPROCESSING_DRAWING = 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing' +``` + +### `OFC_RELATIONSHIPS` + +```python +OFC_RELATIONSHIPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships' +``` + +### `OPC_CONTENT_TYPES` + +```python +OPC_CONTENT_TYPES = 'http://schemas.openxmlformats.org/package/2006/content-types' +``` + +### `OPC_RELATIONSHIPS` + +```python +OPC_RELATIONSHIPS = 'http://schemas.openxmlformats.org/package/2006/relationships' +``` + +### `WML_MAIN` + +```python +WML_MAIN = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main' +``` + +## `RELATIONSHIP_TARGET_MODE` + +Open XML relationship target modes + +### `EXTERNAL` + +```python +EXTERNAL = 'External' +``` + +### `INTERNAL` + +```python +INTERNAL = 'Internal' +``` + +## `RELATIONSHIP_TYPE` + +### `AUDIO` + +```python +AUDIO = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio' +``` + +### `A_F_CHUNK` + +```python +A_F_CHUNK = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk' +``` + +### `CALC_CHAIN` + +```python +CALC_CHAIN = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain' +``` + +### `CERTIFICATE` + +```python +CERTIFICATE = 'http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/certificate' +``` + +### `CHART` + +```python +CHART = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart' +``` + +### `CHARTSHEET` + +```python +CHARTSHEET = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet' +``` + +### `CHART_COLOR_STYLE` + +```python +CHART_COLOR_STYLE = 'http://schemas.microsoft.com/office/2011/relationships/chartColorStyle' +``` + +### `CHART_USER_SHAPES` + +```python +CHART_USER_SHAPES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes' +``` + +### `COMMENTS` + +```python +COMMENTS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments' +``` + +### `COMMENT_AUTHORS` + +```python +COMMENT_AUTHORS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors' +``` + +### `CONNECTIONS` + +```python +CONNECTIONS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections' +``` + +### `CONTROL` + +```python +CONTROL = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/control' +``` + +### `CORE_PROPERTIES` + +```python +CORE_PROPERTIES = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties' +``` + +### `CUSTOM_PROPERTIES` + +```python +CUSTOM_PROPERTIES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties' +``` + +### `CUSTOM_PROPERTY` + +```python +CUSTOM_PROPERTY = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/customProperty' +``` + +### `CUSTOM_XML` + +```python +CUSTOM_XML = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml' +``` + +### `CUSTOM_XML_PROPS` + +```python +CUSTOM_XML_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps' +``` + +### `DIAGRAM_COLORS` + +```python +DIAGRAM_COLORS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors' +``` + +### `DIAGRAM_DATA` + +```python +DIAGRAM_DATA = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData' +``` + +### `DIAGRAM_LAYOUT` + +```python +DIAGRAM_LAYOUT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout' +``` + +### `DIAGRAM_QUICK_STYLE` + +```python +DIAGRAM_QUICK_STYLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle' +``` + +### `DIALOGSHEET` + +```python +DIALOGSHEET = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet' +``` + +### `DRAWING` + +```python +DRAWING = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing' +``` + +### `ENDNOTES` + +```python +ENDNOTES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes' +``` + +### `EXTENDED_PROPERTIES` + +```python +EXTENDED_PROPERTIES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties' +``` + +### `EXTERNAL_LINK` + +```python +EXTERNAL_LINK = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink' +``` + +### `FONT` + +```python +FONT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/font' +``` + +### `FONT_TABLE` + +```python +FONT_TABLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable' +``` + +### `FOOTER` + +```python +FOOTER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer' +``` + +### `FOOTNOTES` + +```python +FOOTNOTES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes' +``` + +### `GLOSSARY_DOCUMENT` + +```python +GLOSSARY_DOCUMENT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument' +``` + +### `HANDOUT_MASTER` + +```python +HANDOUT_MASTER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/handoutMaster' +``` + +### `HEADER` + +```python +HEADER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/header' +``` + +### `HYPERLINK` + +```python +HYPERLINK = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink' +``` + +### `IMAGE` + +```python +IMAGE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image' +``` + +### `MEDIA` + +```python +MEDIA = 'http://schemas.microsoft.com/office/2007/relationships/media' +``` + +### `NOTES_MASTER` + +```python +NOTES_MASTER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster' +``` + +### `NOTES_SLIDE` + +```python +NOTES_SLIDE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide' +``` + +### `NUMBERING` + +```python +NUMBERING = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering' +``` + +### `OFFICE_DOCUMENT` + +```python +OFFICE_DOCUMENT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument' +``` + +### `OLE_OBJECT` + +```python +OLE_OBJECT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject' +``` + +### `ORIGIN` + +```python +ORIGIN = 'http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin' +``` + +### `PACKAGE` + +```python +PACKAGE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/package' +``` + +### `PIVOT_CACHE_DEFINITION` + +```python +PIVOT_CACHE_DEFINITION = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition' +``` + +### `PIVOT_CACHE_RECORDS` + +```python +PIVOT_CACHE_RECORDS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/spreadsheetml/pivotCacheRecords' +``` + +### `PIVOT_TABLE` + +```python +PIVOT_TABLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable' +``` + +### `PRES_PROPS` + +```python +PRES_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps' +``` + +### `PRINTER_SETTINGS` + +```python +PRINTER_SETTINGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings' +``` + +### `QUERY_TABLE` + +```python +QUERY_TABLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/queryTable' +``` + +### `REVISION_HEADERS` + +```python +REVISION_HEADERS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionHeaders' +``` + +### `REVISION_LOG` + +```python +REVISION_LOG = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionLog' +``` + +### `SETTINGS` + +```python +SETTINGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings' +``` + +### `SHARED_STRINGS` + +```python +SHARED_STRINGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings' +``` + +### `SHEET_METADATA` + +```python +SHEET_METADATA = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata' +``` + +### `SIGNATURE` + +```python +SIGNATURE = 'http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/signature' +``` + +### `SLIDE` + +```python +SLIDE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide' +``` + +### `SLIDE_LAYOUT` + +```python +SLIDE_LAYOUT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout' +``` + +### `SLIDE_MASTER` + +```python +SLIDE_MASTER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster' +``` + +### `SLIDE_UPDATE_INFO` + +```python +SLIDE_UPDATE_INFO = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideUpdateInfo' +``` + +### `STYLES` + +```python +STYLES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles' +``` + +### `TABLE` + +```python +TABLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/table' +``` + +### `TABLE_SINGLE_CELLS` + +```python +TABLE_SINGLE_CELLS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableSingleCells' +``` + +### `TABLE_STYLES` + +```python +TABLE_STYLES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles' +``` + +### `TAGS` + +```python +TAGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/tags' +``` + +### `THEME` + +```python +THEME = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme' +``` + +### `THEME_OVERRIDE` + +```python +THEME_OVERRIDE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/themeOverride' +``` + +### `THUMBNAIL` + +```python +THUMBNAIL = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail' +``` + +### `USERNAMES` + +```python +USERNAMES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/usernames' +``` + +### `VIDEO` + +```python +VIDEO = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/video' +``` + +### `VIEW_PROPS` + +```python +VIEW_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps' +``` + +### `VML_DRAWING` + +```python +VML_DRAWING = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing' +``` + +### `VOLATILE_DEPENDENCIES` + +```python +VOLATILE_DEPENDENCIES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/volatileDependencies' +``` + +### `WEB_SETTINGS` + +```python +WEB_SETTINGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings' +``` + +### `WORKSHEET_SOURCE` + +```python +WORKSHEET_SOURCE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheetSource' +``` + +### `XML_MAPS` + +```python +XML_MAPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/xmlMaps' +``` diff --git a/addons/sandbox/skills/pptx/references/api-003.md b/addons/sandbox/skills/pptx/references/api-003.md new file mode 100644 index 000000000..e1d94a908 --- /dev/null +++ b/addons/sandbox/skills/pptx/references/api-003.md @@ -0,0 +1,7332 @@ + + + + +# `pptx.opc.oxml` + +OPC-local oxml module to handle OPC-local concerns like relationship parsing. + +## `CT_Default` + +Bases: `BaseOxmlElement` + +`` element. + +Specifies the default content type to be applied to a part with the specified extension. + +### `contentType` + +```python +contentType: str = RequiredAttribute('ContentType', ST_ContentType) +``` + +### `extension` + +```python +extension: str = RequiredAttribute('Extension', ST_Extension) +``` + +## `CT_Override` + +Bases: `BaseOxmlElement` + +`` element. + +Specifies the content type to be applied for a part with the specified partname. + +### `contentType` + +```python +contentType: str = RequiredAttribute('ContentType', ST_ContentType) +``` + +### `partName` + +```python +partName: str = RequiredAttribute('PartName', XsdAnyUri) +``` + +## `CT_Relationship` + +Bases: `BaseOxmlElement` + +`` element. + +Represents a single relationship from a source to a target part. + +### `new` + +```python +new(rId: str, reltype: str, target_ref: str, target_mode: str = RTM.INTERNAL) -> CT_Relationship +``` + +Return a new `` element. + +`target_ref` is either a partname or a URI. + +### `rId` + +```python +rId: str = RequiredAttribute('Id', XsdId) +``` + +### `reltype` + +```python +reltype: str = RequiredAttribute('Type', XsdAnyUri) +``` + +### `targetMode` + +```python +targetMode: str = OptionalAttribute('TargetMode', ST_TargetMode, default=RTM.INTERNAL) +``` + +### `target_ref` + +```python +target_ref: str = RequiredAttribute('Target', XsdAnyUri) +``` + +## `CT_Relationships` + +Bases: `BaseOxmlElement` + +`` element, the root element in a .rels file. + +### `add_rel` + +```python +add_rel(rId: str, reltype: str, target: str, is_external: bool = False) -> CT_Relationship +``` + +Add a child `` element with attributes set as specified. + +### `new` + +```python +new() -> CT_Relationships +``` + +Return a new `` element. + +### `relationship` + +```python +relationship = ZeroOrMore('pr:Relationship') +``` + +### `relationship_lst` + +```python +relationship_lst: list[CT_Relationship] +``` + +### `xml_file_bytes` + +```python +xml_file_bytes: bytes +``` + +Return XML bytes, with XML-declaration, for this `` element. + +Suitable for saving in a .rels stream, not pretty printed and with an XML declaration at +the top. + +## `CT_Types` + +Bases: `BaseOxmlElement` + +`` element. + +The container element for Default and Override elements in [Content_Types].xml. + +### `add_default` + +```python +add_default(ext: str, content_type: str) -> CT_Default +``` + +Add a child `` element with attributes set to parameter values. + +### `add_override` + +```python +add_override(partname: PackURI, content_type: str) -> CT_Override +``` + +Add a child `` element with attributes set to parameter values. + +### `default` + +```python +default = ZeroOrMore('ct:Default') +``` + +### `default_lst` + +```python +default_lst: list[CT_Default] +``` + +### `new` + +```python +new() -> CT_Types +``` + +Return a new `` element. + +### `override` + +```python +override = ZeroOrMore('ct:Override') +``` + +### `override_lst` + +```python +override_lst: list[CT_Override] +``` + +## `nsmap` + +```python +nsmap = {'ct': NS.OPC_CONTENT_TYPES, 'pr': NS.OPC_RELATIONSHIPS, 'r': NS.OFC_RELATIONSHIPS} +``` + +## `oxml_to_encoded_bytes` + +```python +oxml_to_encoded_bytes(element: BaseOxmlElement, encoding: str = 'utf-8', pretty_print: bool = False, standalone: bool | None = None) -> bytes +``` + +## `oxml_tostring` + +```python +oxml_tostring(elm: BaseOxmlElement, encoding: str | None = None, pretty_print: bool = False, standalone: bool | None = None) +``` + +## `serialize_part_xml` + +```python +serialize_part_xml(part_elm: BaseOxmlElement) -> bytes +``` + +Produce XML-file bytes for `part_elm`, suitable for writing directly to a `.xml` file. + +Includes XML-declaration header. + + + + + +# `pptx.opc.package` + +Fundamental Open Packaging Convention (OPC) objects. + +## `OpcPackage` + +```python +OpcPackage(pkg_file: str | IO[bytes]) +``` + +Bases: `_RelatableMixin` + +Main API class for `python-opc`. + +A new instance is constructed by calling the `open` classmethod with a path to a package +file or file-like object containing a package (.pptx file). + +### `drop_rel` + +```python +drop_rel(rId: str) -> None +``` + +Remove relationship identified by `rId`. + +### `iter_parts` + +```python +iter_parts() -> Iterator[Part] +``` + +Generate exactly one reference to each part in the package. + +### `iter_rels` + +```python +iter_rels() -> Iterator[_Relationship] +``` + +Generate exactly one reference to each relationship in package. + +Performs a depth-first traversal of the rels graph. + +### `main_document_part` + +```python +main_document_part: PresentationPart +``` + +Return `Part` subtype serving as the main document part for this package. + +In this case it will be a `Presentation` part. + +### `next_partname` + +```python +next_partname(tmpl: str) -> PackURI +``` + +Return `PackURI` next available partname matching `tmpl`. + +`tmpl` is a printf (%)-style template string containing a single replacement item, a '%d' +to be used to insert the integer portion of the partname. Example: +'/ppt/slides/slide%d.xml' + +### `open` + +```python +open(pkg_file: str | IO[bytes]) -> Self +``` + +Return an `OpcPackage` instance loaded with the contents of `pkg_file`. + +### `save` + +```python +save(pkg_file: str | IO[bytes]) -> None +``` + +Save this package to `pkg_file`. + +`pkg_file` can be a filesystem path (`str` or `os.PathLike`) or a file-like object open +for writing bytes. + +A path destination is written atomically: the package is serialized into a temporary +file in the destination's directory and moved into place with `os.replace()`, so a +failure part-way through leaves any existing file untouched. Symlinks are resolved, so +the file a link names is the file that is written. + +A stream destination is serialized into a private staging buffer and then written +straight through, so no bytes reach the stream unless the whole package serialized. Only +`write` is required of the stream. The package is written at the stream's current +position; past that, bytes beyond the package are the caller's and are left alone. + +What a failure *during* that copy costs depends on what the destination supports. One +that can be read, rewound and truncated has its prior contents and cursor restored, and +if that restore itself fails the original error is replaced by a `RuntimeError` carrying +it as `__cause__`. A write-only or unseekable sink keeps whatever partial package landed; +a caller writing to a pipe cannot expect otherwise. The same capability decides +truncation: a readable stream positioned at the start is truncated to the package, so no +tail of a previous document survives, while a write-only stream keeps that tail. + +Atomic path writes are a deliberate departure from the v0 rule that `save()` behavior is +unchanged from upstream, accepted because upstream serialized directly into the +destination, so a mid-write failure on the ordinary `prs.save(same_path)` pattern +destroyed the deck being edited, irrecoverably. + +The costs of replacing rather than overwriting: owner, group, ACLs, extended attributes +and hard links do not survive (mode bits are carried over), and the destination's +*directory* must be writable, not just the file. + +## `Part` + +```python +Part(partname: PackURI, content_type: str, package: Package, blob: bytes | None = None) +``` + +Bases: `_RelatableMixin` + +Base class for package parts. + +Provides common properties and methods, but intended to be subclassed in client code to +implement specific part behaviors. Also serves as the default class for parts that are not yet +given specific behaviors. + +### `blob` + +```python +blob: bytes +``` + +Contents of this package part as a sequence of bytes. + +Intended to be overridden by subclasses. Default behavior is to return the blob initial +loaded during `Package.open()` operation. + +### `content_type` + +```python +content_type() -> str +``` + +Content-type (MIME-type) of this part. + +### `load` + +```python +load(partname: PackURI, content_type: str, package: Package, blob: bytes) -> Self +``` + +Return `cls` instance loaded from arguments. + +This one is a straight pass-through, but subtypes may do some pre-processing, see XmlPart +for an example. + +### `load_rels_from_xml` + +```python +load_rels_from_xml(xml_rels: CT_Relationships, parts: dict[PackURI, Part]) -> None +``` + +load _Relationships for this part from `xml_rels`. + +Part references are resolved using the `parts` dict that maps each partname to the loaded +part with that partname. These relationships are loaded from a serialized package and so +already have assigned rIds. This method is only used during package loading. + +### `package` + +```python +package() -> Package +``` + +Package this part belongs to. + +### `partname` + +```python +partname: PackURI +``` + +`PackURI` partname for this part, e.g. "/ppt/slides/slide1.xml". + +### `rels` + +```python +rels() -> _Relationships +``` + +Collection of relationships from this part to other parts. + +## `PartFactory` + +Constructs a registered subtype of `Part`. + +Client code can register a subclass of `Part` to be used for a package blob based on its +content type. + +### `part_type_for` + +```python +part_type_for: dict[str, type[Part]] = {} +``` + +## `XmlPart` + +```python +XmlPart(partname: PackURI, content_type: str, package: Package, element: BaseOxmlElement) +``` + +Bases: `Part` + +Base class for package parts containing an XML payload, which is most of them. + +Provides additional methods to the `Part` base class that take care of parsing and +reserializing the XML payload and managing relationships to other parts. + +### `blob` + +```python +blob: bytes +``` + +bytes XML serialization of this part. + +### `drop_rel` + +```python +drop_rel(rId: str) -> None +``` + +Remove relationship identified by `rId` if its reference count is under 2. + +Relationships with a reference count of 0 are implicit relationships. Note that only XML +parts can drop relationships. + +### `load` + +```python +load(partname: PackURI, content_type: str, package: Package, blob: bytes) +``` + +Return instance of `cls` loaded with parsed XML from `blob`. + +### `part` + +```python +part +``` + +This part. + +This is part of the parent protocol, "children" of the document will not know the part +that contains them so must ask their parent object. That chain of delegation ends here for +child objects. + + + + + +# `pptx.opc.packuri` + +Provides the PackURI value type and known pack-URI strings such as PACKAGE_URI. + +## `CONTENT_TYPES_URI` + +```python +CONTENT_TYPES_URI = PackURI('/[Content_Types].xml') +``` + +## `PACKAGE_URI` + +```python +PACKAGE_URI = PackURI('/') +``` + +## `PackURI` + +Bases: `str` + +Proxy for a pack URI (partname). + +Provides utility properties the baseURI and the filename slice. Behaves as `str` otherwise. + +### `baseURI` + +```python +baseURI: str +``` + +The base URI of this pack URI; the directory portion, roughly speaking. + +E.g. `"/ppt/slides"` for `"/ppt/slides/slide1.xml"`. + +For the package pseudo-partname "/", the baseURI is "/". + +### `ext` + +```python +ext: str +``` + +The extension portion of this pack URI. + +E.g. `"xml"` for `"/ppt/slides/slide1.xml"`. Note the leading period is not included. + +### `filename` + +```python +filename: str +``` + +The "filename" portion of this pack URI. + +E.g. `"slide1.xml"` for `"/ppt/slides/slide1.xml"`. + +For the package pseudo-partname "/", `filename` is ''. + +### `from_rel_ref` + +```python +from_rel_ref(baseURI: str, relative_ref: str) -> PackURI +``` + +Construct an absolute pack URI formed by translating `relative_ref` onto `baseURI`. + +### `idx` + +```python +idx: int | None +``` + +Optional int partname index. + +Value is an integer for an "array" partname or None for singleton partname, e.g. `21` for +`"/ppt/slides/slide21.xml"` and `None` for `"/ppt/presentation.xml"`. + +### `membername` + +```python +membername: str +``` + +The pack URI with the leading slash stripped off. + +This is the form used as the Zip file membername for the package item. Returns "" for the +package pseudo-partname "/". + +### `relative_ref` + +```python +relative_ref(baseURI: str) -> str +``` + +Return string containing relative reference to package item from `baseURI`. + +E.g. PackURI("/ppt/slideLayouts/slideLayout1.xml") would return +"../slideLayouts/slideLayout1.xml" for baseURI "/ppt/slides". + +### `rels_uri` + +```python +rels_uri: PackURI +``` + +The pack URI of the .rels part corresponding to the current pack URI. + +Only produces sensible output if the pack URI is a partname or the package pseudo-partname +"/". + + + + + +# `pptx.opc.serialized` + +API for reading/writing serialized Open Packaging Convention (OPC) package. + +## `GuardedZipReader` + +```python +GuardedZipReader(zip_file: ZipFile) +``` + +Validate and stream every member of an already-open ``ZipFile``. + +Construction fully validates the archive and caches every member's bytes. This makes an ordinary +``Presentation()`` open share the same validation, including for members not reachable from OPC +relationships. + +Wrap `zip_file`, splitting its records into all members and the subset that can be OPC +parts. + +### `order` + +```python +order: Tuple[str, ...] +``` + +Member names in central-directory order. + +### `read` + +```python +read(name: str) -> bytes +``` + +Return validated bytes for member `name`. + +### `read_all` + +```python +read_all() -> Tuple[Dict[str, bytes], List[str]] +``` + +Return a copy of validated parts and their archive order. + +## `PackageReader` + +```python +PackageReader(pkg_file: str | IO[bytes]) +``` + +Bases: `Container[bytes]` + +Provides access to package-parts of an OPC package with dict semantics. + +The package may be in zip-format (a .pptx file) or expanded into a directory structure, +perhaps by unzipping a .pptx file. + +### `partnames` + +```python +partnames: set[PackURI] | None +``` + +Physical member names, or `None` for an expanded directory package. + +### `rels_xml_for` + +```python +rels_xml_for(partname: PackURI) -> bytes | None +``` + +Return optional rels item XML for `partname`. + +Returns `None` if no rels item is present for `partname`. `partname` is a `PackURI` +instance. + +## `PackageWriter` + +```python +PackageWriter(pkg_file: str | IO[bytes], pkg_rels: _Relationships, parts: Sequence[Part]) +``` + +Writes a zip-format OPC package to `pkg_file`. + +`pkg_file` can be either a path to a zip file (a string) or a file-like object. `pkg_rels` is +the `_Relationships` object containing relationships for the package. `parts` is a sequence of +`Part` subtype instance to be written to the package. + +Its single API classmethod is `write`. This class is not intended to be instantiated. + +### `write` + +```python +write(pkg_file: str | IO[bytes], pkg_rels: _Relationships, parts: Sequence[Part]) -> None +``` + +Write a physical package (.pptx file) to `pkg_file`. + +The serialized package contains `pkg_rels` and `parts`, a content-types stream based on +the content type of each part, and a .rels file for each part that has relationships. + +## `preflight_zip` + +```python +preflight_zip(source: object) -> None +``` + +Validate central-directory metadata before ``ZipFile`` parses it. + +An archive must declare one unambiguous central-directory region: a single +end-of-central-directory record, no multi-disk structure, and member counts, +offsets, and sizes that agree with each other and with the records actually +present. This preflight reads only fixed-size records and skips variable +fields without retaining them. + + + + + +# `pptx.opc.shared` + +Objects shared by modules in the pptx.opc sub-package. + +## `CaseInsensitiveDict` + +Bases: `dict` + +Mapping type like dict except it matches key without respect to case. + +For example, D['A'] == D['a']. Note this is not general-purpose, just complete +enough to satisfy opc package needs. It assumes str keys for example. + + + + + +# `pptx.opc.spec` + +Provides mappings that embody aspects of the Open XML spec ISO/IEC 29500. + +## `default_content_types` + +```python +default_content_types = (('bin', CT.PML_PRINTER_SETTINGS), ('bin', CT.SML_PRINTER_SETTINGS), ('bin', CT.WML_PRINTER_SETTINGS), ('bmp', CT.BMP), ('emf', CT.X_EMF), ('fntdata', CT.X_FONTDATA), ('gif', CT.GIF), ('jpe', CT.JPEG), ('jpeg', CT.JPEG), ('jpg', CT.JPEG), ('mov', CT.MOV), ('mp4', CT.MP4), ('mpg', CT.MPG), ('png', CT.PNG), ('rels', CT.OPC_RELATIONSHIPS), ('tif', CT.TIFF), ('tiff', CT.TIFF), ('vid', CT.VIDEO), ('wdp', CT.MS_PHOTO), ('wmf', CT.X_WMF), ('wmv', CT.WMV), ('xlsx', CT.SML_SHEET), ('xml', CT.XML)) +``` + +## `image_content_types` + +```python +image_content_types = {'bmp': CT.BMP, 'emf': CT.X_EMF, 'gif': CT.GIF, 'jpe': CT.JPEG, 'jpeg': CT.JPEG, 'jpg': CT.JPEG, 'png': CT.PNG, 'tif': CT.TIFF, 'tiff': CT.TIFF, 'wdp': CT.MS_PHOTO, 'wmf': CT.X_WMF} +``` + + + + + +# `pptx.oxml.action` + +lxml custom element classes for text-related XML elements. + +## `CT_Hyperlink` + +Bases: `BaseOxmlElement` + +Custom element class for elements. + +### `action` + +```python +action: str | None = OptionalAttribute('action', XsdString) +``` + +### `action_fields` + +```python +action_fields: dict[str, str] +``` + +Query portion of the `ppaction://` URL as dict. + +For example `{'id':'0', 'return':'true'}` in 'ppaction://customshow?id=0&return=true'. + +Returns an empty dict if the URL contains no query string or if no action attribute is +present. + +### `action_verb` + +```python +action_verb: str | None +``` + +The host portion of the `ppaction://` URL contained in the action attribute. + +For example 'customshow' in 'ppaction://customshow?id=0&return=true'. Returns `None` if no +action attribute is present. + +### `rId` + +```python +rId: str = OptionalAttribute('r:id', XsdString) +``` + + + + + +# `pptx.oxml.chart.axis` + +Axis-related oxml objects. + +## `BaseAxisElement` + +Bases: `BaseOxmlElement` + +Base class for catAx, dateAx, valAx, and perhaps other axis elements. + +### `defRPr` + +```python +defRPr +``` + +```` great-great-grandchild element, added with its +ancestors if not present. + +### `orientation` + +```python +orientation +``` + +Value of `val` attribute of `c:scaling/c:orientation` grandchild element. + +Defaults to `ST_Orientation.MIN_MAX` if attribute or any ancestors are not +present. + +## `CT_AxisUnit` + +Bases: `BaseOxmlElement` + +Used for `c:majorUnit` and `c:minorUnit` elements, and others. + +### `val` + +```python +val = RequiredAttribute('val', ST_AxisUnit) +``` + +## `CT_CatAx` + +Bases: `BaseAxisElement` + +`c:catAx` element, defining a category axis. + +### `crosses` + +```python +crosses = ZeroOrOne('c:crosses', successors=_tag_seq[15:]) +``` + +### `crossesAt` + +```python +crossesAt = ZeroOrOne('c:crossesAt', successors=_tag_seq[16:]) +``` + +### `delete_` + +```python +delete_ = ZeroOrOne('c:delete', successors=_tag_seq[3:]) +``` + +### `lblOffset` + +```python +lblOffset = ZeroOrOne('c:lblOffset', successors=_tag_seq[19:]) +``` + +### `majorGridlines` + +```python +majorGridlines = ZeroOrOne('c:majorGridlines', successors=_tag_seq[5:]) +``` + +### `majorTickMark` + +```python +majorTickMark = ZeroOrOne('c:majorTickMark', successors=_tag_seq[9:]) +``` + +### `minorGridlines` + +```python +minorGridlines = ZeroOrOne('c:minorGridlines', successors=_tag_seq[6:]) +``` + +### `minorTickMark` + +```python +minorTickMark = ZeroOrOne('c:minorTickMark', successors=_tag_seq[10:]) +``` + +### `numFmt` + +```python +numFmt = ZeroOrOne('c:numFmt', successors=_tag_seq[8:]) +``` + +### `scaling` + +```python +scaling = OneAndOnlyOne('c:scaling') +``` + +### `spPr` + +```python +spPr = ZeroOrOne('c:spPr', successors=_tag_seq[12:]) +``` + +### `tickLblPos` + +```python +tickLblPos = ZeroOrOne('c:tickLblPos', successors=_tag_seq[11:]) +``` + +### `title` + +```python +title = ZeroOrOne('c:title', successors=_tag_seq[7:]) +``` + +### `txPr` + +```python +txPr = ZeroOrOne('c:txPr', successors=_tag_seq[13:]) +``` + +## `CT_ChartLines` + +Bases: `BaseOxmlElement` + +Used for `c:majorGridlines` and `c:minorGridlines`. + +Specifies gridlines visual properties such as color and width. + +### `spPr` + +```python +spPr = ZeroOrOne('c:spPr', successors=()) +``` + +## `CT_Crosses` + +Bases: `BaseOxmlElement` + +`c:crosses` element, specifying where the other axis crosses this one. + +### `val` + +```python +val = RequiredAttribute('val', XL_AXIS_CROSSES) +``` + +## `CT_DateAx` + +Bases: `BaseAxisElement` + +`c:dateAx` element, defining a date (category) axis. + +### `crosses` + +```python +crosses = ZeroOrOne('c:crosses', successors=_tag_seq[15:]) +``` + +### `crossesAt` + +```python +crossesAt = ZeroOrOne('c:crossesAt', successors=_tag_seq[16:]) +``` + +### `delete_` + +```python +delete_ = ZeroOrOne('c:delete', successors=_tag_seq[3:]) +``` + +### `lblOffset` + +```python +lblOffset = ZeroOrOne('c:lblOffset', successors=_tag_seq[18:]) +``` + +### `majorGridlines` + +```python +majorGridlines = ZeroOrOne('c:majorGridlines', successors=_tag_seq[5:]) +``` + +### `majorTickMark` + +```python +majorTickMark = ZeroOrOne('c:majorTickMark', successors=_tag_seq[9:]) +``` + +### `minorGridlines` + +```python +minorGridlines = ZeroOrOne('c:minorGridlines', successors=_tag_seq[6:]) +``` + +### `minorTickMark` + +```python +minorTickMark = ZeroOrOne('c:minorTickMark', successors=_tag_seq[10:]) +``` + +### `numFmt` + +```python +numFmt = ZeroOrOne('c:numFmt', successors=_tag_seq[8:]) +``` + +### `scaling` + +```python +scaling = OneAndOnlyOne('c:scaling') +``` + +### `spPr` + +```python +spPr = ZeroOrOne('c:spPr', successors=_tag_seq[12:]) +``` + +### `tickLblPos` + +```python +tickLblPos = ZeroOrOne('c:tickLblPos', successors=_tag_seq[11:]) +``` + +### `title` + +```python +title = ZeroOrOne('c:title', successors=_tag_seq[7:]) +``` + +### `txPr` + +```python +txPr = ZeroOrOne('c:txPr', successors=_tag_seq[13:]) +``` + +## `CT_LblOffset` + +Bases: `BaseOxmlElement` + +`c:lblOffset` custom element class. + +### `val` + +```python +val = OptionalAttribute('val', ST_LblOffset, default=100) +``` + +## `CT_Orientation` + +Bases: `BaseOxmlElement` + +`c:xAx/c:scaling/c:orientation` element, defining category order. + +Used to reverse the order categories appear in on a bar chart so they start at the +top rather than the bottom. Because we read top-to-bottom, the default way looks odd +to many and perhaps most folks. Also applicable to value and date axes. + +### `val` + +```python +val = OptionalAttribute('val', ST_Orientation, default=ST_Orientation.MIN_MAX) +``` + +## `CT_Scaling` + +Bases: `BaseOxmlElement` + +`c:scaling` element. + +Defines axis scale characteristics such as maximum value, log vs. linear, etc. + +### `max` + +```python +max = ZeroOrOne('c:max', successors=_tag_seq[3:]) +``` + +### `maximum` + +```python +maximum +``` + +The float value of the ```` child element, or `None` if no max +element is present. + +### `min` + +```python +min = ZeroOrOne('c:min', successors=_tag_seq[4:]) +``` + +### `minimum` + +```python +minimum +``` + +The float value of the ```` child element, or `None` if no min +element is present. + +### `orientation` + +```python +orientation = ZeroOrOne('c:orientation', successors=_tag_seq[2:]) +``` + +## `CT_TickLblPos` + +Bases: `BaseOxmlElement` + +`c:tickLblPos` element. + +### `val` + +```python +val = OptionalAttribute('val', XL_TICK_LABEL_POSITION) +``` + +## `CT_TickMark` + +Bases: `BaseOxmlElement` + +Used for `c:minorTickMark` and `c:majorTickMark`. + +### `val` + +```python +val = OptionalAttribute('val', XL_TICK_MARK, default=XL_TICK_MARK.CROSS) +``` + +## `CT_ValAx` + +Bases: `BaseAxisElement` + +`c:valAx` element, defining a value axis. + +### `crossAx` + +```python +crossAx = ZeroOrOne('c:crossAx', successors=_tag_seq[14:]) +``` + +### `crosses` + +```python +crosses = ZeroOrOne('c:crosses', successors=_tag_seq[15:]) +``` + +### `crossesAt` + +```python +crossesAt = ZeroOrOne('c:crossesAt', successors=_tag_seq[16:]) +``` + +### `delete_` + +```python +delete_ = ZeroOrOne('c:delete', successors=_tag_seq[3:]) +``` + +### `majorGridlines` + +```python +majorGridlines = ZeroOrOne('c:majorGridlines', successors=_tag_seq[5:]) +``` + +### `majorTickMark` + +```python +majorTickMark = ZeroOrOne('c:majorTickMark', successors=_tag_seq[9:]) +``` + +### `majorUnit` + +```python +majorUnit = ZeroOrOne('c:majorUnit', successors=_tag_seq[18:]) +``` + +### `minorGridlines` + +```python +minorGridlines = ZeroOrOne('c:minorGridlines', successors=_tag_seq[6:]) +``` + +### `minorTickMark` + +```python +minorTickMark = ZeroOrOne('c:minorTickMark', successors=_tag_seq[10:]) +``` + +### `minorUnit` + +```python +minorUnit = ZeroOrOne('c:minorUnit', successors=_tag_seq[19:]) +``` + +### `numFmt` + +```python +numFmt = ZeroOrOne('c:numFmt', successors=_tag_seq[8:]) +``` + +### `scaling` + +```python +scaling = OneAndOnlyOne('c:scaling') +``` + +### `spPr` + +```python +spPr = ZeroOrOne('c:spPr', successors=_tag_seq[12:]) +``` + +### `tickLblPos` + +```python +tickLblPos = ZeroOrOne('c:tickLblPos', successors=_tag_seq[11:]) +``` + +### `title` + +```python +title = ZeroOrOne('c:title', successors=_tag_seq[7:]) +``` + +### `txPr` + +```python +txPr = ZeroOrOne('c:txPr', successors=_tag_seq[13:]) +``` + + + + + +# `pptx.oxml.chart.chart` + +Custom element classes for top-level chart-related XML elements. + +## `CT_Chart` + +Bases: `BaseOxmlElement` + +`c:chart` custom element class. + +### `autoTitleDeleted` + +```python +autoTitleDeleted = ZeroOrOne('c:autoTitleDeleted', successors=_tag_seq[2:]) +``` + +### `has_legend` + +```python +has_legend +``` + +True if this chart has a legend defined, False otherwise. + +### `legend` + +```python +legend = ZeroOrOne('c:legend', successors=_tag_seq[9:]) +``` + +### `new_chart` + +```python +new_chart(rId: str) -> CT_Chart +``` + +Return a new `c:chart` element. + +### `plotArea` + +```python +plotArea = OneAndOnlyOne('c:plotArea') +``` + +### `rId` + +```python +rId: str = RequiredAttribute('r:id', XsdString) +``` + +### `title` + +```python +title = ZeroOrOne('c:title', successors=_tag_seq[1:]) +``` + +## `CT_ChartSpace` + +Bases: `BaseOxmlElement` + +`c:chartSpace` root element of a chart part. + +### `catAx_lst` + +```python +catAx_lst +``` + +### `chart` + +```python +chart = OneAndOnlyOne('c:chart') +``` + +### `date1904` + +```python +date1904 = ZeroOrOne('c:date1904', successors=_tag_seq[1:]) +``` + +### `dateAx_lst` + +```python +dateAx_lst +``` + +### `date_1904` + +```python +date_1904 +``` + +Return `True` if the `c:date1904` child element resolves truthy, +`False` otherwise. This value indicates whether date number values +are based on the 1900 or 1904 epoch. + +### `externalData` + +```python +externalData = ZeroOrOne('c:externalData', successors=_tag_seq[11:]) +``` + +### `get_or_add_title` + +```python +get_or_add_title() +``` + +Return the `c:title` grandchild, newly created if not present. + +### `plotArea` + +```python +plotArea +``` + +Return the required `c:chartSpace/c:chart/c:plotArea` grandchild +element. + +### `style` + +```python +style = ZeroOrOne('c:style', successors=_tag_seq[4:]) +``` + +### `txPr` + +```python +txPr = ZeroOrOne('c:txPr', successors=_tag_seq[10:]) +``` + +### `valAx_lst` + +```python +valAx_lst +``` + +### `xlsx_part_rId` + +```python +xlsx_part_rId +``` + +The string in the required ``r:id`` attribute of the +`` child, or `None` if no externalData element is +present. + +## `CT_ExternalData` + +Bases: `BaseOxmlElement` + +`` element, defining link to embedded Excel package part +containing the chart data. + +### `autoUpdate` + +```python +autoUpdate = ZeroOrOne('c:autoUpdate') +``` + +### `rId` + +```python +rId = RequiredAttribute('r:id', XsdString) +``` + +## `CT_PlotArea` + +Bases: `BaseOxmlElement` + +```` element. + +### `catAx` + +```python +catAx = ZeroOrMore('c:catAx') +``` + +### `iter_sers` + +```python +iter_sers() +``` + +Generate each of the `c:ser` elements in this chart, ordered first by +the document order of the containing xChart element, then by their +ordering within the xChart element (not necessarily document order). + +### `iter_xCharts` + +```python +iter_xCharts() +``` + +Generate each xChart child element in document. + +### `last_ser` + +```python +last_ser +``` + +Return the last `` element in the last xChart element, based +on series order (not necessarily the same element as document order). + +### `next_idx` + +```python +next_idx +``` + +Return the next available `c:ser/c:idx` value within the scope of +this chart, the maximum idx value found on existing series, +incremented by one. + +### `next_order` + +```python +next_order +``` + +Return the next available `c:ser/c:order` value within the scope of +this chart, the maximum order value found on existing series, +incremented by one. + +### `sers` + +```python +sers +``` + +Return a sequence containing all the `c:ser` elements in this chart, +ordered first by the document order of the containing xChart element, +then by their ordering within the xChart element (not necessarily +document order). + +### `valAx` + +```python +valAx = ZeroOrMore('c:valAx') +``` + +### `xCharts` + +```python +xCharts +``` + +Return a sequence containing all the `c:{x}Chart` elements in this +chart, in document order. + +## `CT_Style` + +Bases: `BaseOxmlElement` + +```` element; defines the chart style. + +### `val` + +```python +val = RequiredAttribute('val', ST_Style) +``` + + + + + +# `pptx.oxml.chart.datalabel` + +Chart data-label related oxml objects. + +## `CT_DLbl` + +Bases: `BaseOxmlElement` + +```` element specifying the properties of the data label for an +individual data point. + +### `dLblPos` + +```python +dLblPos = ZeroOrOne('c:dLblPos', successors=_tag_seq[7:]) +``` + +### `get_or_add_rich` + +```python +get_or_add_rich() +``` + +Return the `c:rich` descendant representing the text frame of the +data label, newly created if not present. Any existing `c:strRef` +element is removed along with its contents. + +### `get_or_add_tx_rich` + +```python +get_or_add_tx_rich() +``` + +Return the `c:tx[c:rich]` subtree, newly created if not present. + +### `idx` + +```python +idx = OneAndOnlyOne('c:idx') +``` + +### `idx_val` + +```python +idx_val +``` + +The integer value of the `val` attribute on the required `c:idx` +child. + +### `new_dLbl` + +```python +new_dLbl() +``` + +Return a newly created "loose" `c:dLbl` element. + +The `c:dLbl` element contains the same (fairly extensive) default +subtree added by PowerPoint when an individual data label is +customized in the UI. Note that the idx value must be set by the +client. Failure to set the idx value will likely result in any +changes not being visible and may result in a repair error on open. + +### `remove_tx_rich` + +```python +remove_tx_rich() +``` + +Remove any `c:tx[c:rich]` child, or do nothing if not present. + +### `spPr` + +```python +spPr = ZeroOrOne('c:spPr', successors=_tag_seq[5:]) +``` + +### `tx` + +```python +tx = ZeroOrOne('c:tx', successors=_tag_seq[3:]) +``` + +### `txPr` + +```python +txPr = ZeroOrOne('c:txPr', successors=_tag_seq[6:]) +``` + +## `CT_DLblPos` + +Bases: `BaseOxmlElement` + +```` element specifying the positioning of a data label with +respect to its data point. + +### `val` + +```python +val = RequiredAttribute('val', XL_DATA_LABEL_POSITION) +``` + +## `CT_DLbls` + +Bases: `BaseOxmlElement` + +`c:dLbls` element specifying properties for a set of data labels. + +### `dLbl` + +```python +dLbl = ZeroOrMore('c:dLbl', successors=_tag_seq[1:]) +``` + +### `dLblPos` + +```python +dLblPos = ZeroOrOne('c:dLblPos', successors=_tag_seq[5:]) +``` + +### `defRPr` + +```python +defRPr +``` + +```` great-great-grandchild element, added with its +ancestors if not present. + +### `get_dLbl_for_point` + +```python +get_dLbl_for_point(idx) +``` + +Return the `c:dLbl` child representing the label for the data point +at index *idx*. + +### `get_or_add_dLbl_for_point` + +```python +get_or_add_dLbl_for_point(idx) +``` + +Return the `c:dLbl` element representing the label of the point at +index *idx*. + +### `new_dLbls` + +```python +new_dLbls() +``` + +Return a newly created "loose" `c:dLbls` element. + +### `numFmt` + +```python +numFmt = ZeroOrOne('c:numFmt', successors=_tag_seq[2:]) +``` + +### `showCatName` + +```python +showCatName = ZeroOrOne('c:showCatName', successors=_tag_seq[8:]) +``` + +### `showLegendKey` + +```python +showLegendKey = ZeroOrOne('c:showLegendKey', successors=_tag_seq[6:]) +``` + +### `showPercent` + +```python +showPercent = ZeroOrOne('c:showPercent', successors=_tag_seq[10:]) +``` + +### `showSerName` + +```python +showSerName = ZeroOrOne('c:showSerName', successors=_tag_seq[9:]) +``` + +### `showVal` + +```python +showVal = ZeroOrOne('c:showVal', successors=_tag_seq[7:]) +``` + +### `txPr` + +```python +txPr = ZeroOrOne('c:txPr', successors=_tag_seq[4:]) +``` + + + + + +# `pptx.oxml.chart.legend` + +lxml custom element classes for legend-related XML elements. + +## `CT_Legend` + +Bases: `BaseOxmlElement` + +```` custom element class + +### `defRPr` + +```python +defRPr +``` + +`./c:txPr/a:p/a:pPr/a:defRPr` great-great-grandchild element, added +with its ancestors if not present. + +### `horz_offset` + +```python +horz_offset +``` + +The float value in ./c:layout/c:manualLayout/c:x when +./c:layout/c:manualLayout/c:xMode@val == "factor". 0.0 if that +XPath expression has no match. + +### `layout` + +```python +layout = ZeroOrOne('c:layout', successors=_tag_seq[3:]) +``` + +### `legendPos` + +```python +legendPos = ZeroOrOne('c:legendPos', successors=_tag_seq[1:]) +``` + +### `overlay` + +```python +overlay = ZeroOrOne('c:overlay', successors=_tag_seq[4:]) +``` + +### `txPr` + +```python +txPr = ZeroOrOne('c:txPr', successors=_tag_seq[6:]) +``` + +## `CT_LegendPos` + +Bases: `BaseOxmlElement` + +```` element specifying position of legend with respect to +chart as a member of ST_LegendPos. + +### `val` + +```python +val = OptionalAttribute('val', XL_LEGEND_POSITION, default=XL_LEGEND_POSITION.RIGHT) +``` + + + + + +# `pptx.oxml.chart.marker` + +Series-related oxml objects. + +## `CT_Marker` + +Bases: `BaseOxmlElement` + +`c:marker` custom element class, containing visual properties for a data +point marker on line-type charts. + +### `size` + +```python +size = ZeroOrOne('c:size', successors=_tag_seq[2:]) +``` + +### `size_val` + +```python +size_val +``` + +Return the value of `./c:size/@val`, specifying the size of this +marker in points. Returns `None` if no `c:size` element is present or +its val attribute is not present. + +### `spPr` + +```python +spPr = ZeroOrOne('c:spPr', successors=_tag_seq[3:]) +``` + +### `symbol` + +```python +symbol = ZeroOrOne('c:symbol', successors=_tag_seq[1:]) +``` + +### `symbol_val` + +```python +symbol_val +``` + +Return the value of `./c:symbol/@val`, specifying the shape of this +marker. Returns `None` if no `c:symbol` element is present. + +## `CT_MarkerSize` + +Bases: `BaseOxmlElement` + +`c:size` custom element class, specifying the size (in points) of a data +point marker for a line, XY, or radar chart. + +### `val` + +```python +val = RequiredAttribute('val', ST_MarkerSize) +``` + +## `CT_MarkerStyle` + +Bases: `BaseOxmlElement` + +`c:symbol` custom element class, specifying the shape of a data point +marker for a line, XY, or radar chart. + +### `val` + +```python +val = RequiredAttribute('val', XL_MARKER_STYLE) +``` + + + + + +# `pptx.oxml.chart.plot` + +Plot-related oxml objects. + +## `BaseChartElement` + +Bases: `BaseOxmlElement` + +Base class for barChart, lineChart, and other plot elements. + +### `cat` + +```python +cat +``` + +Return the `c:cat` element of the first series in this xChart, or +`None` if not present. + +### `cat_pt_count` + +```python +cat_pt_count +``` + +Return the value of the `c:ptCount` descendent of this xChart +element. Its parent can be one of three element types. This value +represents the true number of (leaf) categories, although they might +not all have a corresponding `c:pt` sibling; a category with no label +does not get a `c:pt` element. Returns 0 if there is no `c:ptCount` +descendent. + +### `cat_pts` + +```python +cat_pts +``` + +Return a sequence representing the `c:pt` elements under the `c:cat` +element of the first series in this xChart element. A category having +no value will have no corresponding `c:pt` element; `None` will +appear in that position in such cases. Items appear in `idx` order. +Only those in the first ```` element are included in the case +of multi-level categories. + +### `grouping_val` + +```python +grouping_val +``` + +Return the value of the ``./c:grouping{val=?}`` attribute, taking +defaults into account when items are not present. + +### `iter_sers` + +```python +iter_sers() +``` + +Generate each ```` child element in this xChart in +c:order/@val sequence (not document or c:idx order). + +### `sers` + +```python +sers +``` + +Sequence of ```` child elements in this xChart in c:order/@val +sequence (not document or c:idx order). + +## `CT_Area3DChart` + +Bases: `BaseChartElement` + +```` element. + +### `grouping` + +```python +grouping = ZeroOrOne('c:grouping', successors=('c:varyColors', 'c:ser', 'c:dLbls', 'c:dropLines', 'c:gapDepth', 'c:axId')) +``` + +## `CT_AreaChart` + +Bases: `BaseChartElement` + +```` element. + +### `dLbls` + +```python +dLbls = ZeroOrOne('c:dLbls', successors=_tag_seq[4:]) +``` + +### `grouping` + +```python +grouping = ZeroOrOne('c:grouping', successors=_tag_seq[1:]) +``` + +### `ser` + +```python +ser = ZeroOrMore('c:ser', successors=_tag_seq[3:]) +``` + +### `varyColors` + +```python +varyColors = ZeroOrOne('c:varyColors', successors=_tag_seq[2:]) +``` + +## `CT_BarChart` + +Bases: `BaseChartElement` + +```` element. + +### `barDir` + +```python +barDir = OneAndOnlyOne('c:barDir') +``` + +### `dLbls` + +```python +dLbls = ZeroOrOne('c:dLbls', successors=_tag_seq[5:]) +``` + +### `gapWidth` + +```python +gapWidth = ZeroOrOne('c:gapWidth', successors=_tag_seq[6:]) +``` + +### `grouping` + +```python +grouping = ZeroOrOne('c:grouping', successors=_tag_seq[2:]) +``` + +### `grouping_val` + +```python +grouping_val +``` + +Return the value of the ``./c:grouping{val=?}`` attribute, taking +defaults into account when items are not present. + +### `overlap` + +```python +overlap = ZeroOrOne('c:overlap', successors=_tag_seq[7:]) +``` + +### `ser` + +```python +ser = ZeroOrMore('c:ser', successors=_tag_seq[4:]) +``` + +### `varyColors` + +```python +varyColors = ZeroOrOne('c:varyColors', successors=_tag_seq[3:]) +``` + +## `CT_BarDir` + +Bases: `BaseOxmlElement` + +```` child of a barChart element, specifying the orientation of +the bars, 'bar' if they are horizontal and 'col' if they are vertical. + +### `val` + +```python +val = OptionalAttribute('val', ST_BarDir, default=ST_BarDir.COL) +``` + +## `CT_BubbleChart` + +Bases: `BaseChartElement` + +```` custom element class + +### `bubble3D` + +```python +bubble3D = ZeroOrOne('c:bubble3D', successors=_tag_seq[5:]) +``` + +### `bubbleScale` + +```python +bubbleScale = ZeroOrOne('c:bubbleScale', successors=_tag_seq[6:]) +``` + +### `dLbls` + +```python +dLbls = ZeroOrOne('c:dLbls', successors=_tag_seq[3:]) +``` + +### `ser` + +```python +ser = ZeroOrMore('c:ser', successors=_tag_seq[2:]) +``` + +## `CT_BubbleScale` + +Bases: `BaseChartElement` + +```` custom element class + +### `val` + +```python +val = OptionalAttribute('val', ST_BubbleScale, default=100) +``` + +## `CT_DoughnutChart` + +Bases: `BaseChartElement` + +```` element. + +### `dLbls` + +```python +dLbls = ZeroOrOne('c:dLbls', successors=_tag_seq[3:]) +``` + +### `ser` + +```python +ser = ZeroOrMore('c:ser', successors=_tag_seq[2:]) +``` + +### `varyColors` + +```python +varyColors = ZeroOrOne('c:varyColors', successors=_tag_seq[1:]) +``` + +## `CT_GapAmount` + +Bases: `BaseOxmlElement` + +```` child of ```` element, also used for other +purposes like error bars. + +### `val` + +```python +val = OptionalAttribute('val', ST_GapAmount, default=150) +``` + +## `CT_Grouping` + +Bases: `BaseOxmlElement` + +```` child of an xChart element, specifying a value like +'clustered' or 'stacked'. Also used for variants with the same tag name +like CT_BarGrouping. + +### `val` + +```python +val = OptionalAttribute('val', ST_Grouping) +``` + +## `CT_LineChart` + +Bases: `BaseChartElement` + +```` custom element class + +### `dLbls` + +```python +dLbls = ZeroOrOne('c:dLbls', successors=_tag_seq[4:]) +``` + +### `grouping` + +```python +grouping = ZeroOrOne('c:grouping', successors=_tag_seq[1:]) +``` + +### `ser` + +```python +ser = ZeroOrMore('c:ser', successors=_tag_seq[3:]) +``` + +### `varyColors` + +```python +varyColors = ZeroOrOne('c:varyColors', successors=_tag_seq[2:]) +``` + +## `CT_Overlap` + +Bases: `BaseOxmlElement` + +```` element specifying bar overlap as an integer percentage +of bar width, in range -100 to 100. + +### `val` + +```python +val = OptionalAttribute('val', ST_Overlap, default=0) +``` + +## `CT_PieChart` + +Bases: `BaseChartElement` + +```` custom element class + +### `dLbls` + +```python +dLbls = ZeroOrOne('c:dLbls', successors=_tag_seq[3:]) +``` + +### `ser` + +```python +ser = ZeroOrMore('c:ser', successors=_tag_seq[2:]) +``` + +### `varyColors` + +```python +varyColors = ZeroOrOne('c:varyColors', successors=_tag_seq[1:]) +``` + +## `CT_RadarChart` + +Bases: `BaseChartElement` + +```` custom element class + +### `dLbls` + +```python +dLbls = ZeroOrOne('c:dLbls', successors=_tag_seq[4:]) +``` + +### `ser` + +```python +ser = ZeroOrMore('c:ser', successors=_tag_seq[3:]) +``` + +### `varyColors` + +```python +varyColors = ZeroOrOne('c:varyColors', successors=_tag_seq[2:]) +``` + +## `CT_ScatterChart` + +Bases: `BaseChartElement` + +```` custom element class + +### `ser` + +```python +ser = ZeroOrMore('c:ser', successors=_tag_seq[3:]) +``` + +### `varyColors` + +```python +varyColors = ZeroOrOne('c:varyColors', successors=_tag_seq[2:]) +``` + + + + + +# `pptx.oxml.chart.series` + +Series-related oxml objects. + +## `CT_AxDataSource` + +Bases: `BaseOxmlElement` + +```` custom element class used in category charts to specify +category labels and hierarchy. + +### `lvls` + +```python +lvls +``` + +Return a list containing the `c:lvl` descendent elements in document +order. These will only be present when the required single child +is a `c:multiLvlStrRef` element. Returns an empty list when no +`c:lvl` descendent elements are present. + +### `multiLvlStrRef` + +```python +multiLvlStrRef = ZeroOrOne('c:multiLvlStrRef', successors=()) +``` + +## `CT_DPt` + +Bases: `BaseOxmlElement` + +```` custom element class, containing visual properties for a data +point. + +### `idx` + +```python +idx = OneAndOnlyOne('c:idx') +``` + +### `marker` + +```python +marker = ZeroOrOne('c:marker', successors=_tag_seq[3:]) +``` + +### `new_dPt` + +```python +new_dPt() +``` + +Return a newly created "loose" `c:dPt` element containing its default +subtree. + +### `spPr` + +```python +spPr = ZeroOrOne('c:spPr', successors=_tag_seq[6:]) +``` + +## `CT_Lvl` + +Bases: `BaseOxmlElement` + +```` custom element class used in multi-level categories to +specify a level of hierarchy. + +### `pt` + +```python +pt = ZeroOrMore('c:pt', successors=()) +``` + +## `CT_NumDataSource` + +Bases: `BaseOxmlElement` + +```` custom element class used in XY and bubble charts, and +perhaps others. + +### `numRef` + +```python +numRef = OneAndOnlyOne('c:numRef') +``` + +### `ptCount_val` + +```python +ptCount_val +``` + +Return the value of `./c:numRef/c:numCache/c:ptCount/@val`, +specifying how many `c:pt` elements are in this numeric data cache. +Returns 0 if no `c:ptCount` element is present, as this is the least +disruptive way to degrade when no cached point data is available. +This situation is not expected, but is valid according to the schema. + +### `pt_v` + +```python +pt_v(idx) +``` + +Return the Y value for data point *idx* in this cache, or None if no +value is present for that data point. + +## `CT_SeriesComposite` + +Bases: `BaseOxmlElement` + +```` custom element class. Note there are several different series +element types in the schema, such as ``CT_LineSer`` and ``CT_BarSer``, +but they all share the same tag name. This class acts as a composite and +depends on the caller not to do anything invalid for a series belonging +to a particular plot type. + +### `bubbleSize` + +```python +bubbleSize = ZeroOrOne('c:bubbleSize', successors=_tag_seq[19:]) +``` + +### `bubbleSize_ptCount_val` + +```python +bubbleSize_ptCount_val +``` + +Return the number of bubble size values as reflected in the `val` +attribute of `./c:bubbleSize//c:ptCount`, or 0 if not present. + +### `cat` + +```python +cat = ZeroOrOne('c:cat', successors=_tag_seq[13:]) +``` + +### `cat_ptCount_val` + +```python +cat_ptCount_val +``` + +Return the number of categories as reflected in the `val` attribute +of `./c:cat//c:ptCount`, or 0 if not present. + +### `dLbls` + +```python +dLbls = ZeroOrOne('c:dLbls', successors=_tag_seq[10:]) +``` + +### `dPt` + +```python +dPt = ZeroOrMore('c:dPt', successors=_tag_seq[9:]) +``` + +### `get_dLbl` + +```python +get_dLbl(idx) +``` + +Return the `c:dLbl` element representing the label for the data point +at offset *idx* in this series, or `None` if not present. + +### `get_or_add_dLbl` + +```python +get_or_add_dLbl(idx) +``` + +Return the `c:dLbl` element representing the label of the point at +offset *idx* in this series, newly created if not yet present. + +### `get_or_add_dPt_for_point` + +```python +get_or_add_dPt_for_point(idx) +``` + +Return the `c:dPt` child representing the visual properties of the +data point at index *idx*. + +### `idx` + +```python +idx = OneAndOnlyOne('c:idx') +``` + +### `invertIfNegative` + +```python +invertIfNegative = ZeroOrOne('c:invertIfNegative', successors=_tag_seq[5:]) +``` + +### `marker` + +```python +marker = ZeroOrOne('c:marker', successors=_tag_seq[7:]) +``` + +### `order` + +```python +order = OneAndOnlyOne('c:order') +``` + +### `smooth` + +```python +smooth = ZeroOrOne('c:smooth', successors=_tag_seq[18:]) +``` + +### `spPr` + +```python +spPr = ZeroOrOne('c:spPr', successors=_tag_seq[4:]) +``` + +### `tx` + +```python +tx = ZeroOrOne('c:tx', successors=_tag_seq[3:]) +``` + +### `val` + +```python +val = ZeroOrOne('c:val', successors=_tag_seq[14:]) +``` + +### `xVal` + +```python +xVal = ZeroOrOne('c:xVal', successors=_tag_seq[15:]) +``` + +### `xVal_ptCount_val` + +```python +xVal_ptCount_val +``` + +Return the number of X values as reflected in the `val` attribute of +`./c:xVal//c:ptCount`, or 0 if not present. + +### `yVal` + +```python +yVal = ZeroOrOne('c:yVal', successors=_tag_seq[16:]) +``` + +### `yVal_ptCount_val` + +```python +yVal_ptCount_val +``` + +Return the number of Y values as reflected in the `val` attribute of +`./c:yVal//c:ptCount`, or 0 if not present. + +## `CT_StrVal_NumVal_Composite` + +Bases: `BaseOxmlElement` + +```` element, can be either CT_StrVal or CT_NumVal complex type. +Using this class for both, differentiating as needed. + +### `idx` + +```python +idx = RequiredAttribute('idx', XsdUnsignedInt) +``` + +### `v` + +```python +v = OneAndOnlyOne('c:v') +``` + +### `value` + +```python +value +``` + +The float value of the text in the required ```` child. + + + + + +# `pptx.oxml.chart.shared` + +Shared oxml objects for charts. + +## `CT_Boolean` + +Bases: `BaseOxmlElement` + +Common complex type used for elements having a True/False value. + +### `val` + +```python +val = OptionalAttribute('val', XsdBoolean, default=True) +``` + +## `CT_Boolean_Explicit` + +Bases: `BaseOxmlElement` + +Always spells out the `val` attribute, e.g. `val=1`. + +At least one boolean element is improperly interpreted by one or more +versions of PowerPoint. The `c:overlay` element is interpreted as `False` +when no `val` attribute is present, contrary to the behavior described in +the schema. A remedy for this is to interpret a missing `val` attribute +as `True` (consistent with the spec), but always write the attribute +whenever there is occasion for changing the element. + +### `val` + +```python +val +``` + +## `CT_Double` + +Bases: `BaseOxmlElement` + +Used for floating point values. + +### `val` + +```python +val = RequiredAttribute('val', XsdDouble) +``` + +## `CT_Layout` + +Bases: `BaseOxmlElement` + +```` custom element class + +### `horz_offset` + +```python +horz_offset +``` + +The float value in ./c:manualLayout/c:x when +c:layout/c:manualLayout/c:xMode@val == "factor". 0.0 if that XPath +expression finds no match. + +### `manualLayout` + +```python +manualLayout = ZeroOrOne('c:manualLayout', successors=('c:extLst',)) +``` + +## `CT_LayoutMode` + +Bases: `BaseOxmlElement` + +Used for ````, ````, ````, and ```` +child elements of CT_ManualLayout. + +### `val` + +```python +val = OptionalAttribute('val', ST_LayoutMode, default=ST_LayoutMode.FACTOR) +``` + +## `CT_ManualLayout` + +Bases: `BaseOxmlElement` + +```` custom element class + +### `horz_offset` + +```python +horz_offset +``` + +The float value in ./c:x@val when ./c:xMode@val == "factor". 0.0 when +./c:x is not present or ./c:xMode@val != "factor". + +### `x` + +```python +x = ZeroOrOne('c:x', successors=_tag_seq[6:]) +``` + +### `xMode` + +```python +xMode = ZeroOrOne('c:xMode', successors=_tag_seq[2:]) +``` + +## `CT_NumFmt` + +Bases: `BaseOxmlElement` + +```` element specifying the formatting for number labels on a +tick mark or data point. + +### `formatCode` + +```python +formatCode = RequiredAttribute('formatCode', XsdString) +``` + +### `sourceLinked` + +```python +sourceLinked = OptionalAttribute('sourceLinked', XsdBoolean) +``` + +## `CT_Title` + +Bases: `BaseOxmlElement` + +`c:title` custom element class. + +### `get_or_add_tx_rich` + +```python +get_or_add_tx_rich() +``` + +Return `c:tx/c:rich`, newly created if not present. + +Return the `c:rich` grandchild at `c:tx/c:rich`. Both the `c:tx` and +`c:rich` elements are created if not already present. Any +`c:tx/c:strRef` element is removed. (Such an element would contain +a cell reference for the axis title text in the chart's Excel +worksheet.) + +### `new_title` + +```python +new_title() +``` + +Return "loose" `c:title` element containing default children. + +### `spPr` + +```python +spPr = ZeroOrOne('c:spPr', successors=_tag_seq[4:]) +``` + +### `tx` + +```python +tx = ZeroOrOne('c:tx', successors=_tag_seq[1:]) +``` + +### `tx_rich` + +```python +tx_rich +``` + +Return `c:tx/c:rich` or `None` if not present. + +## `CT_Tx` + +Bases: `BaseOxmlElement` + +```` element containing the text for a label on a data point or +other chart item. + +### `rich` + +```python +rich = ZeroOrOne('c:rich') +``` + +### `strRef` + +```python +strRef = ZeroOrOne('c:strRef') +``` + +## `CT_UnsignedInt` + +Bases: `BaseOxmlElement` + +```` element and others. + +### `val` + +```python +val = RequiredAttribute('val', XsdUnsignedInt) +``` + + + + + +# `pptx.oxml.coreprops` + +lxml 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` + +```python +author_text: str +``` + +### `category` + +```python +category = ZeroOrOne('cp:category', successors=()) +``` + +### `category_text` + +```python +category_text: str +``` + +### `comments_text` + +```python +comments_text: str +``` + +### `contentStatus` + +```python +contentStatus = ZeroOrOne('cp:contentStatus', successors=()) +``` + +### `contentStatus_text` + +```python +contentStatus_text: str +``` + +### `created` + +```python +created = ZeroOrOne('dcterms:created', successors=()) +``` + +### `created_datetime` + +```python +created_datetime +``` + +### `creator` + +```python +creator = ZeroOrOne('dc:creator', successors=()) +``` + +### `description` + +```python +description = ZeroOrOne('dc:description', successors=()) +``` + +### `get_or_add_revision` + +```python +get_or_add_revision: Callable[[], _Element] +``` + +### `identifier` + +```python +identifier = ZeroOrOne('dc:identifier', successors=()) +``` + +### `identifier_text` + +```python +identifier_text: str +``` + +### `keywords` + +```python +keywords = ZeroOrOne('cp:keywords', successors=()) +``` + +### `keywords_text` + +```python +keywords_text: str +``` + +### `language` + +```python +language = ZeroOrOne('dc:language', successors=()) +``` + +### `language_text` + +```python +language_text: str +``` + +### `lastModifiedBy` + +```python +lastModifiedBy = ZeroOrOne('cp:lastModifiedBy', successors=()) +``` + +### `lastModifiedBy_text` + +```python +lastModifiedBy_text: str +``` + +### `lastPrinted` + +```python +lastPrinted = ZeroOrOne('cp:lastPrinted', successors=()) +``` + +### `lastPrinted_datetime` + +```python +lastPrinted_datetime +``` + +### `modified` + +```python +modified = ZeroOrOne('dcterms:modified', successors=()) +``` + +### `modified_datetime` + +```python +modified_datetime +``` + +### `new_coreProperties` + +```python +new_coreProperties() -> CT_CoreProperties +``` + +Return a new `cp:coreProperties` element + +### `revision` + +```python +revision: _Element | None = ZeroOrOne('cp:revision', successors=()) +``` + +### `revision_number` + +```python +revision_number: int +``` + +Integer value of revision property. + +### `subject` + +```python +subject = ZeroOrOne('dc:subject', successors=()) +``` + +### `subject_text` + +```python +subject_text: str +``` + +### `title` + +```python +title = ZeroOrOne('dc:title', successors=()) +``` + +### `title_text` + +```python +title_text: str +``` + +### `version` + +```python +version = ZeroOrOne('cp:version', successors=()) +``` + +### `version_text` + +```python +version_text: str +``` + + + + + +# `pptx.oxml.dml.color` + +lxml custom element classes for DrawingML-related XML elements. + +## `CT_Color` + +Bases: `BaseOxmlElement` + +Custom element class for `a:fgClr`, `a:bgClr` and perhaps others. + +### `eg_colorChoice` + +```python +eg_colorChoice = ZeroOrOneChoice((Choice('a:scrgbClr'), Choice('a:srgbClr'), Choice('a:hslClr'), Choice('a:sysClr'), Choice('a:schemeClr'), Choice('a:prstClr')), successors=()) +``` + +## `CT_HslColor` + +Bases: `_BaseColorElement` + +Custom element class for element. + +## `CT_Percentage` + +Bases: `BaseOxmlElement` + +Custom element class for and elements. + +### `val` + +```python +val = RequiredAttribute('val', ST_Percentage) +``` + +## `CT_PresetColor` + +Bases: `_BaseColorElement` + +Custom element class for element. + +## `CT_SRgbColor` + +Bases: `_BaseColorElement` + +Custom element class for element. + +### `val` + +```python +val = RequiredAttribute('val', ST_HexColorRGB) +``` + +## `CT_ScRgbColor` + +Bases: `_BaseColorElement` + +Custom element class for element. + +## `CT_SchemeColor` + +Bases: `_BaseColorElement` + +Custom element class for element. + +### `val` + +```python +val = RequiredAttribute('val', MSO_THEME_COLOR) +``` + +## `CT_SystemColor` + +Bases: `_BaseColorElement` + +Custom element class for element. + + + + + +# `pptx.oxml.dml.fill` + +lxml custom element classes for DrawingML-related XML elements. + +## `CT_Blip` + +Bases: `BaseOxmlElement` + + element + +### `rEmbed` + +```python +rEmbed = OptionalAttribute('r:embed', ST_RelationshipId) +``` + +## `CT_BlipFillProperties` + +Bases: `BaseOxmlElement` + +Custom element class for element. + +### `blip` + +```python +blip = ZeroOrOne('a:blip', successors=_tag_seq[1:]) +``` + +### `crop` + +```python +crop(cropping) +``` + +Set `a:srcRect` child to crop according to *cropping* values. + +### `srcRect` + +```python +srcRect = ZeroOrOne('a:srcRect', successors=_tag_seq[2:]) +``` + +## `CT_GradientFillProperties` + +Bases: `BaseOxmlElement` + +`a:gradFill` custom element class. + +### `gsLst` + +```python +gsLst = ZeroOrOne('a:gsLst', successors=_tag_seq[1:]) +``` + +### `lin` + +```python +lin = ZeroOrOne('a:lin', successors=_tag_seq[2:]) +``` + +### `new_gradFill` + +```python +new_gradFill() +``` + +Return newly-created "loose" default gradient subtree. + +### `path` + +```python +path = ZeroOrOne('a:path', successors=_tag_seq[3:]) +``` + +## `CT_GradientStop` + +Bases: `BaseOxmlElement` + +`a:gs` custom element class. + +### `eg_colorChoice` + +```python +eg_colorChoice = ZeroOrOneChoice((Choice('a:scrgbClr'), Choice('a:srgbClr'), Choice('a:hslClr'), Choice('a:sysClr'), Choice('a:schemeClr'), Choice('a:prstClr')), successors=()) +``` + +### `pos` + +```python +pos = RequiredAttribute('pos', ST_PositiveFixedPercentage) +``` + +## `CT_GradientStopList` + +Bases: `BaseOxmlElement` + +`a:gsLst` custom element class. + +### `gs` + +```python +gs = OneOrMore('a:gs') +``` + +### `new_gsLst` + +```python +new_gsLst() +``` + +Return newly-created "loose" default stop-list subtree. + +An `a:gsLst` element must have at least two `a:gs` children. These +are the default from the PowerPoint built-in "White" template. + +## `CT_GroupFillProperties` + +Bases: `BaseOxmlElement` + +`a:grpFill` custom element class + +## `CT_LinearShadeProperties` + +Bases: `BaseOxmlElement` + +`a:lin` custom element class + +### `ang` + +```python +ang = OptionalAttribute('ang', ST_PositiveFixedAngle) +``` + +## `CT_NoFillProperties` + +Bases: `BaseOxmlElement` + +`a:noFill` custom element class + +## `CT_PatternFillProperties` + +Bases: `BaseOxmlElement` + +`a:pattFill` custom element class + +### `bgClr` + +```python +bgClr = ZeroOrOne('a:bgClr', successors=_tag_seq[2:]) +``` + +### `fgClr` + +```python +fgClr = ZeroOrOne('a:fgClr', successors=_tag_seq[1:]) +``` + +### `prst` + +```python +prst = OptionalAttribute('prst', MSO_PATTERN_TYPE) +``` + +## `CT_RelativeRect` + +Bases: `BaseOxmlElement` + +`a:srcRect` element and perhaps others. + +### `b` + +```python +b = OptionalAttribute('b', ST_Percentage, default=0.0) +``` + +### `l` + +```python +l = OptionalAttribute('l', ST_Percentage, default=0.0) +``` + +### `r` + +```python +r = OptionalAttribute('r', ST_Percentage, default=0.0) +``` + +### `t` + +```python +t = OptionalAttribute('t', ST_Percentage, default=0.0) +``` + +## `CT_SolidColorFillProperties` + +Bases: `BaseOxmlElement` + +`a:solidFill` custom element class. + +### `eg_colorChoice` + +```python +eg_colorChoice = ZeroOrOneChoice((Choice('a:scrgbClr'), Choice('a:srgbClr'), Choice('a:hslClr'), Choice('a:sysClr'), Choice('a:schemeClr'), Choice('a:prstClr')), successors=()) +``` + + + + + +# `pptx.oxml.dml.line` + +lxml custom element classes for DrawingML line-related XML elements. + +## `CT_PresetLineDashProperties` + +Bases: `BaseOxmlElement` + +`a:prstDash` custom element class + +### `val` + +```python +val = OptionalAttribute('val', MSO_LINE_DASH_STYLE) +``` + + + + + +# `pptx.oxml` + +Initializes lxml parser, particularly the custom element classes. + +## `element_class_lookup` + +```python +element_class_lookup = etree.ElementNamespaceClassLookup() +``` + +## `oxml_parser` + +```python +oxml_parser = etree.XMLParser(remove_blank_text=True, resolve_entities=False) +``` + +## `parse_from_template` + +```python +parse_from_template(template_file_name: str) +``` + +Return an element loaded from the XML in the template file identified by `template_name`. + +## `parse_xml` + +```python +parse_xml(xml: str | bytes) +``` + +Return root lxml element obtained by parsing XML character string in `xml`. + +## `register_element_cls` + +```python +register_element_cls(nsptagname: str, cls: Type[BaseOxmlElement]) +``` + +Register `cls` to be constructed when oxml parser encounters element having `nsptag_name`. + +`nsptag_name` is a string of the form `nspfx:tagroot`, e.g. `"w:document"`. + + + + + +# `pptx.oxml.ns` + +Namespace related objects. + +## `NamespacePrefixedTag` + +```python +NamespacePrefixedTag(nstag: str) +``` + +Bases: `str` + +Value object that knows the semantics of an XML tag having a namespace prefix. + +### `clark_name` + +```python +clark_name +``` + +### `from_clark_name` + +```python +from_clark_name(clark_name: str) -> NamespacePrefixedTag +``` + +### `local_part` + +```python +local_part +``` + +Return the local part of the tag as a string. E.g. 'foobar' is +returned for tag 'f:foobar'. + +### `nsmap` + +```python +nsmap +``` + +Return a dict having a single member, mapping the namespace prefix of +this tag to it's namespace name (e.g. {'f': 'http://foo/bar'}). This +is handy for passing to xpath calls and other uses. + +### `nspfx` + +```python +nspfx +``` + +Return the string namespace prefix for the tag, e.g. 'f' is returned +for tag 'f:foobar'. + +### `nsuri` + +```python +nsuri +``` + +Return the namespace URI for the tag, e.g. 'http://foo/bar' would be +returned for tag 'f:foobar' if the 'f' prefix maps to +'http://foo/bar' in _nsmap. + +## `namespaces` + +```python +namespaces(*prefixes: str) +``` + +Return a dict containing the subset namespace prefix mappings specified by *prefixes*. + +Any number of namespace prefixes can be supplied, e.g. namespaces('a', 'r', 'p'). + +## `nsdecls` + +```python +nsdecls(*prefixes: str) +``` + +## `nsmap` + +```python +nsmap = namespaces +``` + +## `nsuri` + +```python +nsuri(nspfx: str) +``` + +Return the namespace URI corresponding to `nspfx`. + +Example: + + >>> nsuri("p") + "http://schemas.openxmlformats.org/presentationml/2006/main" + +## `pfxmap` + +```python +pfxmap = {value: key for key, value in _nsmap.items()} +``` + +## `qn` + +```python +qn(namespace_prefixed_tag: str) -> str +``` + +Return a Clark-notation qualified tag name corresponding to `namespace_prefixed_tag`. + +`namespace_prefixed_tag` is a string like 'p:body'. 'qn' stands for `qualified name`. + +As an example, `qn("p:cSld")` returns: + `"{http://schemas.openxmlformats.org/drawingml/2006/main}cSld"`. + + + + + +# `pptx.oxml.presentation` + +Custom element classes for presentation-related XML elements. + +## `CT_NotesMasterIdList` + +Bases: `BaseOxmlElement` + +`p:notesMasterIdLst` element, child of `p:presentation` (paper-pptx addition). + +Holds the reference to the presentation's notes master (at most one per schema). + +### `get_or_add_notesMasterId` + +```python +get_or_add_notesMasterId: 'Callable[[], CT_NotesMasterIdListEntry]' +``` + +### `notesMasterId` + +```python +notesMasterId: 'CT_NotesMasterIdListEntry | None' = ZeroOrOne('p:notesMasterId') +``` + +## `CT_NotesMasterIdListEntry` + +Bases: `BaseOxmlElement` + +`p:notesMasterId` element - the reference to the notes master (paper-pptx addition). + +### `rId` + +```python +rId: str = RequiredAttribute('r:id', XsdString) +``` + +## `CT_Presentation` + +Bases: `BaseOxmlElement` + +`p:presentation` element, root of the Presentation part stored as `/ppt/presentation.xml`. + +### `get_or_add_notesMasterIdLst` + +```python +get_or_add_notesMasterIdLst: 'Callable[[], CT_NotesMasterIdList]' +``` + +### `get_or_add_sldIdLst` + +```python +get_or_add_sldIdLst: Callable[[], CT_SlideIdList] +``` + +### `get_or_add_sldMasterIdLst` + +```python +get_or_add_sldMasterIdLst: Callable[[], CT_SlideMasterIdList] +``` + +### `get_or_add_sldSz` + +```python +get_or_add_sldSz: Callable[[], CT_SlideSize] +``` + +### `notesMasterIdLst` + +```python +notesMasterIdLst: 'CT_NotesMasterIdList | None' = ZeroOrOne('p:notesMasterIdLst', successors=('p:handoutMasterIdLst', 'p:sldIdLst', 'p:sldSz', 'p:notesSz')) +``` + +### `sldIdLst` + +```python +sldIdLst: CT_SlideIdList | None = ZeroOrOne('p:sldIdLst', successors=('p:sldSz', 'p:notesSz')) +``` + +### `sldMasterIdLst` + +```python +sldMasterIdLst: CT_SlideMasterIdList | None = ZeroOrOne('p:sldMasterIdLst', successors=('p:notesMasterIdLst', 'p:handoutMasterIdLst', 'p:sldIdLst', 'p:sldSz', 'p:notesSz')) +``` + +### `sldSz` + +```python +sldSz: CT_SlideSize | None = ZeroOrOne('p:sldSz', successors=('p:notesSz',)) +``` + +## `CT_SlideId` + +Bases: `BaseOxmlElement` + +`p:sldId` element. + +Direct child of `p:sldIdLst` that contains an `rId` reference to a slide in the presentation. + +### `id` + +```python +id: int = RequiredAttribute('id', ST_SlideId) +``` + +### `rId` + +```python +rId: str = RequiredAttribute('r:id', XsdString) +``` + +## `CT_SlideIdList` + +Bases: `BaseOxmlElement` + +`p:sldIdLst` element. + +Direct child of that contains a list of the slide parts in the presentation. + +### `add_sldId` + +```python +add_sldId(rId: str) -> CT_SlideId +``` + +Create and return a reference to a new `p:sldId` child element. + +The new `p:sldId` element has its r:id attribute set to `rId`. + +### `sldId` + +```python +sldId = ZeroOrMore('p:sldId') +``` + +### `sldId_lst` + +```python +sldId_lst: list[CT_SlideId] +``` + +## `CT_SlideMasterIdList` + +Bases: `BaseOxmlElement` + +`p:sldMasterIdLst` element. + +Child of `p:presentation` containing references to the slide masters that belong to the +presentation. + +### `sldMasterId` + +```python +sldMasterId = ZeroOrMore('p:sldMasterId') +``` + +### `sldMasterId_lst` + +```python +sldMasterId_lst: list[CT_SlideMasterIdListEntry] +``` + +## `CT_SlideMasterIdListEntry` + +Bases: `BaseOxmlElement` + +```` element, child of ```` containing +a reference to a slide master. + +### `id` + +```python +id: int | None = OptionalAttribute('id', XsdUnsignedInt) +``` + +### `rId` + +```python +rId: str = RequiredAttribute('r:id', XsdString) +``` + +## `CT_SlideSize` + +Bases: `BaseOxmlElement` + +`p:sldSz` element. + +Direct child of that contains the width and height of slides in the +presentation. + +### `cx` + +```python +cx: Length = RequiredAttribute('cx', ST_SlideSizeCoordinate) +``` + +### `cy` + +```python +cy: Length = RequiredAttribute('cy', ST_SlideSizeCoordinate) +``` + + + + + +# `pptx.oxml.shapes.autoshape` + +lxml custom element classes for shape-related XML elements. + +## `CT_AdjPoint2D` + +Bases: `BaseOxmlElement` + +`a:pt` custom element class. + +### `x` + +```python +x: Length = RequiredAttribute('x', ST_Coordinate) +``` + +### `y` + +```python +y: Length = RequiredAttribute('y', ST_Coordinate) +``` + +## `CT_CustomGeometry2D` + +Bases: `BaseOxmlElement` + +`a:custGeom` custom element class. + +### `get_or_add_pathLst` + +```python +get_or_add_pathLst: Callable[[], CT_Path2DList] +``` + +### `pathLst` + +```python +pathLst: CT_Path2DList | None = ZeroOrOne('a:pathLst', successors=_tag_seq[6:]) +``` + +## `CT_GeomGuide` + +Bases: `BaseOxmlElement` + +`a:gd` custom element class. + +Defines a "guide", corresponding to a yellow diamond-shaped handle on an autoshape. + +### `fmla` + +```python +fmla: str = RequiredAttribute('fmla', XsdString) +``` + +### `name` + +```python +name: str = RequiredAttribute('name', XsdString) +``` + +## `CT_GeomGuideList` + +Bases: `BaseOxmlElement` + +`a:avLst` custom element class. + +### `gd` + +```python +gd = ZeroOrMore('a:gd') +``` + +### `gd_lst` + +```python +gd_lst: list[CT_GeomGuide] +``` + +## `CT_NonVisualDrawingShapeProps` + +Bases: `BaseShapeElement` + +`p:cNvSpPr` custom element class. + +### `spLocks` + +```python +spLocks = ZeroOrOne('a:spLocks') +``` + +### `txBox` + +```python +txBox: bool | None = OptionalAttribute('txBox', XsdBoolean) +``` + +## `CT_Path2D` + +Bases: `BaseOxmlElement` + +`a:path` custom element class. + +### `add_close` + +```python +add_close() -> CT_Path2DClose +``` + +Return a newly created `a:close` element. + +The new `a:close` element is appended to this `a:path` element. + +### `add_lnTo` + +```python +add_lnTo(x: Length, y: Length) -> CT_Path2DLineTo +``` + +Return a newly created `a:lnTo` subtree with end point *(x, y)*. + +The new `a:lnTo` element is appended to this `a:path` element. + +### `add_moveTo` + +```python +add_moveTo(x: Length, y: Length) +``` + +Return a newly created `a:moveTo` subtree with point `(x, y)`. + +The new `a:moveTo` element is appended to this `a:path` element. + +### `close` + +```python +close = ZeroOrMore('a:close', successors=()) +``` + +### `h` + +```python +h: Length | None = OptionalAttribute('h', ST_PositiveCoordinate) +``` + +### `lnTo` + +```python +lnTo = ZeroOrMore('a:lnTo', successors=()) +``` + +### `moveTo` + +```python +moveTo = ZeroOrMore('a:moveTo', successors=()) +``` + +### `w` + +```python +w: Length | None = OptionalAttribute('w', ST_PositiveCoordinate) +``` + +## `CT_Path2DClose` + +Bases: `BaseOxmlElement` + +`a:close` custom element class. + +## `CT_Path2DLineTo` + +Bases: `BaseOxmlElement` + +`a:lnTo` custom element class. + +### `pt` + +```python +pt = ZeroOrOne('a:pt', successors=()) +``` + +## `CT_Path2DList` + +Bases: `BaseOxmlElement` + +`a:pathLst` custom element class. + +### `add_path` + +```python +add_path(w: Length, h: Length) +``` + +Return a newly created `a:path` child element. + +### `path` + +```python +path = ZeroOrMore('a:path', successors=()) +``` + +## `CT_Path2DMoveTo` + +Bases: `BaseOxmlElement` + +`a:moveTo` custom element class. + +### `pt` + +```python +pt = ZeroOrOne('a:pt', successors=()) +``` + +## `CT_PresetGeometry2D` + +Bases: `BaseOxmlElement` + +`a:prstGeom` custom element class. + +### `avLst` + +```python +avLst: CT_GeomGuideList | None = ZeroOrOne('a:avLst') +``` + +### `gd_lst` + +```python +gd_lst: list[CT_GeomGuide] +``` + +Sequence of `a:gd` element children of `a:avLst`. Empty if none are present. + +### `prst` + +```python +prst: MSO_AUTO_SHAPE_TYPE = RequiredAttribute('prst', MSO_AUTO_SHAPE_TYPE) +``` + +### `rewrite_guides` + +```python +rewrite_guides(guides: list[tuple[str, int]]) +``` + +Replace any `a:gd` element children of `a:avLst` with ones forme from `guides`. + +## `CT_Shape` + +Bases: `BaseShapeElement` + +`p:sp` custom element class. + +### `add_path` + +```python +add_path(w: Length, h: Length) -> CT_Path2D +``` + +### `get_or_add_ln` + +```python +get_or_add_ln() +``` + +Return the `a:ln` grandchild element, newly added if not present. + +### `get_or_add_txBody` + +```python +get_or_add_txBody: Callable[[], CT_TextBody] +``` + +### `has_custom_geometry` + +```python +has_custom_geometry +``` + +True if this shape has custom geometry, i.e. is a freeform shape. + +A shape has custom geometry if it has a `p:spPr/a:custGeom` +descendant (instead of `p:spPr/a:prstGeom`). + +### `is_autoshape` + +```python +is_autoshape +``` + +True if this shape is an auto shape. + +A shape is an auto shape if it has a `a:prstGeom` element and does not have a txBox="1" +attribute on cNvSpPr. + +### `is_textbox` + +```python +is_textbox +``` + +True if this shape is a text box. + +A shape is a text box if it has a `txBox` attribute on cNvSpPr that resolves to `True`. +The default when the txBox attribute is missing is `False`. + +### `ln` + +```python +ln +``` + +`a:ln` grand-child element or `None` if not present. + +### `new_autoshape_sp` + +```python +new_autoshape_sp(id_: int, name: str, prst: str, left: int, top: int, width: int, height: int) -> CT_Shape +``` + +Return a new `p:sp` element tree configured as a base auto shape. + +### `new_freeform_sp` + +```python +new_freeform_sp(shape_id: int, name: str, x: int, y: int, cx: int, cy: int) +``` + +Return new `p:sp` element tree configured as freeform shape. + +The returned shape has a `a:custGeom` subtree but no paths in its +path list. + +### `new_placeholder_sp` + +```python +new_placeholder_sp(id_: int, name: str, ph_type: PP_PLACEHOLDER, orient: str, sz: str, idx: str) -> CT_Shape +``` + +Return a new `p:sp` element tree configured as a placeholder shape. + +### `new_textbox_sp` + +```python +new_textbox_sp(id_, name, left, top, width, height) +``` + +Return a new `p:sp` element tree configured as a base textbox shape. + +### `nvSpPr` + +```python +nvSpPr: CT_ShapeNonVisual = OneAndOnlyOne('p:nvSpPr') +``` + +### `prst` + +```python +prst +``` + +Value of `prst` attribute of `a:prstGeom` element or `None` if not present. + +### `prstGeom` + +```python +prstGeom: CT_PresetGeometry2D +``` + +Reference to `a:prstGeom` child element. + +`None` if this shape doesn't have one, for example, if it's a placeholder shape. + +### `spPr` + +```python +spPr: CT_ShapeProperties = OneAndOnlyOne('p:spPr') +``` + +### `txBody` + +```python +txBody: CT_TextBody | None = ZeroOrOne('p:txBody', successors=('p:extLst',)) +``` + +## `CT_ShapeNonVisual` + +Bases: `BaseShapeElement` + +`p:nvSpPr` custom element class. + +### `cNvPr` + +```python +cNvPr: CT_NonVisualDrawingProps = OneAndOnlyOne('p:cNvPr') +``` + +### `cNvSpPr` + +```python +cNvSpPr: CT_NonVisualDrawingShapeProps = OneAndOnlyOne('p:cNvSpPr') +``` + +### `nvPr` + +```python +nvPr: CT_ApplicationNonVisualDrawingProps = OneAndOnlyOne('p:nvPr') +``` + + + + + +# `pptx.oxml.shapes.connector` + +lxml custom element classes for XML elements related to the Connector shape. + +## `CT_Connection` + +Bases: `BaseShapeElement` + +A `a:stCxn` or `a:endCxn` element. + +Specifies a connection between an end-point of a connector and a shape connection point. + +### `id` + +```python +id = RequiredAttribute('id', ST_DrawingElementId) +``` + +### `idx` + +```python +idx = RequiredAttribute('idx', XsdUnsignedInt) +``` + +## `CT_Connector` + +Bases: `BaseShapeElement` + +A line/connector shape `p:cxnSp` element + +### `new_cxnSp` + +```python +new_cxnSp(id_: int, name: str, prst: str, x: int, y: int, cx: int, cy: int, flipH: bool, flipV: bool) -> CT_Connector +``` + +Return a new `p:cxnSp` element tree configured as a base connector. + +### `nvCxnSpPr` + +```python +nvCxnSpPr = OneAndOnlyOne('p:nvCxnSpPr') +``` + +### `spPr` + +```python +spPr: CT_ShapeProperties = OneAndOnlyOne('p:spPr') +``` + +## `CT_ConnectorNonVisual` + +Bases: `BaseOxmlElement` + +`p:nvCxnSpPr` element, container for the non-visual properties of +a connector, such as name, id, etc. + +### `cNvCxnSpPr` + +```python +cNvCxnSpPr = OneAndOnlyOne('p:cNvCxnSpPr') +``` + +### `cNvPr` + +```python +cNvPr = OneAndOnlyOne('p:cNvPr') +``` + +### `nvPr` + +```python +nvPr = OneAndOnlyOne('p:nvPr') +``` + +## `CT_NonVisualConnectorProperties` + +Bases: `BaseOxmlElement` + +`p:cNvCxnSpPr` element, container for the non-visual properties specific +to a connector shape, such as connections and connector locking. + +### `endCxn` + +```python +endCxn = ZeroOrOne('a:endCxn', successors=_tag_seq[3:]) +``` + +### `stCxn` + +```python +stCxn = ZeroOrOne('a:stCxn', successors=_tag_seq[2:]) +``` + + + + + +# `pptx.oxml.shapes.graphfrm` + +lxml custom element class for CT_GraphicalObjectFrame XML element. + +## `CT_GraphicalObject` + +Bases: `BaseOxmlElement` + +`a:graphic` element. + +The container for the reference to or definition of the framed graphical object (table, chart, +etc.). + +### `chart` + +```python +chart: CT_Chart | None +``` + +The `c:chart` grandchild element, or `None` if not present. + +### `graphicData` + +```python +graphicData: CT_GraphicalObjectData = OneAndOnlyOne('a:graphicData') +``` + +## `CT_GraphicalObjectData` + +Bases: `BaseShapeElement` + +`p:graphicData` element. + +The direct container for a table, a chart, or another graphical object. + +### `blob_rId` + +```python +blob_rId: str | None +``` + +Optional `r:id` attribute value of `p:oleObj` descendent element. + +This value is `None` when this `p:graphicData` element does not enclose an OLE object. +This value could also be `None` if an enclosed OLE object does not specify this attribute +(it is specified optional in the schema) but so far, all OLE objects we've encountered +specify this value. + +### `chart` + +```python +chart: CT_Chart | None = ZeroOrOne('c:chart') +``` + +### `is_embedded_ole_obj` + +```python +is_embedded_ole_obj: bool | None +``` + +Optional boolean indicating an embedded OLE object. + +Returns `None` when this `p:graphicData` element does not enclose an OLE object. `True` +indicates an embedded OLE object and `False` indicates a linked OLE object. + +### `progId` + +```python +progId: str | None +``` + +Optional str value of "progId" attribute of `p:oleObj` descendent. + +This value identifies the "type" of the embedded object in terms of the application used +to open it. + +This value is `None` when this `p:graphicData` element does not enclose an OLE object. +This could also be `None` if an enclosed OLE object does not specify this attribute (it is +specified optional in the schema) but so far, all OLE objects we've encountered specify +this value. + +### `showAsIcon` + +```python +showAsIcon: bool | None +``` + +Optional value of "showAsIcon" attribute value of `p:oleObj` descendent. + +This value is `None` when this `p:graphicData` element does not enclose an OLE object. It +is False when the `showAsIcon` attribute is omitted on the `p:oleObj` element. + +### `tbl` + +```python +tbl: CT_Table | None = ZeroOrOne('a:tbl') +``` + +### `uri` + +```python +uri: str = RequiredAttribute('uri', XsdString) +``` + +## `CT_GraphicalObjectFrame` + +Bases: `BaseShapeElement` + +`p:graphicFrame` element. + +A container for a table, a chart, or another graphical object. + +### `chart` + +```python +chart: CT_Chart | None +``` + +The `c:chart` great-grandchild element, or `None` if not present. + +### `chart_rId` + +```python +chart_rId: str | None +``` + +The `rId` attribute of the `c:chart` great-grandchild element. + +`None` if not present. + +### `get_or_add_xfrm` + +```python +get_or_add_xfrm() -> CT_Transform2D +``` + +Return the required `p:xfrm` child element. + +Overrides version on BaseShapeElement. + +### `graphic` + +```python +graphic: CT_GraphicalObject = OneAndOnlyOne('a:graphic') +``` + +### `graphicData` + +```python +graphicData: CT_GraphicalObjectData +``` + +`a:graphicData` grandchild of this graphic-frame element. + +### `graphicData_uri` + +```python +graphicData_uri: str +``` + +str value of `uri` attribute of `a:graphicData` grandchild. + +### `has_oleobj` + +```python +has_oleobj: bool +``` + +`True` for graphicFrame containing an OLE object, `False` otherwise. + +### `is_embedded_ole_obj` + +```python +is_embedded_ole_obj: bool | None +``` + +Optional boolean indicating an embedded OLE object. + +Returns `None` when this `p:graphicFrame` element does not enclose an OLE object. `True` +indicates an embedded OLE object and `False` indicates a linked OLE object. + +### `new_chart_graphicFrame` + +```python +new_chart_graphicFrame(id_: int, name: str, rId: str, x: int, y: int, cx: int, cy: int) -> CT_GraphicalObjectFrame +``` + +Return a `p:graphicFrame` element tree populated with a chart element. + +### `new_graphicFrame` + +```python +new_graphicFrame(id_: int, name: str, x: int, y: int, cx: int, cy: int) -> CT_GraphicalObjectFrame +``` + +Return a new `p:graphicFrame` element tree suitable for containing a table or chart. + +Note that a graphicFrame element is not a valid shape until it contains a graphical object +such as a table. + +### `new_ole_object_graphicFrame` + +```python +new_ole_object_graphicFrame(id_: int, name: str, ole_object_rId: str, progId: str, icon_rId: str, x: int, y: int, cx: int, cy: int, imgW: int, imgH: int) -> CT_GraphicalObjectFrame +``` + +Return newly-created `p:graphicFrame` for embedded OLE-object. + +`ole_object_rId` identifies the relationship to the OLE-object part. + +`progId` is a str identifying the object-type in terms of the application (program) used +to open it. This becomes an attribute of the same name in the `p:oleObj` element. + +`icon_rId` identifies the relationship to an image part used to display the OLE-object as +an icon (vs. a preview). + +### `new_table_graphicFrame` + +```python +new_table_graphicFrame(id_: int, name: str, rows: int, cols: int, x: int, y: int, cx: int, cy: int) -> CT_GraphicalObjectFrame +``` + +Return a `p:graphicFrame` element tree populated with a table element. + +### `nvGraphicFramePr` + +```python +nvGraphicFramePr: CT_GraphicalObjectFrameNonVisual = OneAndOnlyOne('p:nvGraphicFramePr') +``` + +### `xfrm` + +```python +xfrm: CT_Transform2D = OneAndOnlyOne('p:xfrm') +``` + +## `CT_GraphicalObjectFrameNonVisual` + +Bases: `BaseOxmlElement` + +`p:nvGraphicFramePr` element. + +This contains the non-visual properties of a graphic frame, such as name, id, etc. + +### `cNvPr` + +```python +cNvPr: CT_NonVisualDrawingProps = OneAndOnlyOne('p:cNvPr') +``` + +### `nvPr` + +```python +nvPr: CT_ApplicationNonVisualDrawingProps = OneAndOnlyOne('p:nvPr') +``` + +## `CT_OleObject` + +Bases: `BaseOxmlElement` + +`p:oleObj` element, container for an OLE object (e.g. Excel file). + +An OLE object can be either linked or embedded (hence the name). + +### `is_embedded` + +```python +is_embedded: bool +``` + +True when this OLE object is embedded, False when it is linked. + +### `progId` + +```python +progId: str | None = OptionalAttribute('progId', XsdString) +``` + +### `rId` + +```python +rId: str | None = OptionalAttribute('r:id', XsdString) +``` + +### `showAsIcon` + +```python +showAsIcon: bool = OptionalAttribute('showAsIcon', XsdBoolean, default=False) +``` + + + + + +# `pptx.oxml.shapes.groupshape` + +lxml custom element classes for shape-tree-related XML elements. + +## `CT_GroupShape` + +Bases: `BaseShapeElement` + +Used for shape tree (`p:spTree`) as well as the group shape (`p:grpSp`) elements. + +### `add_autoshape` + +```python +add_autoshape(id_: int, name: str, prst: str, x: int, y: int, cx: int, cy: int) -> CT_Shape +``` + +Return new `p:sp` appended to the group/shapetree with specified attributes. + +### `add_cxnSp` + +```python +add_cxnSp(id_: int, name: str, type_member: MSO_CONNECTOR_TYPE, x: int, y: int, cx: int, cy: int, flipH: bool, flipV: bool) -> CT_Connector +``` + +Return new `p:cxnSp` appended to the group/shapetree with the specified attribues. + +### `add_freeform_sp` + +```python +add_freeform_sp(x: int, y: int, cx: int, cy: int) -> CT_Shape +``` + +Append a new freeform `p:sp` with specified position and size. + +### `add_grpSp` + +```python +add_grpSp() -> CT_GroupShape +``` + +Return `p:grpSp` element newly appended to this shape tree. + +The element contains no sub-shapes, is positioned at (0, 0), and has +width and height of zero. + +### `add_pic` + +```python +add_pic(id_: int, name: str, desc: str, rId: str, x: int, y: int, cx: int, cy: int) -> CT_Picture +``` + +Append a `p:pic` shape to the group/shapetree having properties as specified in call. + +### `add_placeholder` + +```python +add_placeholder(id_: int, name: str, ph_type: PP_PLACEHOLDER, orient: str, sz: str, idx: int) -> CT_Shape +``` + +Append a newly-created placeholder `p:sp` shape having the specified properties. + +### `add_table` + +```python +add_table(id_: int, name: str, rows: int, cols: int, x: int, y: int, cx: int, cy: int) -> CT_GraphicalObjectFrame +``` + +Append a `p:graphicFrame` shape containing a table as specified in call. + +### `add_textbox` + +```python +add_textbox(id_: int, name: str, x: int, y: int, cx: int, cy: int) -> CT_Shape +``` + +Append a newly-created textbox `p:sp` shape having the specified position and size. + +### `chExt` + +```python +chExt +``` + +Descendent `p:grpSpPr/a:xfrm/a:chExt` element. + +### `chOff` + +```python +chOff +``` + +Descendent `p:grpSpPr/a:xfrm/a:chOff` element. + +### `get_or_add_xfrm` + +```python +get_or_add_xfrm() -> CT_Transform2D +``` + +Return the `a:xfrm` grandchild element, newly-added if not present. + +### `grpSpPr` + +```python +grpSpPr: CT_GroupShapeProperties = OneAndOnlyOne('p:grpSpPr') +``` + +### `iter_ph_elms` + +```python +iter_ph_elms() +``` + +Generate each placeholder shape child element in document order. + +### `iter_shape_elms` + +```python +iter_shape_elms() -> Iterator[ShapeElement] +``` + +Generate each child of this `p:spTree` element that corresponds to a shape. + +Items appear in XML document order. + +### `max_shape_id` + +```python +max_shape_id: int +``` + +Maximum int value assigned as @id in this slide. + +This is generally a shape-id, but ids can be assigned to other +objects so we just check all @id values anywhere in the document +(XML id-values have document scope). + +In practice, its minimum value is 1 because the spTree element itself +is always assigned id="1". + +### `new_grpSp` + +```python +new_grpSp(id_: int, name: str) -> CT_GroupShape +``` + +Return new "loose" `p:grpSp` element having `id_` and `name`. + +### `nvGrpSpPr` + +```python +nvGrpSpPr: CT_GroupShapeNonVisual = OneAndOnlyOne('p:nvGrpSpPr') +``` + +### `recalculate_extents` + +```python +recalculate_extents() -> None +``` + +Adjust x, y, cx, and cy to incorporate all contained shapes. + +This would typically be called when a contained shape is added, +removed, or its position or size updated. + +This method is recursive "upwards" since a change in a group shape +can change the position and size of its containing group. + +### `xfrm` + +```python +xfrm: CT_Transform2D | None +``` + +The `a:xfrm` grandchild element or `None` if not found. + +## `CT_GroupShapeNonVisual` + +Bases: `BaseShapeElement` + +`p:nvGrpSpPr` element. + +### `cNvPr` + +```python +cNvPr = OneAndOnlyOne('p:cNvPr') +``` + +## `CT_GroupShapeProperties` + +Bases: `BaseOxmlElement` + +p:grpSpPr element + +### `effectLst` + +```python +effectLst = ZeroOrOne('a:effectLst', successors=_tag_seq[8:]) +``` + +### `get_or_add_xfrm` + +```python +get_or_add_xfrm: Callable[[], CT_Transform2D] +``` + +### `xfrm` + +```python +xfrm: CT_Transform2D | None = ZeroOrOne('a:xfrm', successors=_tag_seq[1:]) +``` + + + + + +# `pptx.oxml.shapes` + +Base shape-related objects such as BaseShape. + +## `ShapeElement` + +```python +ShapeElement: TypeAlias = 'CT_Connector | CT_GraphicalObjectFrame | CT_GroupShape | CT_Picture | CT_Shape' +``` + + + + + +# `pptx.oxml.shapes.picture` + +lxml custom element classes for picture-related XML elements. + +## `CT_Picture` + +Bases: `BaseShapeElement` + +`p:pic` element. + +Represents a picture shape (an image placement on a slide). + +### `blipFill` + +```python +blipFill = OneAndOnlyOne('p:blipFill') +``` + +### `blip_rId` + +```python +blip_rId: str | None +``` + +Value of `p:blipFill/a:blip/@r:embed`. + +Returns `None` if not present. + +### `crop_to_fit` + +```python +crop_to_fit(image_size, view_size) +``` + +Set cropping values in `p:blipFill/a:srcRect` such that an image of +*image_size* will stretch to exactly fit *view_size* when its aspect +ratio is preserved. + +### `get_or_add_ln` + +```python +get_or_add_ln() +``` + +Return the grandchild element, newly added if not present. + +### `ln` + +```python +ln +``` + +```` grand-child element or `None` if not present + +### `new_ph_pic` + +```python +new_ph_pic(id_, name, desc, rId) +``` + +Return a new `p:pic` placeholder element populated with the supplied +parameters. + +### `new_pic` + +```python +new_pic(shape_id, name, desc, rId, x, y, cx, cy) +``` + +Return new `` element tree configured with supplied parameters. + +### `new_video_pic` + +```python +new_video_pic(shape_id: int, shape_name: str, video_rId: str, media_rId: str, poster_frame_rId: str, x: Length, y: Length, cx: Length, cy: Length) -> CT_Picture +``` + +Return a new `p:pic` populated with the specified video. + +### `nvPicPr` + +```python +nvPicPr = OneAndOnlyOne('p:nvPicPr') +``` + +### `spPr` + +```python +spPr: CT_ShapeProperties = OneAndOnlyOne('p:spPr') +``` + +### `srcRect_b` + +```python +srcRect_b +``` + +Value of `p:blipFill/a:srcRect/@b` or 0.0 if not present. + +### `srcRect_l` + +```python +srcRect_l +``` + +Value of `p:blipFill/a:srcRect/@l` or 0.0 if not present. + +### `srcRect_r` + +```python +srcRect_r +``` + +Value of `p:blipFill/a:srcRect/@r` or 0.0 if not present. + +### `srcRect_t` + +```python +srcRect_t +``` + +Value of `p:blipFill/a:srcRect/@t` or 0.0 if not present. + +## `CT_PictureNonVisual` + +Bases: `BaseOxmlElement` + +```` element, containing non-visual properties for a picture +shape. + +### `cNvPr` + +```python +cNvPr = OneAndOnlyOne('p:cNvPr') +``` + +### `nvPr` + +```python +nvPr = OneAndOnlyOne('p:nvPr') +``` + + + + + +# `pptx.oxml.shapes.shared` + +Common shape-related oxml objects. + +## `BaseShapeElement` + +Bases: `BaseOxmlElement` + +Provides common behavior for shape element classes like CT_Shape, CT_Picture, etc. + +### `cx` + +```python +cx: Length +``` + +### `cy` + +```python +cy: Length +``` + +### `flipH` + +```python +flipH +``` + +### `flipV` + +```python +flipV +``` + +### `get_or_add_xfrm` + +```python +get_or_add_xfrm() +``` + +Return the `a:xfrm` grandchild element, newly-added if not present. + +This version works for `p:sp`, `p:cxnSp`, and `p:pic` elements, others will need to +override. + +### `has_ph_elm` + +```python +has_ph_elm +``` + +True if this shape element has a `p:ph` descendant, indicating it +is a placeholder shape. False otherwise. + +### `ph` + +```python +ph: CT_Placeholder | None +``` + +The `p:ph` descendant element if there is one, None otherwise. + +### `ph_idx` + +```python +ph_idx: int +``` + +Integer value of placeholder idx attribute. + +Raises `ValueError` if shape is not a placeholder. + +### `ph_orient` + +```python +ph_orient: str +``` + +Placeholder orientation, e.g. 'vert'. + +Raises `ValueError` if shape is not a placeholder. + +### `ph_sz` + +```python +ph_sz: str +``` + +Placeholder size, e.g. ST_PlaceholderSize.HALF. + +Raises `ValueError` if shape is not a placeholder. + +### `ph_type` + +```python +ph_type +``` + +Placeholder type, e.g. ST_PlaceholderType.TITLE ('title'). + +Raises `ValueError` if shape is not a placeholder. + +### `rot` + +```python +rot: float +``` + +Float representing degrees this shape is rotated clockwise. + +### `shape_id` + +```python +shape_id +``` + +Integer id of this shape + +### `shape_name` + +```python +shape_name +``` + +Name of this shape + +### `spPr` + +```python +spPr: CT_ShapeProperties +``` + +### `txBody` + +```python +txBody +``` + +Child `p:txBody` element, None if not present. + +### `x` + +```python +x: Length +``` + +### `xfrm` + +```python +xfrm +``` + +The `a:xfrm` grandchild element or `None` if not found. + +This version works for `p:sp`, `p:cxnSp`, and `p:pic` elements, others will need to +override. + +### `y` + +```python +y: Length +``` + +## `CT_ApplicationNonVisualDrawingProps` + +Bases: `BaseOxmlElement` + +`p:nvPr` element. + +### `get_or_add_ph` + +```python +get_or_add_ph: Callable[[], CT_Placeholder] +``` + +### `ph` + +```python +ph = ZeroOrOne('p:ph', successors=('a:audioCd', 'a:wavAudioFile', 'a:audioFile', 'a:videoFile', 'a:quickTimeFile', 'p:custDataLst', 'p:extLst')) +``` + +## `CT_LineProperties` + +Bases: `BaseOxmlElement` + +Custom element class for element + +### `custDash` + +```python +custDash = ZeroOrOne('a:custDash', successors=_tag_seq[6:]) +``` + +### `eg_fillProperties` + +```python +eg_fillProperties +``` + +Required to fulfill the interface used by dml.fill. + +### `eg_lineFillProperties` + +```python +eg_lineFillProperties = ZeroOrOneChoice((Choice('a:noFill'), Choice('a:solidFill'), Choice('a:gradFill'), Choice('a:pattFill')), successors=_tag_seq[4:]) +``` + +### `prstDash` + +```python +prstDash = ZeroOrOne('a:prstDash', successors=_tag_seq[5:]) +``` + +### `prstDash_val` + +```python +prstDash_val +``` + +Return value of `val` attribute of `a:prstDash` child. + +Return `None` if not present. + +### `w` + +```python +w = OptionalAttribute('w', ST_LineWidth, default=Emu(0)) +``` + +## `CT_NonVisualDrawingProps` + +Bases: `BaseOxmlElement` + +`p:cNvPr` custom element class. + +### `get_or_add_hlinkClick` + +```python +get_or_add_hlinkClick: Callable[[], CT_Hyperlink] +``` + +### `get_or_add_hlinkHover` + +```python +get_or_add_hlinkHover: Callable[[], CT_Hyperlink] +``` + +### `hlinkClick` + +```python +hlinkClick: CT_Hyperlink | None = ZeroOrOne('a:hlinkClick', successors=_tag_seq[1:]) +``` + +### `hlinkHover` + +```python +hlinkHover: CT_Hyperlink | None = ZeroOrOne('a:hlinkHover', successors=_tag_seq[2:]) +``` + +### `id` + +```python +id = RequiredAttribute('id', ST_DrawingElementId) +``` + +### `name` + +```python +name = RequiredAttribute('name', XsdString) +``` + +## `CT_Placeholder` + +Bases: `BaseOxmlElement` + +`p:ph` custom element class. + +### `idx` + +```python +idx: int = OptionalAttribute('idx', XsdUnsignedInt, default=0) +``` + +### `orient` + +```python +orient: str = OptionalAttribute('orient', ST_Direction, default=ST_Direction.HORZ) +``` + +### `sz` + +```python +sz: str = OptionalAttribute('sz', ST_PlaceholderSize, default=ST_PlaceholderSize.FULL) +``` + +### `type` + +```python +type: PP_PLACEHOLDER = OptionalAttribute('type', PP_PLACEHOLDER, default=PP_PLACEHOLDER.OBJECT) +``` + +## `CT_Point2D` + +Bases: `BaseOxmlElement` + +Custom element class for element. + +### `x` + +```python +x: Length = RequiredAttribute('x', ST_Coordinate) +``` + +### `y` + +```python +y: Length = RequiredAttribute('y', ST_Coordinate) +``` + +## `CT_PositiveSize2D` + +Bases: `BaseOxmlElement` + +Custom element class for element. + +### `cx` + +```python +cx = RequiredAttribute('cx', ST_PositiveCoordinate) +``` + +### `cy` + +```python +cy = RequiredAttribute('cy', ST_PositiveCoordinate) +``` + +## `CT_ShapeProperties` + +Bases: `BaseOxmlElement` + +Custom element class for `p:spPr` element. + +Shared by `p:sp`, `p:cxnSp`, and `p:pic` elements as well as a few more obscure ones. + +### `custGeom` + +```python +custGeom: CT_CustomGeometry2D | None = ZeroOrOne('a:custGeom', successors=_tag_seq[2:]) +``` + +### `cx` + +```python +cx +``` + +Shape width as an instance of Emu, or None if not present. + +### `cy` + +```python +cy +``` + +Shape height as an instance of Emu, or None if not present. + +### `effectLst` + +```python +effectLst = ZeroOrOne('a:effectLst', successors=_tag_seq[11:]) +``` + +### `eg_fillProperties` + +```python +eg_fillProperties = ZeroOrOneChoice((Choice('a:noFill'), Choice('a:solidFill'), Choice('a:gradFill'), Choice('a:blipFill'), Choice('a:pattFill'), Choice('a:grpFill')), successors=_tag_seq[9:]) +``` + +### `get_or_add_ln` + +```python +get_or_add_ln: Callable[[], CT_LineProperties] +``` + +### `get_or_add_xfrm` + +```python +get_or_add_xfrm: Callable[[], CT_Transform2D] +``` + +### `ln` + +```python +ln: CT_LineProperties | None = ZeroOrOne('a:ln', successors=_tag_seq[10:]) +``` + +### `prstGeom` + +```python +prstGeom: CT_PresetGeometry2D | None = ZeroOrOne('a:prstGeom', successors=_tag_seq[3:]) +``` + +### `x` + +```python +x: Length | None +``` + +Distance between the left edge of the slide and left edge of the shape. + +0 if not present. + +### `xfrm` + +```python +xfrm: CT_Transform2D | None = ZeroOrOne('a:xfrm', successors=_tag_seq[1:]) +``` + +### `y` + +```python +y +``` + +The offset of the top of the shape from the top of the slide, as an +instance of Emu. None if not present. + +## `CT_Transform2D` + +Bases: `BaseOxmlElement` + +`a:xfrm` custom element class. + +NOTE: this is a composite including CT_GroupTransform2D, which appears +with the `a:xfrm` tag in a group shape (including a slide `p:spTree`). + +### `chExt` + +```python +chExt = ZeroOrOne('a:chExt', successors=_tag_seq[4:]) +``` + +### `chOff` + +```python +chOff = ZeroOrOne('a:chOff', successors=_tag_seq[3:]) +``` + +### `cx` + +```python +cx +``` + +### `cy` + +```python +cy +``` + +### `ext` + +```python +ext = ZeroOrOne('a:ext', successors=_tag_seq[2:]) +``` + +### `flipH` + +```python +flipH = OptionalAttribute('flipH', XsdBoolean, default=False) +``` + +### `flipV` + +```python +flipV = OptionalAttribute('flipV', XsdBoolean, default=False) +``` + +### `off` + +```python +off: CT_Point2D | None = ZeroOrOne('a:off', successors=_tag_seq[1:]) +``` + +### `rot` + +```python +rot: float | None = OptionalAttribute('rot', ST_Angle, default=0.0) +``` + +### `x` + +```python +x +``` + +### `y` + +```python +y +``` + + + + + +# `pptx.oxml.simpletypes` + +Simple-type classes. + +## `BaseFloatType` + +Bases: `BaseSimpleType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +### `validate` + +```python +validate(value) +``` + +## `BaseIntType` + +Bases: `BaseSimpleType` + +### `convert_from_percent_literal` + +```python +convert_from_percent_literal(str_value) +``` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +### `validate` + +```python +validate(value) +``` + +## `BaseSimpleType` + +### `from_xml` + +```python +from_xml(xml_value: str) -> Any +``` + +### `to_xml` + +```python +to_xml(value: Any) -> str +``` + +### `validate_float` + +```python +validate_float(value: Any) +``` + +Note that int values are accepted. + +### `validate_float_in_range` + +```python +validate_float_in_range(value, min_inclusive, max_inclusive) +``` + +### `validate_int` + +```python +validate_int(value) +``` + +### `validate_int_in_range` + +```python +validate_int_in_range(value, min_inclusive, max_inclusive) +``` + +### `validate_string` + +```python +validate_string(value) +``` + +## `BaseStringEnumerationType` + +Bases: `BaseStringType` + +### `validate` + +```python +validate(value) +``` + +## `BaseStringType` + +Bases: `BaseSimpleType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_Angle` + +Bases: `XsdInt` + +Valid values for `rot` attribute on `` element. 60000ths of +a degree rotation. + +### `DEGREE_INCREMENTS` + +```python +DEGREE_INCREMENTS = 60000 +``` + +### `THREE_SIXTY` + +```python +THREE_SIXTY = 360 * DEGREE_INCREMENTS +``` + +### `convert_from_xml` + +```python +convert_from_xml(str_value: str) -> float +``` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +Convert signed angle float like -42.42 to int 60000 per degree, +normalized to positive value. + +### `validate` + +```python +validate(value) +``` + +## `ST_AxisUnit` + +Bases: `XsdDouble` + +Valid values for val attribute on c:majorUnit and others. + +### `validate` + +```python +validate(value) +``` + +## `ST_BarDir` + +Bases: `XsdStringEnumeration` + +Valid values for attribute + +### `BAR` + +```python +BAR = 'bar' +``` + +### `COL` + +```python +COL = 'col' +``` + +## `ST_BubbleScale` + +Bases: `BaseIntType` + +String value is an integer in range 0-300, representing a percent, +optionally including a '%' suffix. + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_ContentType` + +Bases: `XsdString` + +Has a pretty wicked regular expression it needs to match in the schema, +but figuring it's not worth the trouble or run time to identify +a programming error (as opposed to a user/runtime error). + +## `ST_Coordinate` + +Bases: `BaseSimpleType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_Coordinate32` + +Bases: `BaseSimpleType` + +xsd:union of ST_Coordinate32Unqualified, ST_UniversalMeasure + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_Coordinate32Unqualified` + +Bases: `XsdInt` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +## `ST_CoordinateUnqualified` + +Bases: `XsdLong` + +### `validate` + +```python +validate(value) +``` + +## `ST_Direction` + +Bases: `XsdTokenEnumeration` + +Valid values for `` attribute. + +### `HORZ` + +```python +HORZ = 'horz' +``` + +### `VERT` + +```python +VERT = 'vert' +``` + +## `ST_DrawingElementId` + +Bases: `XsdUnsignedInt` + +## `ST_Extension` + +Bases: `XsdString` + +Has a regular expression it needs to match in the schema, but figuring +it's not worth the trouble or run time to identify a programming error +(as opposed to a user/runtime error). + +## `ST_GapAmount` + +Bases: `BaseIntType` + +String value is an integer in range 0-500, representing a percent, +optionally including a '%' suffix. + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_Grouping` + +Bases: `XsdStringEnumeration` + +Valid values for attribute. Overloaded for use as +ST_BarGrouping using same tag name. + +### `CLUSTERED` + +```python +CLUSTERED = 'clustered' +``` + +### `PERCENT_STACKED` + +```python +PERCENT_STACKED = 'percentStacked' +``` + +### `STACKED` + +```python +STACKED = 'stacked' +``` + +### `STANDARD` + +```python +STANDARD = 'standard' +``` + +## `ST_HexColorRGB` + +Bases: `BaseStringType` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +Keep alpha characters all uppercase just for consistency. + +### `validate` + +```python +validate(value) +``` + +## `ST_LayoutMode` + +Bases: `XsdStringEnumeration` + +Valid values for `val` attribute on c:xMode and other elements of type +CT_LayoutMode. + +### `EDGE` + +```python +EDGE = 'edge' +``` + +### `FACTOR` + +```python +FACTOR = 'factor' +``` + +## `ST_LblOffset` + +Bases: `XsdUnsignedShort` + +Unsigned integer value between 0 and 1000 inclusive, with optional +percent character ('%') suffix. + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_LineWidth` + +Bases: `XsdInt` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_MarkerSize` + +Bases: `XsdUnsignedByte` + +### `validate` + +```python +validate(value) +``` + +## `ST_Orientation` + +Bases: `XsdStringEnumeration` + +Valid values for `val` attribute on c:orientation (CT_Orientation). + +### `MAX_MIN` + +```python +MAX_MIN = 'maxMin' +``` + +### `MIN_MAX` + +```python +MIN_MAX = 'minMax' +``` + +## `ST_Overlap` + +Bases: `BaseIntType` + +String value is an integer in range -100..100, representing a percent, +optionally including a '%' suffix. + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_Percentage` + +Bases: `BaseIntType` + +Percentage value like 42000 or '42.0%' + +Either an integer literal representing 1000ths of a percent +(e.g. "42000"), or a floating point literal with a '%' suffix +(e.g. "42.0%). + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_PlaceholderSize` + +Bases: `XsdTokenEnumeration` + +Valid values for sz (size) attribute + +### `FULL` + +```python +FULL = 'full' +``` + +### `HALF` + +```python +HALF = 'half' +``` + +### `QUARTER` + +```python +QUARTER = 'quarter' +``` + +## `ST_PositiveCoordinate` + +Bases: `XsdLong` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_PositiveFixedAngle` + +Bases: `ST_Angle` + +Valid values for `a:lin@ang`. + +60000ths of a degree rotation, constained to positive angles less than +360 degrees. + +### `convert_to_xml` + +```python +convert_to_xml(degrees) +``` + +Convert signed angle float like -427.42 to int 60000 per degree. + +Value is normalized to a positive value less than 360 degrees. + +## `ST_PositiveFixedPercentage` + +Bases: `ST_Percentage` + +Percentage value between 0 and 100% like 42000 or '42.0%' + +Either an integer literal representing 1000ths of a percent +(e.g. "42000"), or a floating point literal with a '%' suffix +(e.g. "42.0%). Value is constrained to range of 0% to 100%. The source +value is a float between 0.0 and 1.0. + +### `validate` + +```python +validate(value) +``` + +## `ST_RelationshipId` + +Bases: `XsdString` + +## `ST_SlideId` + +Bases: `XsdUnsignedInt` + +### `validate` + +```python +validate(value) +``` + +## `ST_SlideSizeCoordinate` + +Bases: `BaseIntType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_Style` + +Bases: `XsdUnsignedByte` + +### `validate` + +```python +validate(value) +``` + +## `ST_TargetMode` + +Bases: `XsdString` + +The valid values for the ``TargetMode`` attribute in a Relationship +element, either 'External' or 'Internal'. + +### `validate` + +```python +validate(value) +``` + +## `ST_TextAutonumberScheme` + +Bases: `XsdTokenEnumeration` + +Valid values for `a:buAutoNum/@type` (ECMA-376 ST_TextAutonumberScheme). + +## `ST_TextBulletSizePercent` + +Bases: `BaseFloatType` + +Valid values for `a:buSzPct/@val`, as a fraction of the text size (e.g. 0.75 for 75%). + +Reads both wire forms found in real files: thousandths-of-a-percent integers ("75000", +ECMA-376:2006 form) and percent strings ("75%"). Writes the percent-string form, which +both current schema editions bless — their pattern admits WHOLE percents only (25%–400%), +so fractional percents like 0.755 are rejected at validation. + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +Read a bullet size as a fraction, accepting the percent-string and thousandths-of-a- +percent forms. + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +Write a bullet size fraction as a percent string. + +### `validate` + +```python +validate(value) +``` + +Refuse a bullet size outside 0.25..4.0, or one finer than a whole percent. + +## `ST_TextBulletStartAtNum` + +Bases: `BaseIntType` + +Valid values for `a:buAutoNum/@startAt`. + +### `validate` + +```python +validate(value) +``` + +Refuse a list start number outside the 1..32767 the schema allows. + +## `ST_TextFontScalePercentOrPercentString` + +Bases: `BaseFloatType` + +Valid values for the `fontScale` attribute of ````. +Translates to a float value. + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_TextFontSize` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value) +``` + +## `ST_TextIndent` + +Bases: `ST_Coordinate32Unqualified` + +Valid values for `a:pPr/@indent`, an EMU `Length` (negative = hanging indent). + +### `validate` + +```python +validate(value) +``` + +Refuse an indent outside -51206400..51206400 EMU (plus or minus 56 inches), or a non- +integer. + +## `ST_TextIndentLevelType` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value) +``` + +## `ST_TextLineSpaceReductionPercentOrPercentString` + +Bases: `BaseFloatType` + +Valid values for `a:normAutofit/@lnSpcReduction`, as a percent float (20.0 = 20%). + +Reads both wire forms ("20000" thousandths and "20%"), mirroring the `fontScale` +attribute's simpletype, and writes the thousandths form PowerPoint writes. + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +Read a line-space reduction as a percent, accepting the percent-string and thousandths +forms. + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +Write a line-space reduction percent in thousandths. + +### `validate` + +```python +validate(value) +``` + +Refuse a line-space reduction outside 0.0..100.0 percent. + +## `ST_TextMargin` + +Bases: `ST_Coordinate32Unqualified` + +Valid values for `a:pPr/@marL` and `@marR`, an EMU `Length`. + +### `validate` + +```python +validate(value) +``` + +Refuse a margin outside 0..51206400 EMU (0 to 56 inches), or a non-integer. + +Negatives are refused here, unlike `indent`. + +## `ST_TextSpacingPercentOrPercentString` + +Bases: `BaseFloatType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +1.75 -> '175000' + +### `validate` + +```python +validate(value) +``` + +## `ST_TextSpacingPoint` + +Bases: `BaseIntType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +Reads string integer centipoints, returns `Length` value. + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +### `validate` + +```python +validate(value) +``` + +## `ST_TextTypeface` + +Bases: `XsdString` + +## `ST_TextWrappingType` + +Bases: `XsdTokenEnumeration` + +Valid values for attribute + +### `NONE` + +```python +NONE = 'none' +``` + +### `SQUARE` + +```python +SQUARE = 'square' +``` + +## `ST_UniversalMeasure` + +Bases: `BaseSimpleType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +## `XsdAnyUri` + +Bases: `BaseStringType` + +There's a regular expression this is supposed to meet but so far thinking +spending cycles on validating wouldn't be worth it for the number of +programming errors it would catch. + +## `XsdBoolean` + +Bases: `BaseSimpleType` + +### `convert_from_xml` + +```python +convert_from_xml(str_value) +``` + +### `convert_to_xml` + +```python +convert_to_xml(value) +``` + +### `validate` + +```python +validate(value) +``` + +## `XsdDouble` + +Bases: `BaseFloatType` + +## `XsdId` + +Bases: `BaseStringType` + +String that must begin with a letter or underscore and cannot contain any +colons. Not fully validated because not used in external API. + +## `XsdInt` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value) +``` + +## `XsdLong` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value) +``` + +## `XsdString` + +Bases: `BaseStringType` + +## `XsdStringEnumeration` + +Bases: `BaseStringEnumerationType` + +Set of enumerated xsd:string values. + +## `XsdToken` + +Bases: `BaseStringType` + +xsd:string with whitespace collapsing, e.g. multiple spaces reduced to +one, leading and trailing space stripped. + +## `XsdTokenEnumeration` + +Bases: `BaseStringEnumerationType` + +xsd:string with whitespace collapsing, e.g. multiple spaces reduced to +one, leading and trailing space stripped. + +## `XsdUnsignedByte` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value) +``` + +## `XsdUnsignedInt` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value) +``` + +## `XsdUnsignedShort` + +Bases: `BaseIntType` + +### `validate` + +```python +validate(value) +``` + + + + + +# `pptx.oxml.slide` + +Slide-related custom element classes, including those for masters. + +## `CT_Background` + +Bases: `BaseOxmlElement` + +`p:bg` element. + +### `add_noFill_bgPr` + +```python +add_noFill_bgPr() +``` + +Return a new `p:bgPr` element with noFill properties. + +### `bgPr` + +```python +bgPr: CT_BackgroundProperties | None = ZeroOrOne('p:bgPr', successors=()) +``` + +### `bgRef` + +```python +bgRef = ZeroOrOne('p:bgRef', successors=()) +``` + +## `CT_BackgroundProperties` + +Bases: `BaseOxmlElement` + +`p:bgPr` element. + +### `eg_fillProperties` + +```python +eg_fillProperties = ZeroOrOneChoice((Choice('a:noFill'), Choice('a:solidFill'), Choice('a:gradFill'), Choice('a:blipFill'), Choice('a:pattFill'), Choice('a:grpFill')), successors=_tag_seq[6:]) +``` + +## `CT_CommonSlideData` + +Bases: `BaseOxmlElement` + +`p:cSld` element. + +### `bg` + +```python +bg: CT_Background | None = ZeroOrOne('p:bg', successors=_tag_seq[1:]) +``` + +### `get_or_add_bg` + +```python +get_or_add_bg: Callable[[], CT_Background] +``` + +### `get_or_add_bgPr` + +```python +get_or_add_bgPr() -> CT_BackgroundProperties +``` + +Return `p:bg/p:bgPr` grandchild. + +If no such grandchild is present, any existing `p:bg` child is first removed and a new +default `p:bg` with noFill settings is added. + +### `name` + +```python +name: str = OptionalAttribute('name', XsdString, default='') +``` + +### `spTree` + +```python +spTree: CT_GroupShape = OneAndOnlyOne('p:spTree') +``` + +## `CT_HeaderFooter` + +Bases: `BaseOxmlElement` + +`p:hf` element, header/footer placeholder visibility flags (paper-pptx addition). + +All four attributes are optional booleans whose schema default is true (visible). + +### `dt` + +```python +dt: bool | None = OptionalAttribute('dt', XsdBoolean) +``` + +### `ftr` + +```python +ftr: bool | None = OptionalAttribute('ftr', XsdBoolean) +``` + +### `hdr` + +```python +hdr: bool | None = OptionalAttribute('hdr', XsdBoolean) +``` + +### `sldNum` + +```python +sldNum: bool | None = OptionalAttribute('sldNum', XsdBoolean) +``` + +## `CT_NotesMaster` + +Bases: `_BaseSlideElement` + +`p:notesMaster` element, root of a notes master part. + +### `cSld` + +```python +cSld: CT_CommonSlideData = OneAndOnlyOne('p:cSld') +``` + +### `new_default` + +```python +new_default() -> CT_NotesMaster +``` + +Return a new `p:notesMaster` element based on the built-in default template. + +## `CT_NotesSlide` + +Bases: `_BaseSlideElement` + +`p:notes` element, root of a notes slide part. + +### `cSld` + +```python +cSld: CT_CommonSlideData = OneAndOnlyOne('p:cSld') +``` + +### `new` + +```python +new() -> CT_NotesSlide +``` + +Return a new ```` element based on the default template. + +Note that the template does not include placeholders, which must be subsequently cloned +from the notes master. + +## `CT_Slide` + +Bases: `_BaseSlideElement` + +`p:sld` element, root element of a slide part (XML document). + +### `bg` + +```python +bg +``` + +Return `p:bg` grandchild or None if not present. + +### `cSld` + +```python +cSld: CT_CommonSlideData = OneAndOnlyOne('p:cSld') +``` + +### `clrMapOvr` + +```python +clrMapOvr = ZeroOrOne('p:clrMapOvr', successors=_tag_seq[2:]) +``` + +### `get_or_add_childTnLst` + +```python +get_or_add_childTnLst() +``` + +Return parent element for a new `p:video` child element. + +The `p:video` element causes play controls to appear under a video +shape (pic shape containing video). There can be more than one video +shape on a slide, which causes the precondition to vary. It needs to +handle the case when there is no `p:sld/p:timing` element and when +that element already exists. If the case isn't simple, it just nukes +what's there and adds a fresh one. This could theoretically remove +desired existing timing information, but there isn't any evidence +available to me one way or the other, so I've taken the simple +approach. + +### `new` + +```python +new() -> CT_Slide +``` + +Return new `p:sld` element configured as base slide shape. + +### `timing` + +```python +timing = ZeroOrOne('p:timing', successors=_tag_seq[4:]) +``` + +## `CT_SlideLayout` + +Bases: `_BaseSlideElement` + +`p:sldLayout` element, root of a slide layout part. + +### `cSld` + +```python +cSld: CT_CommonSlideData = OneAndOnlyOne('p:cSld') +``` + +### `get_or_add_hf` + +```python +get_or_add_hf: Callable[[], CT_HeaderFooter] +``` + +### `hf` + +```python +hf: CT_HeaderFooter | None = ZeroOrOne('p:hf', successors=_tag_seq[5:]) +``` + +## `CT_SlideLayoutIdList` + +Bases: `BaseOxmlElement` + +`p:sldLayoutIdLst` element, child of `p:sldMaster`. + +Contains references to the slide layouts that inherit from the slide master. + +### `sldLayoutId` + +```python +sldLayoutId = ZeroOrMore('p:sldLayoutId') +``` + +### `sldLayoutId_lst` + +```python +sldLayoutId_lst: list[CT_SlideLayoutIdListEntry] +``` + +## `CT_SlideLayoutIdListEntry` + +Bases: `BaseOxmlElement` + +`p:sldLayoutId` element, child of `p:sldLayoutIdLst`. + +Contains a reference to a slide layout. + +### `id` + +```python +id: int | None = OptionalAttribute('id', XsdUnsignedInt) +``` + +### `rId` + +```python +rId: str = RequiredAttribute('r:id', XsdString) +``` + +## `CT_SlideMaster` + +Bases: `_BaseSlideElement` + +`p:sldMaster` element, root of a slide master part. + +### `cSld` + +```python +cSld: CT_CommonSlideData = OneAndOnlyOne('p:cSld') +``` + +### `get_or_add_hf` + +```python +get_or_add_hf: Callable[[], CT_HeaderFooter] +``` + +### `get_or_add_sldLayoutIdLst` + +```python +get_or_add_sldLayoutIdLst: Callable[[], CT_SlideLayoutIdList] +``` + +### `hf` + +```python +hf: CT_HeaderFooter | None = ZeroOrOne('p:hf', successors=_tag_seq[6:]) +``` + +### `sldLayoutIdLst` + +```python +sldLayoutIdLst: CT_SlideLayoutIdList = ZeroOrOne('p:sldLayoutIdLst', successors=_tag_seq[3:]) +``` + +### `txStyles` + +```python +txStyles: CT_SlideMasterTextStyles | None = ZeroOrOne('p:txStyles', successors=_tag_seq[7:]) +``` + +## `CT_SlideMasterTextStyles` + +Bases: `BaseOxmlElement` + +`p:txStyles` element, holding the master's title/body/other text list-styles. + +Read-only access for the effective-style inheritance walk; each child is a +`CT_TextListStyle`. + +### `bodyStyle` + +```python +bodyStyle +``` + +`p:bodyStyle` child (a `CT_TextListStyle`), or `None` if not present. + +### `otherStyle` + +```python +otherStyle +``` + +`p:otherStyle` child (a `CT_TextListStyle`), or `None` if not present. + +### `titleStyle` + +```python +titleStyle +``` + +`p:titleStyle` child (a `CT_TextListStyle`), or `None` if not present. + +## `CT_SlideTiming` + +Bases: `BaseOxmlElement` + +`p:timing` element, specifying animations and timed behaviors. + +### `tnLst` + +```python +tnLst = ZeroOrOne('p:tnLst', successors=_tag_seq[1:]) +``` + +## `CT_TLMediaNodeVideo` + +Bases: `BaseOxmlElement` + +`p:video` element, specifying video media details. + +### `cMediaNode` + +```python +cMediaNode = OneAndOnlyOne('p:cMediaNode') +``` + +## `CT_TimeNodeList` + +Bases: `BaseOxmlElement` + +`p:tnLst` or `p:childTnList` element. + +### `add_video` + +```python +add_video(shape_id) +``` + +Add a new `p:video` child element for movie having *shape_id*. + + + + + +# `pptx.oxml.table` + +Custom element classes for table-related XML elements + +## `CT_Table` + +Bases: `BaseOxmlElement` + +`a:tbl` custom element class + +### `add_tr` + +```python +add_tr(height: Length) -> CT_TableRow +``` + +Return a newly created `a:tr` child element having its `h` attribute set to `height`. + +### `bandCol` + +```python +bandCol: bool +``` + +### `bandRow` + +```python +bandRow: bool +``` + +### `firstCol` + +```python +firstCol: bool +``` + +### `firstRow` + +```python +firstRow: bool +``` + +### `get_or_add_tblPr` + +```python +get_or_add_tblPr: Callable[[], CT_TableProperties] +``` + +### `insert_tr_at` + +```python +insert_tr_at(idx: int, height: Length) -> CT_TableRow +``` + +Return a new `a:tr` inserted so it becomes the row at `idx` (paper-pptx addition). + +### `iter_tcs` + +```python +iter_tcs() -> Iterator[CT_TableCell] +``` + +Generate each `a:tc` element in this tbl. + +`a:tc` elements are generated left-to-right, top-to-bottom. + +### `lastCol` + +```python +lastCol: bool +``` + +### `lastRow` + +```python +lastRow: bool +``` + +### `new_tbl` + +```python +new_tbl(rows: int, cols: int, width: int, height: int, tableStyleId: str | None = None) -> CT_Table +``` + +Return a new `p:tbl` element tree. + +### `tblGrid` + +```python +tblGrid: CT_TableGrid = OneAndOnlyOne('a:tblGrid') +``` + +### `tblPr` + +```python +tblPr: CT_TableProperties | None = ZeroOrOne('a:tblPr', successors=_tag_seq[1:]) +``` + +### `tc` + +```python +tc(row_idx: int, col_idx: int) -> CT_TableCell +``` + +Return `a:tc` element at `row_idx`, `col_idx`. + +### `tr` + +```python +tr = ZeroOrMore('a:tr', successors=_tag_seq[3:]) +``` + +### `tr_lst` + +```python +tr_lst: list[CT_TableRow] +``` + +## `CT_TableCell` + +Bases: `BaseOxmlElement` + +`a:tc` custom element class + +### `anchor` + +```python +anchor: MSO_VERTICAL_ANCHOR | None +``` + +String held in `anchor` attribute of `a:tcPr` child element of this `a:tc` element. + +### `append_ps_from` + +```python +append_ps_from(spanned_tc: CT_TableCell) +``` + +Append `a:p` elements taken from `spanned_tc`. + +Any non-empty paragraph elements in `spanned_tc` are removed and appended to the +text-frame of this cell. If `spanned_tc` is left with no content after this process, a +single empty `a:p` element is added to ensure the cell is compliant with the spec. + +### `col_idx` + +```python +col_idx: int +``` + +Offset of this cell's column in its table. + +### `get_or_add_tcPr` + +```python +get_or_add_tcPr: Callable[[], CT_TableCellProperties] +``` + +### `get_or_add_txBody` + +```python +get_or_add_txBody: Callable[[], CT_TextBody] +``` + +### `gridSpan` + +```python +gridSpan: int = OptionalAttribute('gridSpan', XsdInt, default=1) +``` + +### `hMerge` + +```python +hMerge: bool = OptionalAttribute('hMerge', XsdBoolean, default=False) +``` + +### `is_merge_origin` + +```python +is_merge_origin: bool +``` + +True if cell is top-left in merged cell range. + +### `is_spanned` + +```python +is_spanned: bool +``` + +True if cell is in merged cell range but not merge origin cell. + +### `marB` + +```python +marB: Length +``` + +Bottom margin value represented in `marB` attribute. + +### `marL` + +```python +marL: Length +``` + +Left margin value represented in `marL` attribute. + +### `marR` + +```python +marR: Length +``` + +Right margin value represented in `marR` attribute. + +### `marT` + +```python +marT: Length +``` + +Top margin for this cell. + +This value is stored in the `marT` attribute of the `a:tcPr` child element of this `a:tc`. + +Read/write. If the attribute is not present, the default value `45720` (0.05 inches) is +returned for top and bottom; `91440` (0.10 inches) is the default for left and right. +Assigning `None` to any `marX` property clears that attribute from the element, +effectively setting it to the default value. + +### `new` + +```python +new() -> CT_TableCell +``` + +Return a new `a:tc` element subtree. + +### `rowSpan` + +```python +rowSpan: int = OptionalAttribute('rowSpan', XsdInt, default=1) +``` + +### `row_idx` + +```python +row_idx: int +``` + +Offset of this cell's row in its table. + +### `tbl` + +```python +tbl: CT_Table +``` + +Table element this cell belongs to. + +### `tcPr` + +```python +tcPr: CT_TableCellProperties | None = ZeroOrOne('a:tcPr', successors=_tag_seq[2:]) +``` + +### `text` + +```python +text: str +``` + +str text contained in cell + +### `txBody` + +```python +txBody: CT_TextBody | None = ZeroOrOne('a:txBody', successors=_tag_seq[1:]) +``` + +### `vMerge` + +```python +vMerge: bool = OptionalAttribute('vMerge', XsdBoolean, default=False) +``` + +## `CT_TableCellProperties` + +Bases: `BaseOxmlElement` + +`a:tcPr` custom element class + +### `anchor` + +```python +anchor: MSO_VERTICAL_ANCHOR | None = OptionalAttribute('anchor', MSO_VERTICAL_ANCHOR) +``` + +### `eg_fillProperties` + +```python +eg_fillProperties = ZeroOrOneChoice((Choice('a:noFill'), Choice('a:solidFill'), Choice('a:gradFill'), Choice('a:blipFill'), Choice('a:pattFill'), Choice('a:grpFill')), successors=('a:headers', 'a:extLst')) +``` + +### `marB` + +```python +marB: Length | None = OptionalAttribute('marB', ST_Coordinate32) +``` + +### `marL` + +```python +marL: Length | None = OptionalAttribute('marL', ST_Coordinate32) +``` + +### `marR` + +```python +marR: Length | None = OptionalAttribute('marR', ST_Coordinate32) +``` + +### `marT` + +```python +marT: Length | None = OptionalAttribute('marT', ST_Coordinate32) +``` + +## `CT_TableCol` + +Bases: `BaseOxmlElement` + +`a:gridCol` custom element class. + +### `w` + +```python +w: Length = RequiredAttribute('w', ST_Coordinate) +``` + +## `CT_TableGrid` + +Bases: `BaseOxmlElement` + +`a:tblGrid` custom element class. + +### `add_gridCol` + +```python +add_gridCol(width: Length) -> CT_TableCol +``` + +A newly appended `a:gridCol` child element having its `w` attribute set to `width`. + +### `gridCol` + +```python +gridCol = ZeroOrMore('a:gridCol') +``` + +### `gridCol_lst` + +```python +gridCol_lst: list[CT_TableCol] +``` + +### `insert_gridCol_at` + +```python +insert_gridCol_at(idx: int, width: Length) -> CT_TableCol +``` + +Return a new `a:gridCol` inserted so it becomes the column at `idx`. + +paper-pptx addition. Insertion is relative to the existing `a:gridCol` siblings, so +a trailing `a:extLst` (if any) stays last per the schema's child sequence. + +## `CT_TableProperties` + +Bases: `BaseOxmlElement` + +`a:tblPr` custom element class. + +### `bandCol` + +```python +bandCol = OptionalAttribute('bandCol', XsdBoolean, default=False) +``` + +### `bandRow` + +```python +bandRow = OptionalAttribute('bandRow', XsdBoolean, default=False) +``` + +### `firstCol` + +```python +firstCol = OptionalAttribute('firstCol', XsdBoolean, default=False) +``` + +### `firstRow` + +```python +firstRow = OptionalAttribute('firstRow', XsdBoolean, default=False) +``` + +### `lastCol` + +```python +lastCol = OptionalAttribute('lastCol', XsdBoolean, default=False) +``` + +### `lastRow` + +```python +lastRow = OptionalAttribute('lastRow', XsdBoolean, default=False) +``` + +## `CT_TableRow` + +Bases: `BaseOxmlElement` + +`a:tr` custom element class. + +### `add_tc` + +```python +add_tc() -> CT_TableCell +``` + +A newly added minimal valid `a:tc` child element. + +### `h` + +```python +h: Length = RequiredAttribute('h', ST_Coordinate) +``` + +### `insert_tc_at` + +```python +insert_tc_at(idx: int) -> CT_TableCell +``` + +Return a new minimal `a:tc` inserted so it becomes the cell at `idx`. + +paper-pptx addition. Insertion is relative to the existing `a:tc` siblings, so a +trailing `a:extLst` (if any) stays last per the schema's child sequence. + +### `row_idx` + +```python +row_idx: int +``` + +Offset of this row in its table. + +### `tc` + +```python +tc = ZeroOrMore('a:tc', successors=('a:extLst',)) +``` + +### `tc_lst` + +```python +tc_lst: list[CT_TableCell] +``` + +## `TcRange` + +```python +TcRange(tc: CT_TableCell, other_tc: CT_TableCell) +``` + +Bases: `object` + +A 2D block of `a:tc` cell elements in a table. + +This object assumes the structure of the underlying table does not change during its lifetime. +Structural changes in this context would be insertion or removal of rows or columns. + +The client is expected to create, use, and then abandon an instance in the context of a single +user operation that is known to have no structural side-effects of this type. + +### `contains_merged_cell` + +```python +contains_merged_cell() -> bool +``` + +True if one or more cells in range are part of a merged cell. + +### `dimensions` + +```python +dimensions() -> tuple[int, int] +``` + +(row_count, col_count) pair describing size of range. + +### `from_merge_origin` + +```python +from_merge_origin(tc: CT_TableCell) +``` + +Return instance created from merge-origin tc element. + +### `in_same_table` + +```python +in_same_table() +``` + +True if both cells provided to constructor are in same table. + +### `iter_except_left_col_tcs` + +```python +iter_except_left_col_tcs() +``` + +Generate each `a:tc` element not in leftmost column of range. + +### `iter_except_top_row_tcs` + +```python +iter_except_top_row_tcs() +``` + +Generate each `a:tc` element in non-first rows of range. + +### `iter_left_col_tcs` + +```python +iter_left_col_tcs() +``` + +Generate each `a:tc` element in leftmost column of range. + +### `iter_tcs` + +```python +iter_tcs() +``` + +Generate each `a:tc` element in this range. + +Cell elements are generated left-to-right, top-to-bottom. + +### `iter_top_row_tcs` + +```python +iter_top_row_tcs() +``` + +Generate each `a:tc` element in topmost row of range. + +### `move_content_to_origin` + +```python +move_content_to_origin() +``` + +Move all paragraphs in range to origin cell. diff --git a/addons/sandbox/skills/pptx/references/api-004.md b/addons/sandbox/skills/pptx/references/api-004.md new file mode 100644 index 000000000..7b6cc7d53 --- /dev/null +++ b/addons/sandbox/skills/pptx/references/api-004.md @@ -0,0 +1,5142 @@ + + + + +# `pptx.oxml.text` + +Custom element classes for text-related XML elements + +## `CT_RegularTextRun` + +Bases: `BaseOxmlElement` + +`a:r` custom element class + +### `get_or_add_rPr` + +```python +get_or_add_rPr: Callable[[], CT_TextCharacterProperties] +``` + +### `rPr` + +```python +rPr: CT_TextCharacterProperties | None = ZeroOrOne('a:rPr', successors=('a:t',)) +``` + +### `t` + +```python +t: BaseOxmlElement = OneAndOnlyOne('a:t') +``` + +### `text` + +```python +text: str +``` + +All text of (required) `a:t` child. + +## `CT_TextAutonumberBullet` + +Bases: `BaseOxmlElement` + +`a:buAutoNum` element, specifying automatic numbering for a paragraph. + +### `startAt` + +```python +startAt: int = OptionalAttribute('startAt', ST_TextBulletStartAtNum, default=1) +``` + +### `type` + +```python +type: str = RequiredAttribute('type', ST_TextAutonumberScheme) +``` + +## `CT_TextBody` + +Bases: `BaseOxmlElement` + +`p:txBody` custom element class. + +Also used for `c:txPr` in charts and perhaps other elements. + +### `add_p` + +```python +add_p: Callable[[], CT_TextParagraph] +``` + +### `bodyPr` + +```python +bodyPr: CT_TextBodyProperties = OneAndOnlyOne('a:bodyPr') +``` + +### `clear_content` + +```python +clear_content() +``` + +Remove all `a:p` children, but leave any others. + +cf. lxml `_Element.clear()` method which removes all children. + +### `defRPr` + +```python +defRPr: CT_TextCharacterProperties +``` + +`a:defRPr` element of required first `p` child, added with its ancestors if not present. + +Used when element is a ``c:txPr`` in a chart and the `p` element is used only to specify +formatting, not content. + +### `is_empty` + +```python +is_empty: bool +``` + +True if only a single empty `a:p` element is present. + +### `lstStyle` + +```python +lstStyle: CT_TextListStyle | None = ZeroOrOne('a:lstStyle', successors=('a:p',)) +``` + +### `new` + +```python +new() +``` + +Return a new `p:txBody` element tree. + +### `new_a_txBody` + +```python +new_a_txBody() -> CT_TextBody +``` + +Return a new `a:txBody` element tree. + +Suitable for use in a table cell and possibly other situations. + +### `new_p_txBody` + +```python +new_p_txBody() +``` + +Return a new `p:txBody` element tree, suitable for use in an `p:sp` element. + +### `new_txPr` + +```python +new_txPr() +``` + +Return a `c:txPr` element tree. + +Suitable for use in a chart object like data labels or tick labels. + +### `p` + +```python +p: CT_TextParagraph = OneOrMore('a:p') +``` + +### `p_lst` + +```python +p_lst: list[CT_TextParagraph] +``` + +### `unclear_content` + +```python +unclear_content() +``` + +Ensure p:txBody has at least one a:p child. + +Intuitively, reverse a ".clear_content()" operation to minimum conformance with spec +(single empty paragraph). + +## `CT_TextBodyProperties` + +Bases: `BaseOxmlElement` + +`a:bodyPr` custom element class. + +### `anchor` + +```python +anchor: MSO_VERTICAL_ANCHOR | None = OptionalAttribute('anchor', MSO_VERTICAL_ANCHOR) +``` + +### `autofit` + +```python +autofit +``` + +The autofit setting for the text frame, a member of the `MSO_AUTO_SIZE` enumeration. + +### `bIns` + +```python +bIns: Length = OptionalAttribute('bIns', ST_Coordinate32, default=Emu(45720)) +``` + +### `eg_textAutoFit` + +```python +eg_textAutoFit = ZeroOrOneChoice((Choice('a:noAutofit'), Choice('a:normAutofit'), Choice('a:spAutoFit')), successors=('a:scene3d', 'a:sp3d', 'a:flatTx', 'a:extLst')) +``` + +### `lIns` + +```python +lIns: Length = OptionalAttribute('lIns', ST_Coordinate32, default=Emu(91440)) +``` + +### `noAutofit` + +```python +noAutofit: BaseOxmlElement | None +``` + +### `normAutofit` + +```python +normAutofit: CT_TextNormalAutofit | None +``` + +### `rIns` + +```python +rIns: Length = OptionalAttribute('rIns', ST_Coordinate32, default=Emu(91440)) +``` + +### `spAutoFit` + +```python +spAutoFit: BaseOxmlElement | None +``` + +### `tIns` + +```python +tIns: Length = OptionalAttribute('tIns', ST_Coordinate32, default=Emu(45720)) +``` + +### `wrap` + +```python +wrap: str | None = OptionalAttribute('wrap', ST_TextWrappingType) +``` + +## `CT_TextBulletSizePercent` + +Bases: `BaseOxmlElement` + +`a:buSzPct` element, bullet size as a fraction of the paragraph's text size. + +### `val` + +```python +val: float = RequiredAttribute('val', ST_TextBulletSizePercent) +``` + +## `CT_TextCharBullet` + +Bases: `BaseOxmlElement` + +`a:buChar` element, specifying the character to use as a paragraph's bullet. + +### `char` + +```python +char: str = RequiredAttribute('char', XsdString) +``` + +## `CT_TextCharacterProperties` + +Bases: `BaseOxmlElement` + +Custom element class for `a:rPr`, `a:defRPr`, and `a:endParaRPr`. + +'rPr' is short for 'run properties', and it corresponds to the `Font` proxy class. + +### `add_hlinkClick` + +```python +add_hlinkClick(rId: str) -> CT_Hyperlink +``` + +Add an `a:hlinkClick` child element with r:id attribute set to `rId`. + +### `b` + +```python +b: bool | None = OptionalAttribute('b', XsdBoolean) +``` + +### `eg_fillProperties` + +```python +eg_fillProperties = ZeroOrOneChoice((Choice('a:noFill'), Choice('a:solidFill'), Choice('a:gradFill'), Choice('a:blipFill'), Choice('a:pattFill'), Choice('a:grpFill')), successors=('a:effectLst', 'a:effectDag', 'a:highlight', 'a:uLnTx', 'a:uLn', 'a:uFillTx', 'a:uFill', 'a:latin', 'a:ea', 'a:cs', 'a:sym', 'a:hlinkClick', 'a:hlinkMouseOver', 'a:rtl', 'a:extLst')) +``` + +### `get_or_add_hlinkClick` + +```python +get_or_add_hlinkClick: Callable[[], CT_Hyperlink] +``` + +### `get_or_add_latin` + +```python +get_or_add_latin: Callable[[], CT_TextFont] +``` + +### `hlinkClick` + +```python +hlinkClick: CT_Hyperlink | None = ZeroOrOne('a:hlinkClick', successors=('a:hlinkMouseOver', 'a:rtl', 'a:extLst')) +``` + +### `i` + +```python +i: bool | None = OptionalAttribute('i', XsdBoolean) +``` + +### `lang` + +```python +lang: MSO_LANGUAGE_ID | None = OptionalAttribute('lang', MSO_LANGUAGE_ID) +``` + +### `latin` + +```python +latin: CT_TextFont | None = ZeroOrOne('a:latin', successors=('a:ea', 'a:cs', 'a:sym', 'a:hlinkClick', 'a:hlinkMouseOver', 'a:rtl', 'a:extLst')) +``` + +### `sz` + +```python +sz: int | None = OptionalAttribute('sz', ST_TextFontSize) +``` + +### `u` + +```python +u: MSO_TEXT_UNDERLINE_TYPE | None = OptionalAttribute('u', MSO_TEXT_UNDERLINE_TYPE) +``` + +## `CT_TextField` + +Bases: `BaseOxmlElement` + +`a:fld` field element, for either a slide number or date field. + +### `get_or_add_rPr` + +```python +get_or_add_rPr: Callable[[], CT_TextCharacterProperties] +``` + +### `id` + +```python +id: str = RequiredAttribute('id', XsdString) +``` + +### `rPr` + +```python +rPr: CT_TextCharacterProperties | None = ZeroOrOne('a:rPr', successors=('a:pPr', 'a:t')) +``` + +### `t` + +```python +t: BaseOxmlElement | None = ZeroOrOne('a:t', successors=()) +``` + +### `text` + +```python +text: str +``` + +The text of the `a:t` child element. + +### `type` + +```python +type: str | None = OptionalAttribute('type', XsdString) +``` + +## `CT_TextFont` + +Bases: `BaseOxmlElement` + +Custom element class for `a:latin`, `a:ea`, `a:cs`, and `a:sym`. + +These occur as child elements of CT_TextCharacterProperties, e.g. `a:rPr`. + +### `typeface` + +```python +typeface: str = RequiredAttribute('typeface', ST_TextTypeface) +``` + +## `CT_TextLineBreak` + +Bases: `BaseOxmlElement` + +`a:br` line break element + +### `get_or_add_rPr` + +```python +get_or_add_rPr: Callable[[], CT_TextCharacterProperties] +``` + +### `rPr` + +```python +rPr = ZeroOrOne('a:rPr', successors=()) +``` + +### `text` + +```python +text +``` + +Unconditionally a single vertical-tab character. + +A line break element can contain no text other than the implicit line feed it +represents. + +## `CT_TextListStyle` + +Bases: `BaseOxmlElement` + +`a:lstStyle` custom element class. + +Also used for the master's `p:titleStyle`/`p:bodyStyle`/`p:otherStyle` children and the +presentation's `p:defaultTextStyle` — all are the same `CT_TextListStyle` complex type: a +sequence of `a:lvl1pPr` … `a:lvl9pPr` (plus `a:defPPr`) paragraph-property elements. + +### `pPr_for_lvl` + +```python +pPr_for_lvl(level: int) -> CT_TextParagraphProperties | None +``` + +Return the `a:lvl{level+1}pPr` child for 0-based indent `level`, or `None`. + +Read-only helper for the effective-style inheritance walk. + +## `CT_TextNormalAutofit` + +Bases: `BaseOxmlElement` + +`a:normAutofit` element specifying fit text to shape font reduction, etc. + +### `fontScale` + +```python +fontScale = OptionalAttribute('fontScale', ST_TextFontScalePercentOrPercentString, default=100.0) +``` + +### `lnSpcReduction` + +```python +lnSpcReduction = OptionalAttribute('lnSpcReduction', ST_TextLineSpaceReductionPercentOrPercentString, default=0.0) +``` + +## `CT_TextParagraph` + +Bases: `BaseOxmlElement` + +`a:p` custom element class + +### `add_br` + +```python +add_br() -> CT_TextLineBreak +``` + +Return a newly appended `a:br` element. + +### `add_fld` + +```python +add_fld(id_str: str, field_type: str, cached_text: str) -> CT_TextField +``` + +Append an `a:fld` with `id_str`/`field_type` and cached `a:t` text (paper-pptx). + +Content children (`a:r`/`a:br`/`a:fld`) precede `a:endParaRPr` per the schema; the +new field is inserted accordingly. + +### `add_r` + +```python +add_r(text: str | None = None) -> CT_RegularTextRun +``` + +Return a newly appended `a:r` element. + +### `append_text` + +```python +append_text(text: str) +``` + +Append `a:r` and `a:br` elements to `p` based on `text`. + + Any ` +` or ` ` (vertical-tab) characters in `text` delimit `a:r` (run) elements and + themselves are translated to `a:br` (line-break) elements. The vertical-tab character + appears in clipboard text from PowerPoint at "soft" line-breaks (new-line, but not new + paragraph). + +### `br` + +```python +br = ZeroOrMore('a:br', successors=('a:endParaRPr',)) +``` + +### `content_children` + +```python +content_children: tuple[CT_RegularTextRun | CT_TextLineBreak | CT_TextField, ...] +``` + +Sequence containing text-container child elements of this `a:p` element. + +These include `a:r`, `a:br`, and `a:fld`. + +### `endParaRPr` + +```python +endParaRPr: CT_TextCharacterProperties | None = ZeroOrOne('a:endParaRPr', successors=()) +``` + +### `get_or_add_endParaRPr` + +```python +get_or_add_endParaRPr: Callable[[], CT_TextCharacterProperties] +``` + +### `get_or_add_pPr` + +```python +get_or_add_pPr: Callable[[], CT_TextParagraphProperties] +``` + +### `pPr` + +```python +pPr: CT_TextParagraphProperties | None = ZeroOrOne('a:pPr', successors=('a:r', 'a:br', 'a:fld', 'a:endParaRPr')) +``` + +### `r` + +```python +r = ZeroOrMore('a:r', successors=('a:endParaRPr',)) +``` + +### `r_lst` + +```python +r_lst: list[CT_RegularTextRun] +``` + +### `text` + +```python +text: str +``` + +str text contained in this paragraph. + +## `CT_TextParagraphProperties` + +Bases: `BaseOxmlElement` + +`a:pPr` custom element class. + +### `algn` + +```python +algn: PP_PARAGRAPH_ALIGNMENT | None = OptionalAttribute('algn', PP_PARAGRAPH_ALIGNMENT) +``` + +### `buAutoNum` + +```python +buAutoNum: CT_TextAutonumberBullet | None +``` + +### `buChar` + +```python +buChar: CT_TextCharBullet | None +``` + +### `buFont` + +```python +buFont: CT_TextFont | None = ZeroOrOne('a:buFont', successors=_tag_seq[10:]) +``` + +### `buNone` + +```python +buNone: BaseOxmlElement | None +``` + +### `buSzPct` + +```python +buSzPct: CT_TextBulletSizePercent | None = ZeroOrOne('a:buSzPct', successors=_tag_seq[7:]) +``` + +### `defRPr` + +```python +defRPr: CT_TextCharacterProperties | None = ZeroOrOne('a:defRPr', successors=_tag_seq[16:]) +``` + +### `eg_bullet` + +```python +eg_bullet = ZeroOrOneChoice((Choice('a:buNone'), Choice('a:buAutoNum'), Choice('a:buChar')), successors=_tag_seq[13:]) +``` + +### `get_or_add_buFont` + +```python +get_or_add_buFont: Callable[[], CT_TextFont] +``` + +### `get_or_add_buSzPct` + +```python +get_or_add_buSzPct: Callable[[], CT_TextBulletSizePercent] +``` + +### `get_or_add_defRPr` + +```python +get_or_add_defRPr: Callable[[], CT_TextCharacterProperties] +``` + +### `get_or_change_to_buAutoNum` + +```python +get_or_change_to_buAutoNum: Callable[[], CT_TextAutonumberBullet] +``` + +### `get_or_change_to_buChar` + +```python +get_or_change_to_buChar: Callable[[], CT_TextCharBullet] +``` + +### `get_or_change_to_buNone` + +```python +get_or_change_to_buNone: Callable[[], BaseOxmlElement] +``` + +### `indent` + +```python +indent: Length | None = OptionalAttribute('indent', ST_TextIndent) +``` + +### `line_spacing` + +```python +line_spacing: float | Length | None +``` + +The spacing between baselines of successive lines in this paragraph. + +A float value indicates a number of lines. A `Length` value indicates a fixed spacing. +Value is contained in `./a:lnSpc/a:spcPts/@val` or `./a:lnSpc/a:spcPct/@val`. Value is +`None` if no element is present. + +### `lnSpc` + +```python +lnSpc: CT_TextSpacing | None = ZeroOrOne('a:lnSpc', successors=_tag_seq[1:]) +``` + +### `lvl` + +```python +lvl: int = OptionalAttribute('lvl', ST_TextIndentLevelType, default=0) +``` + +### `marL` + +```python +marL: Length | None = OptionalAttribute('marL', ST_TextMargin) +``` + +### `space_after` + +```python +space_after: Length | None +``` + +The EMU equivalent of the centipoints value in `./a:spcAft/a:spcPts/@val`. + +### `space_before` + +```python +space_before +``` + +The EMU equivalent of the centipoints value in `./a:spcBef/a:spcPts/@val`. + +### `spcAft` + +```python +spcAft: CT_TextSpacing | None = ZeroOrOne('a:spcAft', successors=_tag_seq[3:]) +``` + +### `spcBef` + +```python +spcBef: CT_TextSpacing | None = ZeroOrOne('a:spcBef', successors=_tag_seq[2:]) +``` + +## `CT_TextSpacing` + +Bases: `BaseOxmlElement` + +Used for `a:lnSpc`, `a:spcBef`, and `a:spcAft` elements. + +### `get_or_add_spcPct` + +```python +get_or_add_spcPct: Callable[[], CT_TextSpacingPercent] +``` + +### `get_or_add_spcPts` + +```python +get_or_add_spcPts: Callable[[], CT_TextSpacingPoint] +``` + +### `set_spcPct` + +```python +set_spcPct(value: float) +``` + +Set spacing to `value` lines, e.g. 1.75 lines. + +A ./a:spcPts child is removed if present. + +### `set_spcPts` + +```python +set_spcPts(value: Length) +``` + +Set spacing to `value` points. A ./a:spcPct child is removed if present. + +### `spcPct` + +```python +spcPct: CT_TextSpacingPercent | None = ZeroOrOne('a:spcPct') +``` + +### `spcPts` + +```python +spcPts: CT_TextSpacingPoint | None = ZeroOrOne('a:spcPts') +``` + +## `CT_TextSpacingPercent` + +Bases: `BaseOxmlElement` + +`a:spcPct` element, specifying spacing in thousandths of a percent in its `val` attribute. + +### `val` + +```python +val: float = RequiredAttribute('val', ST_TextSpacingPercentOrPercentString) +``` + +## `CT_TextSpacingPoint` + +Bases: `BaseOxmlElement` + +`a:spcPts` element, specifying spacing in centipoints in its `val` attribute. + +### `val` + +```python +val: Length = RequiredAttribute('val', ST_TextSpacingPoint) +``` + + + + + +# `pptx.oxml.theme` + +lxml custom element classes for theme-related XML elements. + +## `CT_OfficeStyleSheet` + +Bases: `BaseOxmlElement` + +```` element, root of a theme part + +### `new_default` + +```python +new_default() +``` + +Return a new ```` element containing default settings +suitable for use with a notes master. + + + + + +# `pptx.oxml.xmlchemy` + +Base and meta classes enabling declarative definition of custom element classes. + +## `AttributeType` + +Bases: `Protocol` + +Interface for an object that can act as an attribute type. + +An attribute-type specifies how values are transformed to and from the XML "string" value of the +attribute. + +### `from_xml` + +```python +from_xml(xml_value: str) -> Any +``` + +Transform an attribute value to a Python value. + +### `to_xml` + +```python +to_xml(value: Any) -> str +``` + +Transform a Python value to a str value suitable to this XML attribute. + +## `BaseAttribute` + +```python +BaseAttribute(attr_name: str, simple_type: type[AttributeType]) +``` + +Base class for OptionalAttribute and RequiredAttribute, providing common methods. + +### `populate_class_members` + +```python +populate_class_members(element_cls: Type[BaseOxmlElement], prop_name: str) +``` + +Add the appropriate methods to *element_cls*. + +## `BaseOxmlElement` + +Bases: `ElementBase` + +Effective base class for all custom element classes. + +Adds standardized behavior to all classes in one place. + +### `first_child_found_in` + +```python +first_child_found_in(*tagnames: str) -> _Element | None +``` + +First child with tag in `tagnames`, or None if not found. + +### `insert_element_before` + +```python +insert_element_before(elm: ElementBase, *tagnames: str) +``` + +### `remove_all` + +```python +remove_all(*tagnames: str) -> None +``` + +Remove child elements with tagname (e.g. "a:p") in `tagnames`. + +### `xml` + +```python +xml: str +``` + +XML string for this element, suitable for testing purposes. + +Pretty printed for readability and without an XML declaration at the top. + +### `xpath` + +```python +xpath(xpath_str: str) -> Any +``` + +Override of `lxml` _Element.xpath() method. + +Provides standard Open XML namespace mapping (`nsmap`) in centralized location. + +## `Choice` + +Bases: `_BaseChildElement` + +Defines a child element belonging to a group, only one of which may appear as a child. + +### `nsptagname` + +```python +nsptagname +``` + +### `populate_class_members` + +```python +populate_class_members(element_cls: Type[BaseOxmlElement], group_prop_name: str, successors: Sequence[str]) +``` + +Add the appropriate methods to `element_cls`. + +## `MetaOxmlElement` + +```python +MetaOxmlElement(clsname: str, bases: tuple[type, ...], clsdict: dict[str, Any]) +``` + +Bases: `type` + +Metaclass for BaseOxmlElement. + +## `OneAndOnlyOne` + +```python +OneAndOnlyOne(nsptagname: str) +``` + +Bases: `_BaseChildElement` + +Defines a required child element for MetaOxmlElement. + +### `populate_class_members` + +```python +populate_class_members(element_cls: Type[BaseOxmlElement], prop_name: str) +``` + +Add the appropriate methods to *element_cls*. + +## `OneOrMore` + +Bases: `_BaseChildElement` + +Defines a repeating child element for MetaOxmlElement that must appear at least once. + +### `populate_class_members` + +```python +populate_class_members(element_cls: Type[BaseOxmlElement], prop_name: str) +``` + +Add the appropriate methods to *element_cls*. + +## `OptionalAttribute` + +```python +OptionalAttribute(attr_name: str, simple_type: type[AttributeType], default: Any = None) +``` + +Bases: `BaseAttribute` + +Defines an optional attribute on a custom element class. + +An optional attribute returns a default value when not present for reading. When assigned +`None`, the attribute is removed. + +## `OxmlElement` + +```python +OxmlElement(nsptag_str: str, nsmap: dict[str, str] | None = None) -> BaseOxmlElement +``` + +Return a "loose" lxml element having the tag specified by `nsptag_str`. + +`nsptag_str` must contain the standard namespace prefix, e.g. 'a:tbl'. The resulting element is +an instance of the custom element class for this tag name if one is defined. + +## `RequiredAttribute` + +Bases: `BaseAttribute` + +Defines a required attribute on a custom element class. + +A required attribute is assumed to be present for reading, so does not have a default value; +its actual value is always used. If missing on read, an `InvalidXmlError` is raised. It also +does not remove the attribute if `None` is assigned. Assigning `None` raises `TypeError` or +`ValueError`, depending on the simple type of the attribute. + +## `XmlString` + +Bases: `str` + +Provides string comparison override suitable for serialized XML; useful for tests. + +## `ZeroOrMore` + +Bases: `_BaseChildElement` + +Defines an optional repeating child element for MetaOxmlElement. + +### `populate_class_members` + +```python +populate_class_members(element_cls: Type[BaseOxmlElement], prop_name: str) +``` + +Add the appropriate methods to *element_cls*. + +## `ZeroOrOne` + +Bases: `_BaseChildElement` + +Defines an optional child element for MetaOxmlElement. + +### `populate_class_members` + +```python +populate_class_members(element_cls: Type[BaseOxmlElement], prop_name: str) +``` + +Add the appropriate methods to `element_cls`. + +## `ZeroOrOneChoice` + +```python +ZeroOrOneChoice(choices: Iterable[Choice], successors: Iterable[str] = ()) +``` + +Bases: `_BaseChildElement` + +An `EG_*` element group where at most one of its members may appear as a child. + +### `populate_class_members` + +```python +populate_class_members(element_cls: Type[BaseOxmlElement], prop_name: str) +``` + +Add the appropriate methods to `element_cls`. + +## `serialize_for_reading` + +```python +serialize_for_reading(element: ElementBase) +``` + +Serialize *element* to human-readable XML suitable for tests. No XML +declaration. + + + + + +# `pptx.package` + +Overall .pptx package. + +## `Package` + +Bases: `OpcPackage` + +An overall .pptx package. + +### `core_properties` + +```python +core_properties() -> CorePropertiesPart +``` + +Instance of `CoreProperties` holding read/write Dublin Core doc properties. + +Creates a default core properties part if one is not present (not common). + +### `get_or_add_image_part` + +```python +get_or_add_image_part(image_file: str | IO[bytes]) +``` + +Return an `ImagePart` object containing the image in *image_file*. If +the image part already exists in this package, it is reused, +otherwise a new one is created. + +### `get_or_add_media_part` + +```python +get_or_add_media_part(media) +``` + +Return a `MediaPart` object containing the media in *media*. + +If a media part for this media bytestream ("file") is already present +in this package, it is reused, otherwise a new one is created. + +### `next_image_partname` + +```python +next_image_partname(ext: str) -> PackURI +``` + +Return a `PackURI` instance representing the next available image partname. + +Partname uses the next available sequence number. *ext* is used as the extention on the +returned partname. + +### `next_media_partname` + +```python +next_media_partname(ext) +``` + +Return `PackURI` instance for next available media partname. + +Partname is first available, starting at sequence number 1. Empty +sequence numbers are reused. *ext* is used as the extension on the +returned partname. + +### `presentation_part` + +```python +presentation_part +``` + +Reference to the `Presentation` instance contained in this package. + +## `PackageDiff` + +```python +PackageDiff(deltas: Tuple[PartDelta, ...]) -> None +``` + +Part-by-part semantic diff between two packages. Schema "paper-package-diff" v1. + +``deltas`` holds one `PartDelta` per package member that was added, removed, +or semantically changed; it is empty when the two packages are equivalent. + +### `deltas` + +```python +deltas: Tuple[PartDelta, ...] +``` + +### `is_empty` + +```python +is_empty: bool +``` + +True when no part changed. Check it to recognize a no-op save. + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the package diff as a JSON-ready dict under the `paper-package-diff` schema. + +## `PartDelta` + +```python +PartDelta(partname: str, kind: str, change: str, detail: str) -> None +``` + +One differing package member. + +### `change` + +```python +change: str +``` + +### `detail` + +```python +detail: str +``` + +### `kind` + +```python +kind: str +``` + +### `partname` + +```python +partname: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this part's change as a JSON-ready dict. + +## `diff_package` + +```python +diff_package(path_a: str, path_b: str) -> PackageDiff +``` + +Return the `PackageDiff` between the packages at `path_a` and `path_b`. + +XML members are compared semantically. Valid relationship parts compare complete bindings, +ignoring child order, omitted versus explicit ``Internal`` TargetMode, and accepted +absolute-versus-source-relative spellings that resolve to the same internal member. +Relationship IDs and types, whether a binding is external, external target spellings, and +unknown attributes remain significant. Valid content-type manifests compare the effective +type assigned to every package member; unmatched defaults remain significant. Unsupported +manifests, including overrides for absent members, fall back to the existing +declaration-order-insensitive XML comparison. + +Other XML uses the order-sensitive `xml_equivalent`; binary members compare by bytes. Members +appearing in only one package report as "added" (only in `path_b`) or "removed" (only in +`path_a`). Deltas are sorted by partname; the returned `PackageDiff` retains schema version 1. + +## `patch_save` + +```python +patch_save(original_path: str, document: str, out_path: str) -> PackageDiff +``` + +Save `document` to `out_path`, restoring original bytes for unchanged XML parts. + +Compare-based narrow save: `document` (a `Presentation`) is serialized normally, then every XML +member that is semantically identical to its counterpart in `original_path` is written with the +ORIGINAL bytes, so unrelated parts never churn. Returns the residual `PackageDiff` between +`original_path` and `out_path`. + +Writes are deterministic — entry order is `[Content_Types].xml`, `_rels/.rels`, then all +remaining members sorted; every entry timestamp is fixed to 1980-01-01 — and atomic: the package +is built in a temp file in `out_path`'s directory and moved into place with `os.replace`, so a +mid-write failure leaves any existing `out_path` untouched. When nothing changed at all, +`out_path` is written as an exact byte copy of `original_path`. + +Valid relationship collections compare by their complete bindings rather than serialization +order, and valid content-type manifests compare member-by-member effective assignments while +retaining unmatched defaults. Producer-specific serialization choices in those package +registries therefore do not prevent a byte-identical no-op save. Well-formed ambiguous or +unsupported structures receive no specialized normalization: relationships fall back to +ordinary XML comparison, while content-type manifests retain the existing +declaration-order-insensitive XML comparison. When comparison requires parsing, malformed XML +and prohibited DTD/entity constructs raise `ValueError`. + +"Nothing changed" is decided over the members that can be parts: none added, none removed, each +semantically identical to its counterpart. A ZIP folder record such as `ppt/` is not a part, so +`save()` structurally cannot emit one and its absence from the serialized candidate never +evidences a change. Such a record therefore survives a no-op round trip — the byte copy +reproduces it — and is dropped by an actual edit, which rebuilds the package from the members +`save()` emitted. + +Not interchangeable with `.Presentation.save`, which is also atomic on a path: atomicity +is how the bytes land, narrowness is which bytes get written. `save()` re-serializes every part, +so even an unchanged part gets new bytes; `patch_save` restores the original bytes for every +part that is semantically identical. + +Symlinked destinations are resolved, so the file a link names is the file replaced. + +Raises `UnsupportedStructureError` when `original_path` is not a readable zip package (before +anything is written) and `ValueError` when `document` cannot save itself. + +## `xml_equivalent` + +```python +xml_equivalent(a: Union[bytes, str], b: Union[bytes, str]) -> bool +``` + +Return True when `a` and `b` are semantically equivalent XML documents. + +Comparison is Canonical XML (C14N 2.0) with prefixes rewritten, so differences in +attribute order, namespace-prefix spelling, XML declaration, self-closing-tag style, and +pretty-print indentation are equivalent — while element order, attribute values, and all +potentially meaningful text compare exactly. + +Whitespace handling is deliberately asymmetric: a whitespace-only text +node is ignored ONLY where its parent element has element children (structural +indentation; OOXML defines no mixed content, so such whitespace can never render). Text +of element-childless elements — `a:t` and friends — is never normalized in any way: two +documents differing only by a trailing space inside a text node are NOT equivalent. + +Raises `ValueError` when either argument is not well-formed XML or contains a DTD or +entity declaration. + + + + + +# `pptx.parts.chart` + +Chart part objects, including Chart and Charts. + +## `ChartPart` + +Bases: `XmlPart` + +A chart part. + +Corresponds to parts having partnames matching ppt/charts/chart[1-9][0-9]*.xml + +### `chart` + +```python +chart() +``` + +`Chart` object representing the chart in this part. + +### `chart_workbook` + +```python +chart_workbook() +``` + +The `ChartWorkbook` object providing access to the external chart +data in a linked or embedded Excel workbook. + +### `new` + +```python +new(chart_type: XL_CHART_TYPE, chart_data: ChartData, package: Package) +``` + +Return new `ChartPart` instance added to `package`. + +Returned chart-part contains a chart of `chart_type` depicting `chart_data`. + +### `partname_template` + +```python +partname_template = '/ppt/charts/chart%d.xml' +``` + +## `ChartWorkbook` + +```python +ChartWorkbook(chartSpace, chart_part) +``` + +Bases: `object` + +Provides access to external chart data in a linked or embedded Excel workbook. + +### `update_from_xlsx_blob` + +```python +update_from_xlsx_blob(xlsx_blob) +``` + +Replace the Excel spreadsheet in the related `EmbeddedXlsxPart` with +the Excel binary in *xlsx_blob*, adding a new `EmbeddedXlsxPart` if +there isn't one. + +### `xlsx_part` + +```python +xlsx_part +``` + +Optional `EmbeddedXlsxPart` object containing data for this chart. + +This related part has its rId at `c:chartSpace/c:externalData/@rId`. This value +is `None` if there is no `` element. + + + + + +# `pptx.parts.coreprops` + +Core properties part, corresponds to ``/docProps/core.xml`` part in package. + +## `CorePropertiesPart` + +Bases: `XmlPart` + +Corresponds to part named `/docProps/core.xml`. + +Contains the core document properties for this document package. + +### `author` + +```python +author: str +``` + +### `category` + +```python +category: str +``` + +### `comments` + +```python +comments: str +``` + +### `content_status` + +```python +content_status: str +``` + +### `created` + +```python +created +``` + +### `default` + +```python +default(package: Package) +``` + +Return default new `CorePropertiesPart` instance suitable as starting point. + +This provides a base for adding core-properties to a package that doesn't yet +have any. + +### `identifier` + +```python +identifier: str +``` + +### `keywords` + +```python +keywords: str +``` + +### `language` + +```python +language: str +``` + +### `last_modified_by` + +```python +last_modified_by: str +``` + +### `last_printed` + +```python +last_printed +``` + +### `modified` + +```python +modified +``` + +### `revision` + +```python +revision +``` + +### `subject` + +```python +subject: str +``` + +### `title` + +```python +title: str +``` + +### `version` + +```python +version: str +``` + + + + + +# `pptx.parts.embeddedpackage` + +Embedded Package part objects. + +## `EmbeddedDocxPart` + +Bases: `EmbeddedPackagePart` + +A Word .docx file stored in a part. + +This part-type arises when a Word document appears as an embedded OLE-object shape. + +### `content_type` + +```python +content_type = CT.WML_DOCUMENT +``` + +### `partname_template` + +```python +partname_template = '/ppt/embeddings/Microsoft_Word_Document%d.docx' +``` + +## `EmbeddedPackagePart` + +Bases: `Part` + +A distinct OPC package, e.g. an Excel file, embedded in this PPTX package. + +Has a partname like: `ppt/embeddings/Microsoft_Excel_Sheet1.xlsx`. + +### `factory` + +```python +factory(prog_id: PROG_ID | str, object_blob: bytes, package: Package) +``` + +Return a new `EmbeddedPackagePart` subclass instance added to *package*. + +The subclass is determined by `prog_id` which corresponds to the "application" +used to open the "file-type" of `object_blob`. The returned part contains the +bytes of `object_blob` and has the content-type also determined by `prog_id`. + +### `new` + +```python +new(blob: bytes, package: Package) +``` + +Return new `EmbeddedPackagePart` subclass object. + +The returned part object contains `blob` and is added to `package`. + +## `EmbeddedPptxPart` + +Bases: `EmbeddedPackagePart` + +A PowerPoint file stored in a part. + +This part-type arises when a PowerPoint presentation (.pptx file) appears as an +embedded OLE-object shape. + +### `content_type` + +```python +content_type = CT.PML_PRESENTATION +``` + +### `partname_template` + +```python +partname_template = '/ppt/embeddings/Microsoft_PowerPoint_Presentation%d.pptx' +``` + +## `EmbeddedXlsxPart` + +Bases: `EmbeddedPackagePart` + +An Excel file stored in a part. + +This part-type arises as the data source for a chart, but may also be the OLE-object +for an embedded object shape. + +### `content_type` + +```python +content_type = CT.SML_SHEET +``` + +### `partname_template` + +```python +partname_template = '/ppt/embeddings/Microsoft_Excel_Sheet%d.xlsx' +``` + + + + + +# `pptx.parts.image` + +ImagePart and related objects. + +## `Image` + +```python +Image(blob: bytes, filename: str | None) +``` + +Bases: `object` + +Immutable value object representing an image such as a JPEG, PNG, or GIF. + +### `blob` + +```python +blob: bytes +``` + +The binary image bytestream of this image. + +### `content_type` + +```python +content_type() -> str +``` + +MIME-type of this image, e.g. `"image/jpeg"`. + +### `dpi` + +```python +dpi() -> tuple[int, int] +``` + +A (horz_dpi, vert_dpi) 2-tuple specifying the dots-per-inch resolution of this image. + +A default value of (72, 72) is used if the dpi is not specified in the image file. + +### `ext` + +```python +ext() -> str +``` + +Canonical file extension for this image e.g. `'png'`. + +The returned extension is all lowercase and is the canonical extension for the content type +of this image, regardless of what extension may have been used in its filename, if any. + +### `filename` + +```python +filename: str | None +``` + +Filename from path used to load this image, if loaded from the filesystem. + +`None` if no filename was used in loading, such as when loaded from an in-memory stream. + +### `from_blob` + +```python +from_blob(blob: bytes, filename: str | None = None) -> Image +``` + +Return a new `Image` object loaded from the image binary in `blob`. + +### `from_file` + +```python +from_file(image_file: str | IO[bytes]) -> Image +``` + +Return a new `Image` object loaded from `image_file`. + +`image_file` can be either a path (str) or a file-like object. + +### `sha1` + +```python +sha1() -> str +``` + +SHA1 hash digest of the image blob. + +### `size` + +```python +size() -> tuple[int, int] +``` + +A (width, height) 2-tuple specifying the dimensions of this image in pixels. + +## `ImagePart` + +```python +ImagePart(partname: PackURI, content_type: str, package: Package, blob: bytes, filename: str | None = None) +``` + +Bases: `Part` + +An image part. + +An image part generally has a partname matching the regex `ppt/media/image[1-9][0-9]*.*`. + +### `desc` + +```python +desc: str +``` + +The filename associated with this image. + +Either the filename of the original image or a generic name of the form `image.ext` where +`ext` is appropriate to the image file format, e.g. `'jpg'`. An image created using a path +will have that filename; one created with a file-like object will have a generic name. + +### `ext` + +```python +ext: str +``` + +File-name extension for this image e.g. `'png'`. + +### `image` + +```python +image: Image +``` + +An `Image` object containing the image in this image part. + +Note this is a `pptx.image.Image` object, not a PIL Image. + +### `new` + +```python +new(package: Package, image: Image) -> ImagePart +``` + +Return new `ImagePart` instance containing `image`. + +`image` is an `Image` object. + +### `scale` + +```python +scale(scaled_cx: int | None, scaled_cy: int | None) -> tuple[int, int] +``` + +Return scaled image dimensions in EMU based on the combination of parameters supplied. + +If `scaled_cx` and `scaled_cy` are both `None`, the native image size is returned. If +neither `scaled_cx` nor `scaled_cy` is `None`, their values are returned unchanged. If a +value is provided for either `scaled_cx` or `scaled_cy` and the other is `None`, the +missing value is calculated such that the image's aspect ratio is preserved. + +### `sha1` + +```python +sha1() -> str +``` + +The 40-character SHA1 hash digest for the image binary of this image part. + +like: `"1be010ea47803b00e140b852765cdf84f491da47"`. + + + + + +# `pptx.parts.media` + +MediaPart and related objects. + +## `MediaPart` + +Bases: `Part` + +A media part, containing an audio or video resource. + +A media part generally has a partname matching the regex +`ppt/media/media[1-9][0-9]*.*`. + +### `new` + +```python +new(package, media) +``` + +Return new `MediaPart` instance containing `media`. + +`media` must be a `Media` object. + +### `sha1` + +```python +sha1() +``` + +The SHA1 hash digest for the media binary of this media part. + +Example: `'1be010ea47803b00e140b852765cdf84f491da47'` + + + + + +# `pptx.parts.presentation` + +Presentation part, the main part in a .pptx package. + +## `PresentationPart` + +Bases: `XmlPart` + +Top level class in object model. + +Represents the contents of the /ppt directory of a .pptx file. + +### `add_slide` + +```python +add_slide(slide_layout: SlideLayout) +``` + +Return (rId, slide) pair of a newly created blank slide. + +New slide inherits appearance from `slide_layout`. + +### `core_properties` + +```python +core_properties: CorePropertiesPart +``` + +A `CoreProperties` object for the presentation. + +Provides read/write access to the Dublin Core properties of this presentation. + +### `get_slide` + +```python +get_slide(slide_id: int) -> Slide | None +``` + +Return optional related `Slide` object identified by `slide_id`. + +Returns `None` if no slide with `slide_id` is related to this presentation. + +### `notes_master` + +```python +notes_master() -> NotesMaster +``` + +Return the `NotesMaster` object for this presentation. If the +presentation does not have a notes master, one is created from +a default template. The same single instance is returned on each +call. + +### `notes_master_part` + +```python +notes_master_part() -> NotesMasterPart +``` + +Return the `NotesMasterPart` object for this presentation. + +If the presentation does not have a notes master, one is created from a default template. +The same single instance is returned on each call. + +### `presentation` + +```python +presentation() +``` + +A `Presentation` object providing access to the content of this +presentation. + +### `related_slide` + +```python +related_slide(rId: str) -> Slide +``` + +Return `Slide` object for related `SlidePart` related by `rId`. + +### `related_slide_master` + +```python +related_slide_master(rId: str) -> SlideMaster +``` + +Return `SlideMaster` object for `SlideMasterPart` related by `rId`. + +### `rename_slide_parts` + +```python +rename_slide_parts(rIds: Iterable[str]) +``` + +Assign incrementing partnames to the slide parts identified by `rIds`. + +Partnames are like `/ppt/slides/slide9.xml` and are assigned in the order their id appears +in the `rIds` sequence. The name portion is always `slide`. The number part forms a +continuous sequence starting at 1 (e.g. 1, 2, ... 10, ...). The extension is always +`.xml`. + +### `save` + +```python +save(path_or_stream: str | IO[bytes]) +``` + +Save this presentation package to `path_or_stream`. + +`path_or_stream` can be either a path to a filesystem location (a string) or a +file-like object. A pass-through; `pptx.opc.package.OpcPackage.save` carries +the write contract. + +### `slide_id` + +```python +slide_id(slide_part) +``` + +Return the slide-id associated with `slide_part`. + + + + + +# `pptx.parts.slide` + +Slide and related objects. + +## `BaseSlidePart` + +Bases: `XmlPart` + +Base class for slide parts. + +This includes slide, slide-layout, and slide-master parts, but also notes-slide, +notes-master, and handout-master parts. + +### `get_image` + +```python +get_image(rId: str) -> Image +``` + +Return an `Image` object containing the image related to this slide by *rId*. + +Raises `KeyError` if no image is related by that id, which would generally indicate a +corrupted .pptx file. + +### `get_or_add_image_part` + +```python +get_or_add_image_part(image_file: str | IO[bytes]) +``` + +Return `(image_part, rId)` pair corresponding to `image_file`. + +The returned `ImagePart` object contains the image in `image_file` and is +related to this slide with the key `rId`. If either the image part or +relationship already exists, they are reused, otherwise they are newly created. + +### `name` + +```python +name: str +``` + +Internal name of this slide. + +## `NotesMasterPart` + +Bases: `BaseSlidePart` + +Notes master part. + +Corresponds to package file `ppt/notesMasters/notesMaster1.xml`. + +### `create_default` + +```python +create_default(package) +``` + +Create and return a default notes master part, including creating the +new theme it requires. + +### `notes_master` + +```python +notes_master() +``` + +Return the `NotesMaster` object that proxies this notes master part. + +## `NotesSlidePart` + +Bases: `BaseSlidePart` + +Notes slide part. + +Contains the slide notes content and the layout for the slide handout page. +Corresponds to package file `ppt/notesSlides/notesSlide[1-9][0-9]*.xml`. + +### `new` + +```python +new(package, slide_part) +``` + +Return new `NotesSlidePart` for the slide in `slide_part`. + +The new notes-slide part is based on the (singleton) notes master and related to +both the notes-master part and `slide_part`. If no notes-master is present, +one is created based on the default template. + +### `notes_master` + +```python +notes_master() +``` + +Return the `NotesMaster` object this notes slide inherits from. + +### `notes_slide` + +```python +notes_slide() +``` + +Return the `NotesSlide` object that proxies this notes slide part. + +## `SlideLayoutPart` + +Bases: `BaseSlidePart` + +Slide layout part. + +Corresponds to package files ``ppt/slideLayouts/slideLayout[1-9][0-9]*.xml``. + +### `slide_layout` + +```python +slide_layout() +``` + +The `SlideLayout` object representing this part. + +### `slide_master` + +```python +slide_master: SlideMaster +``` + +Slide master from which this slide layout inherits properties. + +## `SlideMasterPart` + +Bases: `BaseSlidePart` + +Slide master part. + +Corresponds to package files ppt/slideMasters/slideMaster[1-9][0-9]*.xml. + +### `related_slide_layout` + +```python +related_slide_layout(rId: str) -> SlideLayout +``` + +Return `SlideLayout` related to this slide-master by key `rId`. + +### `slide_master` + +```python +slide_master() +``` + +The `SlideMaster` object representing this part. + +## `SlidePart` + +Bases: `BaseSlidePart` + +Slide part. Corresponds to package files ppt/slides/slide[1-9][0-9]*.xml. + +### `add_chart_part` + +```python +add_chart_part(chart_type: XL_CHART_TYPE, chart_data: ChartData) +``` + +Return str rId of new `ChartPart` object containing chart of `chart_type`. + +The chart depicts `chart_data` and is related to the slide contained in this +part by `rId`. + +### `add_embedded_ole_object_part` + +```python +add_embedded_ole_object_part(prog_id: PROG_ID | str, ole_object_file: str | IO[bytes]) +``` + +Return rId of newly-added OLE-object part formed from `ole_object_file`. + +### `get_or_add_video_media_part` + +```python +get_or_add_video_media_part(video: Video) -> tuple[str, str] +``` + +Return rIds for media and video relationships to media part. + +A new `MediaPart` object is created if it does not already exist +(such as would occur if the same video appeared more than once in + a presentation). Two relationships to the media part are created, +one each with MEDIA and VIDEO relationship types. The need for two +appears to be for legacy support for an earlier (pre-Office 2010) +PowerPoint media embedding strategy. + +### `has_notes_slide` + +```python +has_notes_slide +``` + +Return True if this slide has a notes slide, False otherwise. A notes +slide is created by the `notes_slide` property when one doesn't +exist; use this property to test for a notes slide without the +possible side-effect of creating one. + +### `new` + +```python +new(partname, package, slide_layout_part) +``` + +Return newly-created blank slide part. + +The new slide-part has `partname` and a relationship to `slide_layout_part`. + +### `notes_slide` + +```python +notes_slide() -> NotesSlide +``` + +The `NotesSlide` instance associated with this slide. + +If the slide does not have a notes slide, a new one is created. The same single instance +is returned on each call. + +### `slide` + +```python +slide() +``` + +The `Slide` object representing this slide part. + +### `slide_id` + +```python +slide_id: int +``` + +Return the slide identifier stored in the presentation part for this slide part. + +### `slide_layout` + +```python +slide_layout: SlideLayout +``` + +`SlideLayout` object the slide in this part inherits appearance from. + + + + + +# `pptx.presentation` + +Main presentation object. + +## `Presentation` + +Bases: `PartElementProxy` + +PresentationML (PML) presentation. + +Not intended to be constructed directly. Use `pptx.Presentation` to open or +create a presentation. + +### `append_deck` + +```python +append_deck(source_prs: 'Presentation', *, mode: str, notes: bool = True) -> 'tuple[ImportReport, ...]' +``` + +Import every slide of `source_prs`, in order, at the end of this deck. + +paper-pptx addition, built on `import_slide` — same `mode` +semantics and refusal ledger. The COMPLETE source deck validates before the first +write: a refusal on any source slide leaves this presentation untouched. Source +sections are not copied (this deck's section structure governs — declared). + +### `apply_footers` + +```python +apply_footers(*, footer: str | None = None, slide_number: bool = False, date_format: str | None = None, fixed_date: str | None = None, skip_title_slides: bool = False, now: 'datetime | None' = None) -> None +``` + +Apply the complete footer state to every slide ("Apply to All"). + +paper-pptx addition. Persists exactly what PowerPoint's +Insert > Header & Footer dialog does: materializes minimal `dt`/`ftr`/`sldNum` +placeholder shapes per slide (binding to the layout furniture by `idx`), writes +slide numbers and automatic dates as real `a:fld` elements whose cached text +consumers refresh on open, and *removes* the placeholders for unchecked elements — +each call sets the full three-element state, like the dialog. + +`footer`: literal footer text, or None to remove the footer placeholder. +`slide_number`: True writes a `slidenum` field cached with the current position +(honoring `firstSlideNum`); consumers renumber live after any reorder. +`date_format`: a `datetime`..`datetime13` token for an automatically-updating date +field; `fixed_date`: literal date text (the dialog's "Fixed" mode); passing both +raises `ValueError`. `now` seeds the date field's cached text (None = wall clock); +the package never vouches for cached values — they are consumer-refreshed hints. +`skip_title_slides`: the dialog's "Don't show on title slide" — slides on a +`type="title"` layout get the all-removed state. + +Refuses atomically (`UnsupportedStructureError`, validated deck-wide before the +first write) when a wanted element has no layout furniture to inherit from, or +when explicit `p:hf` flags on a layout/master disable it (clear those via +`header_footers` first — this API never flips them silently). + +### `batch` + +```python +batch() -> 'Iterator[Presentation]' +``` + +Validate this deck once at block exit instead of once per mutating call. + +paper-pptx addition. Opt-in; per-edit validation stays the default. + + with prs.batch(): + for slide in prs.slides: + slide.shapes[0].text_frame.text = "..." + +Paper's own mutating APIs each run a package transaction that serializes and +reopens the whole deck before committing. Inside this block those transactions +nest, and only the outermost validates — one whole-deck check per block rather +than one per call. Measured 2.8-3.0x on 25-200 slide decks. + +**It also validates operations that had no validation at all.** The mutation +surface inherited from python-pptx — `text_frame.text`, `add_textbox`, +`add_picture`, `Slides.add_slide` and the rest — runs no transaction of its +own. Inside a block the enclosing transaction covers them, so a sequence that +previously succeeded and saved an unreadable deck now refuses. That is the +intended improvement, not a regression, but it does mean working code can start +refusing once wrapped. + +Costs and limits, all of which argue for scoping a block to a unit of work you +would be willing to redo: + +- **Entry is not free.** Block entry snapshots every reachable part. An empty + block costs about what one unbatched edit costs, so a block around a single + edit breaks even and the gain starts at two. +- **Rollback granularity is the block.** A refusal discards *every* edit in it, + not just the offending one. +- **Only the end state is checked.** A deck that is momentarily invalid inside the + block but valid at exit commits normally. +- **Saving inside a block is refused** (`BoundaryViolationError`), because the + package has not been validated yet and the edits may still roll back. Save after + the block closes. +- **Blocks on two different decks must exit in reverse order** of entry, or + ``RuntimeError``. +- **Digitally signed decks refuse at block entry**, before any edit runs. +- `import_slide` and `append_deck` return their report before the + import has been proven reopenable; that proof moves to block exit. + +An exception raised by the caller inside the block rolls the package back and +propagates unchanged. + +### `core_properties` + +```python +core_properties +``` + +`CoreProperties` instance for this presentation. + +Provides read/write access to the Dublin Core document properties for the presentation. + +### `import_slide` + +```python +import_slide(source_prs: 'Presentation', slide: 'Presentation', *, mode: str, position: int | None = None, notes: bool = True, section: str | None = None, section_id: str | None = None, target_layout: str | None = None, placeholder_map: str | None = 'auto') -> 'ImportReport' +``` + +Import `slide` from `source_prs` into this presentation; return the report. + +paper-pptx addition. `mode` is required — there is no right +default, the caller chooses consciously: + +- `"adopt_theme"`: content transplants and rebinds to a destination layout + (auto only on a unique exact layout name, then a unique exact non-custom layout + type; `target_layout` overrides; orphan placeholders bake from their + source-resolved look). The slide takes the house style; every run whose + resolved values changed is in `run_shifts`. +- `"keep_appearance"`: the source layout+master+theme chain transplants, + fingerprint-deduplicated (ten slides from one source share one master). +- `"bake"`: resolvable effective values become explicit local properties, + furniture placeholders (dt/ftr/sldNum) drop, remaining placeholders become + free shapes, and the slide attaches to a destination layout selected by the + same unique name/type tiers, then a unique blank-layout fallback. It never + falls back to the first layout. Stable look without importing masters. + +The source presentation is never mutated. Media always copies (never shared +across packages); charts deep-copy with workbooks; SmartArt carries opaquely; +comments drop (reported); OLE objects, controls, internal slide links, and +unknown relationship types refuse (`RelationshipPolicyError`) before any write. +`notes` copies the speaker-notes part re-linked to this deck's notes master. +`section` selects an existing destination section by unique exact name; +`section_id` selects by exact stored GUID when names collide. They are mutually +exclusive. With neither selector, enrollment remains adjacent to the insertion +point when this deck has sections. Missing selectors raise +`TargetNotFoundError` and duplicate matches raise `AmbiguousTargetError` before +any write. +Multiple candidates at any automatic layout tier raise `AmbiguousTargetError` +before any write and list the layouts; pass an enrolled destination +`target_layout` to resolve that choice explicitly. +Adopt-theme placeholder reconciliation first preserves exact type+idx matches, +then accepts same-type or compatible-family fallbacks only when unique. Pass a +partial `placeholder_map={source_idx: target_idx | None}` to resolve ambiguity; +`None` deliberately orphans and bakes that source placeholder. The argument does +not apply to keep-appearance or bake imports. Whole-deck append remains automatic-only. + +### `notes_master` + +```python +notes_master: NotesMaster +``` + +Instance of `NotesMaster` for this presentation. + +If the presentation does not have a notes master, one is created from a default template +and returned. The same single instance is returned on each call. + +### `part` + +```python +part: PresentationPart +``` + +### `save` + +```python +save(file: str | IO[bytes]) +``` + +Writes this presentation to `file`. + +`file` can be either a file-path or a file-like object open for writing bytes. + +A file-path destination is written atomically, resolving symlinks, so a failure part-way +through leaves any existing file untouched. A file-like destination is written straight +through once the whole package has serialized successfully. See +`pptx.opc.package.OpcPackage.save` for what atomic replacement costs. + +`pptx.package.patch_save` is the narrow-save alternative: atomic too, and it restores +the original bytes of every part that did not change. Its no-op round trip is byte-identical +only for a package paper-pptx wrote; see that function for why. + +Refuses with `BoundaryViolationError` while a `batch` block is open on this package: +those edits have not been validated yet and may still roll back, so writing them out would +publish a package the block is not prepared to stand behind. Save once the block has closed. + +### `slide_height` + +```python +slide_height: Length | None +``` + +Height of slides in this presentation, in English Metric Units (EMU). + +Returns `None` if no slide width is defined. Read/write. + +### `slide_layouts` + +```python +slide_layouts: SlideLayouts +``` + +`SlideLayouts` collection belonging to the first `SlideMaster` of this presentation. + +A presentation can have more than one slide master and each master will have its own set +of layouts. This property is a convenience for the common case where the presentation has +only a single slide master. + +### `slide_master` + +```python +slide_master +``` + +First `SlideMaster` object belonging to this presentation. Typically, +presentations have only a single slide master. This property provides +simpler access in that common case. + +### `slide_masters` + +```python +slide_masters() -> SlideMasters +``` + +`SlideMasters` collection of slide-masters belonging to this presentation. + +### `slide_width` + +```python +slide_width +``` + +Width of slides in this presentation, in English Metric Units (EMU). +Returns `None` if no slide width is defined. Read/write. + +### `slides` + +```python +slides() +``` + +`Slides` object containing the slides in this presentation. + + + + + +# `pptx.rebind` + +Layout rebind - the template-migration primitive (paper-pptx addition). + +## `RebindReport` + +```python +RebindReport(source_layout: str, source_layout_name: str, target_layout: str, target_layout_name: str, placeholder_map_used: Tuple[Tuple[int, Optional[int]], ...], baked_orphans: Tuple[str, ...], run_shifts: Tuple[RunShift, ...]) -> None +``` + +What one rebind did: the mapping used, orphan handling, and every resolution shift. + +Fields: + +* ``source_layout`` / ``source_layout_name`` -- partname and display name of the + layout the slide was bound to before. +* ``target_layout`` / ``target_layout_name`` -- partname and display name of the + layout the slide is bound to after. +* ``placeholder_map_used`` -- the resolved ``(source_idx, target_idx)`` pairs; a + ``target_idx`` of ``None`` marks a source placeholder that was orphaned. +* ``baked_orphans`` -- names of orphan placeholders converted to free shapes (only + populated under ``orphan_policy="bake"``). +* ``run_shifts`` -- one `RunShift` for every run whose resolved effective + values changed; empty when the rebind preserved appearance exactly. + +### `baked_orphans` + +```python +baked_orphans: Tuple[str, ...] +``` + +### `placeholder_map_used` + +```python +placeholder_map_used: Tuple[Tuple[int, Optional[int]], ...] +``` + +### `run_shifts` + +```python +run_shifts: Tuple[RunShift, ...] +``` + +### `source_layout` + +```python +source_layout: str +``` + +### `source_layout_name` + +```python +source_layout_name: str +``` + +### `target_layout` + +```python +target_layout: str +``` + +### `target_layout_name` + +```python +target_layout_name: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return the rebind report as a JSON-ready dict stamped with its schema and version. + +## `RunShift` + +```python +RunShift(part: str, shape_id: int, block_ordinal: int, run_index: int, text: str, before: dict, after: dict) -> None +``` + +One run whose resolved effective values changed across the rebind. + +Runs are identified by (shape_id, block_ordinal-within-shape, run_index) - a STABLE +key that survives shapes being added or removed elsewhere on the slide. Keying by +the slide-global block index would pair unrelated runs the moment any earlier shape +disappears. + +Fields: + +* ``part`` -- partname of the slide the run lives on. +* ``shape_id`` -- id of the shape containing the run. +* ``block_ordinal`` -- 0-based paragraph-block index within that shape. +* ``run_index`` -- 0-based run index within the block. +* ``text`` -- the run's text (for human legibility of the shift). +* ``before`` / ``after`` -- the run's resolved effective-font payload + (``EffectiveFont.to_dict()``) before and after the rebind. + +### `after` + +```python +after: dict +``` + +### `before` + +```python +before: dict +``` + +### `block_ordinal` + +```python +block_ordinal: int +``` + +### `part` + +```python +part: str +``` + +### `run_index` + +```python +run_index: int +``` + +### `shape_id` + +```python +shape_id: int +``` + +### `text` + +```python +text: str +``` + +### `to_dict` + +```python +to_dict() -> dict +``` + +Return this run change as a JSON-ready dict. + +## `SCHEMA_NAME` + +```python +SCHEMA_NAME = 'paper-rebind-report' +``` + +## `SCHEMA_VERSION` + +```python +SCHEMA_VERSION = 1 +``` + +## `rebind_layout` + +```python +rebind_layout(slide: 'Slide', target_layout: 'SlideLayout', *, placeholder_map: 'SlideLayout' = 'auto', orphan_policy: str = 'refuse') -> RebindReport +``` + +Rebind `slide` to `target_layout`; return the required shift report. + + + + + +# `pptx.shapes.autoshape` + +Autoshape-related objects such as Shape and Adjustment. + +## `Adjustment` + +```python +Adjustment(name: str, def_val: int, actual: int | None = None) +``` + +An adjustment value for an autoshape. + +An adjustment value corresponds to the position of an adjustment handle on an auto shape. +Adjustment handles are the small yellow diamond-shaped handles that appear on certain auto +shapes and allow the outline of the shape to be adjusted. For example, a rounded rectangle has +an adjustment handle that allows the radius of its corner rounding to be adjusted. + +Values are `float` and generally range from 0.0 to 1.0, although the value can be negative or +greater than 1.0 in certain circumstances. + +### `actual` + +```python +actual = actual +``` + +### `def_val` + +```python +def_val = def_val +``` + +### `effective_value` + +```python +effective_value: float +``` + +Read/write `float` representing normalized adjustment value for this adjustment. + +Actual values are a large-ish integer expressed in shape coordinates, nominally between 0 +and 100,000. The effective value is normalized to a corresponding value nominally between +0.0 and 1.0. Intuitively this represents the proportion of the width or height of the shape +at which the adjustment value is located from its starting point. For simple shapes such as +a rounded rectangle, this intuitive correspondence holds. For more complicated shapes and +at more extreme shape proportions (e.g. width is much greater than height), the value can +become negative or greater than 1.0. + +### `name` + +```python +name = name +``` + +### `val` + +```python +val: int +``` + +Denormalized effective value. + +Expressed in shape coordinates, this is suitable for using in the XML. + +## `AdjustmentCollection` + +```python +AdjustmentCollection(prstGeom: CT_PresetGeometry2D) +``` + +Sequence of `Adjustment` instances for an auto shape. + +Each represents an available adjustment for a shape of its type. Supports `len()` and indexed +access, e.g. `shape.adjustments[1] = 0.15`. + +## `AutoShapeType` + +```python +AutoShapeType(autoshape_type_id: MSO_AUTO_SHAPE_TYPE) +``` + +Provides access to metadata for an auto-shape of type identified by `autoshape_type_id`. + +Instances are cached, so no more than one instance for a particular auto shape type is in +memory. + +Instances provide the following attributes: + +.. attribute:: autoshape_type_id + + Integer uniquely identifying this auto shape type. Corresponds to a + value in `pptx.constants.MSO` like `MSO_SHAPE.ROUNDED_RECTANGLE`. + +.. attribute:: basename + + Base part of shape name for auto shapes of this type, e.g. `Rounded + Rectangle` becomes `Rounded Rectangle 99` when the distinguishing + integer is added to the shape name. + +.. attribute:: prst + + String identifier for this auto shape type used in the `a:prstGeom` + element. + +Initialize attributes from constant values in `pptx.spec`. + +### `autoshape_type_id` + +```python +autoshape_type_id: MSO_AUTO_SHAPE_TYPE +``` + +MSO_AUTO_SHAPE_TYPE enumeration member identifying this auto shape type. + +### `basename` + +```python +basename: str +``` + +Base of shape name for this auto shape type. + +A shape name is like "Rounded Rectangle 7" and appears as an XML attribute for example at +`p:sp/p:nvSpPr/p:cNvPr{name}`. This basename value is the name less the distinguishing +integer. This value is escaped because at least one autoshape-type name includes double +quotes ('"No" Symbol'). + +### `default_adjustment_values` + +```python +default_adjustment_values(prst: MSO_AUTO_SHAPE_TYPE) -> tuple[AdjustmentValue, ...] +``` + +Sequence of (name, value) pair adjustment value defaults for `prst` autoshape-type. + +### `id_from_prst` + +```python +id_from_prst(prst: str) -> MSO_AUTO_SHAPE_TYPE +``` + +Select auto shape type with matching `prst`. + +e.g. `MSO_SHAPE.RECTANGLE` corresponding to preset geometry keyword `"rect"`. + +### `prst` + +```python +prst +``` + +Preset geometry identifier string for this auto shape. Used in the +`prst` attribute of `a:prstGeom` element to specify the geometry +to be used in rendering the shape, for example `'roundRect'`. + +## `Shape` + +```python +Shape(sp: CT_Shape, parent: ProvidesPart) +``` + +Bases: `BaseShape` + +A shape that can appear on a slide. + +Corresponds to the `p:sp` element that can appear in any of the slide-type parts +(slide, slideLayout, slideMaster, notesPage, notesMaster, handoutMaster). + +### `adjustments` + +```python +adjustments() -> AdjustmentCollection +``` + +Read-only reference to `AdjustmentCollection` instance for this shape. + +### `auto_shape_type` + +```python +auto_shape_type +``` + +Enumeration value identifying the type of this auto shape. + +Like `MSO_SHAPE.ROUNDED_RECTANGLE`. Raises `ValueError` if this shape is not an auto shape. + +### `fill` + +```python +fill() +``` + +`FillFormat` instance for this shape. + +Provides access to fill properties such as fill color. + +### `get_or_add_ln` + +```python +get_or_add_ln() +``` + +Return the `a:ln` element containing the line format properties XML for this shape. + +### `has_text_frame` + +```python +has_text_frame: bool +``` + +`True` if this shape can contain text. Always `True` for an AutoShape. + +### `line` + +```python +line() +``` + +`LineFormat` instance for this shape. + +Provides access to line properties such as line color. + +### `ln` + +```python +ln +``` + +The `a:ln` element containing the line format properties such as line color and width. + +`None` if no `a:ln` element is present. + +### `shape_type` + +```python +shape_type: MSO_SHAPE_TYPE +``` + +Unique integer identifying the type of this shape, like `MSO_SHAPE_TYPE.TEXT_BOX`. + +### `text` + +```python +text: str +``` + +Read/write. Text in shape as a single string. + +The returned string will contain a newline character (`"\n"`) separating each paragraph +and a vertical-tab (`"\v"`) character for each line break (soft carriage return) in the +shape's text. + +Assignment to `text` replaces any text previously contained in the shape, along with any +paragraph or font formatting applied to it. A newline character (`"\n"`) in the assigned +text causes a new paragraph to be started. A vertical-tab (`"\v"`) character in the +assigned text causes a line-break (soft carriage-return) to be inserted. (The vertical-tab +character appears in clipboard text copied from PowerPoint as its str encoding of +line-breaks.) + +### `text_frame` + +```python +text_frame +``` + +`TextFrame` instance for this shape. + +Contains the text of the shape and provides access to text formatting properties. + + + + + +# `pptx.shapes.base` + +Base shape-related objects such as BaseShape. + +## `BaseShape` + +```python +BaseShape(shape_elm: ShapeElement, parent: ProvidesPart) +``` + +Bases: `object` + +Base class for shape objects. + +Subclasses include `Shape`, `Picture`, and `GraphicFrame`. + +### `click_action` + +```python +click_action() -> ActionSetting +``` + +`ActionSetting` instance providing access to click behaviors. + +Click behaviors are hyperlink-like behaviors including jumping to a hyperlink (web page) +or to another slide in the presentation. The click action is that defined on the overall +shape, not a run of text within the shape. An `ActionSetting` object is always returned, +even when no click behavior is defined on the shape. + +### `element` + +```python +element: ShapeElement +``` + +`lxml` element for this shape, e.g. a CT_Shape instance. + +Note that manipulating this element improperly can produce an invalid presentation file. +Make sure you know what you're doing if you use this to change the underlying XML. + +### `has_chart` + +```python +has_chart: bool +``` + +`True` if this shape is a graphic frame containing a chart object. + +`False` otherwise. When `True`, the chart object can be accessed using the ``.chart`` +property. + +### `has_table` + +```python +has_table: bool +``` + +`True` if this shape is a graphic frame containing a table object. + +`False` otherwise. When `True`, the table object can be accessed using the ``.table`` +property. + +### `has_text_frame` + +```python +has_text_frame: bool +``` + +`True` if this shape can contain text. + +### `height` + +```python +height: Length +``` + +Read/write. Integer distance between top and bottom extents of shape in EMUs. + +### `is_placeholder` + +```python +is_placeholder: bool +``` + +True if this shape is a placeholder. + +A shape is a placeholder if it has a element. + +### `left` + +```python +left: Length +``` + +Integer distance of the left edge of this shape from the left edge of the slide. + +Read/write. Expressed in English Metric Units (EMU) + +### `name` + +```python +name: str +``` + +Name of this shape, e.g. 'Picture 7'. + +### `part` + +```python +part: BaseSlidePart +``` + +The package part containing this shape. + +A `BaseSlidePart` subclass in this case. Access to a slide part should only be required if +you are extending the behavior of `pp` API objects. + +### `placeholder_format` + +```python +placeholder_format: _PlaceholderFormat +``` + +Provides access to placeholder-specific properties such as placeholder type. + +Raises `ValueError` on access if the shape is not a placeholder. + +### `rotation` + +```python +rotation: float +``` + +Degrees of clockwise rotation. + +Read/write float. Negative values can be assigned to indicate counter-clockwise rotation, +e.g. assigning -45.0 will change setting to 315.0. + +### `shadow` + +```python +shadow() -> ShadowFormat +``` + +`ShadowFormat` object providing access to shadow for this shape. + +A `ShadowFormat` object is always returned, even when no shadow is +explicitly defined on this shape (i.e. it inherits its shadow +behavior). + +### `shape_id` + +```python +shape_id: int +``` + +Read-only positive integer identifying this shape. + +The id of a shape is unique among all shapes on a slide. + +### `shape_type` + +```python +shape_type: MSO_SHAPE_TYPE +``` + +A member of MSO_SHAPE_TYPE classifying this shape by type. + +Like ``MSO_SHAPE_TYPE.CHART``. Must be implemented by subclasses. + +### `top` + +```python +top: Length +``` + +Distance from the top edge of the slide to the top edge of this shape. + +Read/write. Expressed in English Metric Units (EMU) + +### `width` + +```python +width: Length +``` + +Distance between left and right extents of this shape. + +Read/write. Expressed in English Metric Units (EMU). + + + + + +# `pptx.shapes.connector` + +Connector (line) shape and related objects. + +## `Connector` + +Bases: `BaseShape` + +Connector (line) shape. + +A connector is a linear shape having end-points that can be connected to +other objects (but not to other connectors). A connector can be straight, +have elbows, or can be curved. + +### `begin_connect` + +```python +begin_connect(shape, cxn_pt_idx) +``` + +**EXPERIMENTAL** - *The current implementation only works properly +with rectangular shapes, such as pictures and rectangles. Use with +other shape types may cause unexpected visual alignment of the +connected end-point and could lead to a load error if cxn_pt_idx +exceeds the connection point count available on the connected shape. +That said, a quick test should reveal what to expect when using this +method with other shape types.* + +Connect the beginning of this connector to *shape* at the connection +point specified by *cxn_pt_idx*. Each shape has zero or more +connection points and they are identified by index, starting with 0. +Generally, the first connection point of a shape is at the top center +of its bounding box and numbering proceeds counter-clockwise from +there. However this is only a convention and may vary, especially +with non built-in shapes. + +### `begin_x` + +```python +begin_x +``` + +Return the X-position of the begin point of this connector, in +English Metric Units (as a `Length` object). + +### `begin_y` + +```python +begin_y +``` + +Return the Y-position of the begin point of this connector, in +English Metric Units (as a `Length` object). + +### `end_connect` + +```python +end_connect(shape, cxn_pt_idx) +``` + +**EXPERIMENTAL** - *The current implementation only works properly +with rectangular shapes, such as pictures and rectangles. Use with +other shape types may cause unexpected visual alignment of the +connected end-point and could lead to a load error if cxn_pt_idx +exceeds the connection point count available on the connected shape. +That said, a quick test should reveal what to expect when using this +method with other shape types.* + +Connect the ending of this connector to *shape* at the connection +point specified by *cxn_pt_idx*. + +### `end_x` + +```python +end_x +``` + +Return the X-position of the end point of this connector, in English +Metric Units (as a `Length` object). + +### `end_y` + +```python +end_y +``` + +Return the Y-position of the end point of this connector, in English +Metric Units (as a `Length` object). + +### `get_or_add_ln` + +```python +get_or_add_ln() +``` + +Helper method required by `LineFormat`. + +### `line` + +```python +line() +``` + +`LineFormat` instance for this connector. + +Provides access to line properties such as line color, width, and +line style. + +### `ln` + +```python +ln +``` + +Helper method required by `LineFormat`. + +The ```` element containing the line format properties such as +line color and width. `None` if no `` element is present. + +### `shape_type` + +```python +shape_type +``` + +Member of `MSO_SHAPE_TYPE` identifying the type of this shape. + +Unconditionally `MSO_SHAPE_TYPE.LINE` for a `Connector` object. + + + + + +# `pptx.shapes.freeform` + +Objects related to construction of freeform shapes. + +## `CT_DrawingOperation` + +```python +CT_DrawingOperation: TypeAlias = 'CT_Path2DClose | CT_Path2DLineTo | CT_Path2DMoveTo' +``` + +## `DrawingOperation` + +```python +DrawingOperation: TypeAlias = '_LineSegment | _MoveTo | _Close' +``` + +## `FreeformBuilder` + +```python +FreeformBuilder(shapes: _BaseGroupShapes, start_x: Length, start_y: Length, x_scale: float, y_scale: float) +``` + +Bases: `Sequence[DrawingOperation]` + +Allows a freeform shape to be specified and created. + +The initial pen position is provided on construction. From there, drawing proceeds using +successive calls to draw line segments. The freeform shape may be closed by calling the +`close` method. + +A shape may have more than one contour, in which case overlapping areas are "subtracted". A +contour is a sequence of line segments beginning with a "move-to" operation. A move-to +operation is automatically inserted in each new freeform; additional move-to ops can be +inserted with the `.move_to()` method. + +### `add_line_segments` + +```python +add_line_segments(vertices: Iterable[tuple[float, float]], close: bool = True) +``` + +Add a straight line segment to each point in `vertices`. + +`vertices` must be an iterable of (x, y) pairs (2-tuples). Each x and y value is rounded +to the nearest integer before use. The optional `close` parameter determines whether the +resulting contour is `closed` or left `open`. + +Returns this `FreeformBuilder` object so it can be used in chained calls. + +### `convert_to_shape` + +```python +convert_to_shape(origin_x: Length = Emu(0), origin_y: Length = Emu(0)) +``` + +Return new freeform shape positioned relative to specified offset. + +`origin_x` and `origin_y` locate the origin of the local coordinate system in slide +coordinates (EMU), perhaps most conveniently by use of a `Length` object. + +Note that this method may be called more than once to add multiple shapes of the same +geometry in different locations on the slide. + +### `move_to` + +```python +move_to(x: float, y: float) +``` + +Move pen to (x, y) (local coordinates) without drawing line. + +Returns this `FreeformBuilder` object so it can be used in chained calls. + +### `new` + +```python +new(shapes: _BaseGroupShapes, start_x: float, start_y: float, x_scale: float, y_scale: float) +``` + +Return a new `FreeformBuilder` object. + +The initial pen location is specified (in local coordinates) by +(`start_x`, `start_y`). + +### `shape_offset_x` + +```python +shape_offset_x: Length +``` + +Return x distance of shape origin from local coordinate origin. + +The returned integer represents the leftmost extent of the freeform shape, in local +coordinates. Note that the bounding box of the shape need not start at the local origin. + +### `shape_offset_y` + +```python +shape_offset_y: Length +``` + +Return y distance of shape origin from local coordinate origin. + +The returned integer represents the topmost extent of the freeform shape, in local +coordinates. Note that the bounding box of the shape need not start at the local origin. + + + + + +# `pptx.shapes.graphfrm` + +Graphic Frame shape and related objects. + +## `GraphicFrame` + +```python +GraphicFrame(graphicFrame: CT_GraphicalObjectFrame, parent: ProvidesPart) +``` + +Bases: `BaseShape` + +Container shape for table, chart, smart art, and media objects. + +Corresponds to a `p:graphicFrame` element in the shape tree. + +### `chart` + +```python +chart: Chart +``` + +The `Chart` object containing the chart in this graphic frame. + +Raises `ValueError` if this graphic frame does not contain a chart. + +### `chart_part` + +```python +chart_part: ChartPart +``` + +The `ChartPart` object containing the chart in this graphic frame. + +### `has_chart` + +```python +has_chart: bool +``` + +`True` if this graphic frame contains a chart object. `False` otherwise. + +When `True`, the chart object can be accessed using the `.chart` property. + +### `has_table` + +```python +has_table: bool +``` + +`True` if this graphic frame contains a table object, `False` otherwise. + +When `True`, the table object can be accessed using the `.table` property. + +### `ole_format` + +```python +ole_format: _OleFormat +``` + +_OleFormat object for this graphic-frame shape. + +Raises `ValueError` on a GraphicFrame instance that does not contain an OLE object. + +An shape that contains an OLE object will have `.shape_type` of either +`EMBEDDED_OLE_OBJECT` or `LINKED_OLE_OBJECT`. + +### `shadow` + +```python +shadow() -> ShadowFormat +``` + +Unconditionally raises `NotImplementedError`. + +Access to the shadow effect for graphic-frame objects is content-specific (i.e. different +for charts, tables, etc.) and has not yet been implemented. + +### `shape_type` + +```python +shape_type: MSO_SHAPE_TYPE +``` + +Optional member of `MSO_SHAPE_TYPE` identifying the type of this shape. + +Possible values are `MSO_SHAPE_TYPE.CHART`, `MSO_SHAPE_TYPE.TABLE`, +`MSO_SHAPE_TYPE.EMBEDDED_OLE_OBJECT`, `MSO_SHAPE_TYPE.LINKED_OLE_OBJECT`. + +This value is `None` when none of these four types apply, for example when the shape +contains SmartArt. + +### `table` + +```python +table: Table +``` + +The `Table` object contained in this graphic frame. + +Raises `ValueError` if this graphic frame does not contain a table. + + + + + +# `pptx.shapes.group` + +GroupShape and related objects. + +## `GroupShape` + +```python +GroupShape(grpSp: CT_GroupShape, parent: ProvidesPart) +``` + +Bases: `BaseShape` + +A shape that acts as a container for other shapes. + +### `click_action` + +```python +click_action() -> ActionSetting +``` + +Unconditionally raises `TypeError`. + +A group shape cannot have a click action or hover action. + +### `has_text_frame` + +```python +has_text_frame: bool +``` + +Unconditionally `False`. + +A group shape does not have a textframe and cannot itself contain text. This does not +impact the ability of shapes contained by the group to each have their own text. + +### `shadow` + +```python +shadow() -> ShadowFormat +``` + +`ShadowFormat` object representing shadow effect for this group. + +A `ShadowFormat` object is always returned, even when no shadow is explicitly defined on +this group shape (i.e. when the group inherits its shadow behavior). + +### `shape_type` + +```python +shape_type: MSO_SHAPE_TYPE +``` + +Member of `MsoShapeType` identifying the type of this shape. + +Unconditionally `MSO_SHAPE_TYPE.GROUP` in this case + +### `shapes` + +```python +shapes() -> GroupShapes +``` + +`GroupShapes` object for this group. + +The `GroupShapes` object provides access to the group's member shapes and provides methods +for adding new ones. + + + + + +# `pptx.shapes` + +Objects used across sub-package. + +## `Subshape` + +```python +Subshape(parent: ProvidesPart) +``` + +Bases: `object` + +Provides access to the containing part for drawing elements that occur below a shape. + +Access to the part is required for example to add or drop a relationship. Provides +`self._parent` attribute to subclasses. + +### `part` + +```python +part: XmlPart +``` + +The package part containing this object. + + + + + +# `pptx.shapes.picture` + +Shapes based on the `p:pic` element, including Picture and Movie. + +## `Movie` + +Bases: `_BasePicture` + +A movie shape, one that places a video on a slide. + +Like `Picture`, a movie shape is based on the `p:pic` element. A movie is composed of a video +and a *poster frame*, the placeholder image that represents the video before it is played. + +### `media_format` + +```python +media_format() -> _MediaFormat +``` + +The `_MediaFormat` object for this movie. + +The `_MediaFormat` object provides access to formatting properties for the movie. + +### `media_type` + +```python +media_type: PP_MEDIA_TYPE +``` + +Member of `PpMediaType` describing this shape. + +The return value is unconditionally `PP_MEDIA_TYPE.MOVIE` in this case. + +### `poster_frame` + +```python +poster_frame +``` + +Return `Image` object containing poster frame for this movie. + +Returns `None` if this movie has no poster frame (uncommon). + +### `shape_type` + +```python +shape_type: MSO_SHAPE_TYPE +``` + +Return member of `MsoShapeType` describing this shape. + +The return value is unconditionally `MSO_SHAPE_TYPE.MEDIA` in this +case. + +## `Picture` + +Bases: `_BasePicture` + +A picture shape, one that places an image on a slide. + +Based on the `p:pic` element. + +### `auto_shape_type` + +```python +auto_shape_type: MSO_SHAPE | None +``` + +Member of MSO_SHAPE indicating masking shape. + +A picture can be masked by any of the so-called "auto-shapes" available in PowerPoint, +such as an ellipse or triangle. When a picture is masked by a shape, the shape assumes the +same dimensions as the picture and the portion of the picture outside the shape boundaries +does not appear. Note the default value for a newly-inserted picture is +`MSO_AUTO_SHAPE_TYPE.RECTANGLE`, which performs no cropping because the extents of the +rectangle exactly correspond to the extents of the picture. + +The available shapes correspond to the members of `MsoAutoShapeType`. + +The return value can also be `None`, indicating the picture either has no geometry (not +expected) or has custom geometry, like a freeform shape. A picture with no geometry will +have no visible representation on the slide, although it can be selected. This is because +without geometry, there is no "inside-the-shape" for it to appear in. + +### `image` + +```python +image +``` + +The `Image` object for this picture. + +Provides access to the properties and bytes of the image in this picture shape. + +### `replace_image` + +```python +replace_image(image_file: str | IO[bytes], *, allow_format_change: bool = False) -> None +``` + +Replace the image behind this picture, preserving its geometry exactly. + +paper-pptx addition. Position, size, rotation, masking geometry, and crop +(`a:srcRect`) are not touched — only the `a:blip/@r:embed` target changes. By +default the new image's canonical format must match the existing image part's +extension (jpg == jpeg); a mismatch refuses with `UnsupportedStructureError`. +Passing `allow_format_change=True` permits a cross-format swap: the new +image gets its own correctly-typed part and `[Content_Types].xml` follows +automatically at save (it is regenerated from live parts). + +A picture with no embedded image relationship (e.g. linked-only) refuses. The new +image part is deduplicated package-wide by content hash; the old image part simply +becomes unreferenced when this picture held its last reference (an unreachable part +is never serialized). + +### `shape_type` + +```python +shape_type: MSO_SHAPE_TYPE +``` + +Unconditionally `MSO_SHAPE_TYPE.PICTURE` in this case. + + + + + +# `pptx.shapes.placeholder` + +Placeholder-related objects. + +## `BasePlaceholder` + +Bases: `Shape` + +NOTE: This class is deprecated and will be removed from a future release +along with the properties *idx*, *orient*, *ph_type*, and *sz*. The *idx* +property will be available via the .placeholder_format property. The +others will be accessed directly from the oxml layer as they are only +used for internal purposes. + +Base class for placeholder subclasses that differentiate the varying +behaviors of placeholders on a master, layout, and slide. + +### `idx` + +```python +idx +``` + +Integer placeholder 'idx' attribute, e.g. 0 + +### `orient` + +```python +orient +``` + +Placeholder orientation, e.g. ST_Direction.HORZ + +### `ph_type` + +```python +ph_type +``` + +Placeholder type, e.g. PP_PLACEHOLDER.CENTER_TITLE + +### `sz` + +```python +sz +``` + +Placeholder 'sz' attribute, e.g. ST_PlaceholderSize.FULL + +## `ChartPlaceholder` + +Bases: `_BaseSlidePlaceholder` + +Placeholder shape that can only accept a chart. + +### `insert_chart` + +```python +insert_chart(chart_type, chart_data) +``` + +Return a `PlaceholderGraphicFrame` object containing a new chart of +*chart_type* depicting *chart_data* and having the same position and +size as this placeholder. *chart_type* is one of the +`XlChartType` enumeration values. *chart_data* is a `ChartData` +object populated with the categories and series values for the chart. +Note that the new `Chart` object is not returned directly. The chart +object may be accessed using the +`chart` property of the returned +`PlaceholderGraphicFrame` object. + +## `LayoutPlaceholder` + +Bases: `_InheritsDimensions`, `Shape` + +Placeholder shape on a slide layout. + +Provides differentiated behavior for slide layout placeholders, in particular, inheriting +shape properties from the master placeholder having the same type, when a matching one exists. + +### `element` + +```python +element: CT_Shape +``` + +## `MasterPlaceholder` + +Bases: `BasePlaceholder` + +Placeholder shape on a slide master. + +### `element` + +```python +element: CT_Shape +``` + +## `NotesSlidePlaceholder` + +Bases: `_InheritsDimensions`, `Shape` + +Placeholder shape on a notes slide. Inherits shape properties from the +placeholder on the notes master that has the same type (e.g. 'body'). + +## `PicturePlaceholder` + +Bases: `_BaseSlidePlaceholder` + +Placeholder shape that can only accept a picture. + +### `insert_picture` + +```python +insert_picture(image_file) +``` + +Return a `PlaceholderPicture` object depicting the image in `image_file`. + +`image_file` may be either a path (string) or a file-like object. The image is +cropped to fill the entire space of the placeholder. A `PlaceholderPicture` +object has all the properties and methods of a `Picture` shape except that the +value of its `shape_type` property is +`MSO_SHAPE_TYPE.PLACEHOLDER` instead of `MSO_SHAPE_TYPE.PICTURE`. + +## `PlaceholderGraphicFrame` + +Bases: `GraphicFrame` + +Placeholder shape populated with a table, chart, or smart art. + +### `is_placeholder` + +```python +is_placeholder +``` + +Boolean indicating whether this shape is a placeholder. +Unconditionally `True` in this case. + +## `PlaceholderPicture` + +Bases: `_InheritsDimensions`, `Picture` + +Placeholder shape populated with a picture. + +## `SlidePlaceholder` + +Bases: `_BaseSlidePlaceholder` + +Placeholder shape on a slide. Inherits shape properties from its +corresponding slide layout placeholder. + +## `TablePlaceholder` + +Bases: `_BaseSlidePlaceholder` + +Placeholder shape that can only accept a table. + +### `insert_table` + +```python +insert_table(rows, cols) +``` + +Return `PlaceholderGraphicFrame` object containing a `rows` by `cols` table. + +The position and width of the table are those of the placeholder and its height +is proportional to the number of rows. A `PlaceholderGraphicFrame` object has +all the properties and methods of a `GraphicFrame` shape except that the value +of its `shape_type` property is unconditionally +`MSO_SHAPE_TYPE.PLACEHOLDER`. Note that the return value is not the new table +but rather *contains* the new table. The table can be accessed using the +`table` property of the returned +`PlaceholderGraphicFrame` object. + + + + + +# `pptx.shapes.shapetree` + +The shape tree, the structure that holds a slide's shapes. + +## `BasePlaceholders` + +Bases: `_BaseShapes` + +Base class for placeholder collections. + +Subclasses differentiate behaviors for a master, layout, and slide. By default, placeholder +shapes are constructed using `BaseShapeFactory`. Subclasses should override +:method:`_shape_factory` to use custom placeholder classes. + +## `BaseShapeFactory` + +```python +BaseShapeFactory(shape_elm: ShapeElement, parent: ProvidesPart) -> BaseShape +``` + +Return an instance of the appropriate shape proxy class for `shape_elm`. + +## `GroupShapes` + +Bases: `_BaseGroupShapes` + +The sequence of child shapes belonging to a group shape. + +Note that this collection can itself contain a group shape, making this part of a recursive, +tree data structure (acyclic graph). + +## `LayoutPlaceholders` + +Bases: `BasePlaceholders` + +Sequence of `LayoutPlaceholder` instance for each placeholder shape on a slide layout. + +### `get` + +```python +get(idx: int, default: LayoutPlaceholder | None = None) -> LayoutPlaceholder | None +``` + +The first placeholder shape with matching `idx` value, or `default` if not found. + +## `LayoutShapes` + +Bases: `_BaseShapes` + +Sequence of shapes appearing on a slide layout. + +The first shape in the sequence is the backmost in z-order and the last shape is topmost. +Supports indexed access, len(), index(), and iteration. + +## `MasterPlaceholders` + +Bases: `BasePlaceholders` + +Sequence of MasterPlaceholder representing the placeholder shapes on a slide master. + +### `get` + +```python +get(ph_type: PP_PLACEHOLDER, default: MasterPlaceholder | None = None) +``` + +Return the first placeholder shape with type `ph_type` (e.g. 'body'). + +Returns `default` if no such placeholder shape is present in the collection. + +## `MasterShapes` + +Bases: `_BaseShapes` + +Sequence of shapes appearing on a slide master. + +The first shape in the sequence is the backmost in z-order and the last shape is topmost. +Supports indexed access, len(), and iteration. + +## `NotesSlidePlaceholders` + +Bases: `MasterPlaceholders` + +Sequence of placeholder shapes on a notes slide. + +## `NotesSlideShapes` + +Bases: `_BaseShapes` + +Sequence of shapes appearing on a notes slide. + +The first shape in the sequence is the backmost in z-order and the last shape is topmost. +Supports indexed access, len(), index(), and iteration. + +### `ph_basename` + +```python +ph_basename(ph_type: PP_PLACEHOLDER) -> str +``` + +Return the base name for a placeholder of `ph_type` in this shape collection. + +A notes slide uses a different name for the body placeholder and has some unique +placeholder types, so this method overrides the default in the base class. + +## `SlidePlaceholders` + +Bases: `ParentedElementProxy` + +Collection of placeholder shapes on a slide. + +Supports iteration, `len`, and dictionary-style lookup on the `idx` value of the +placeholders it contains. + +## `SlideShapeFactory` + +```python +SlideShapeFactory(shape_elm: ShapeElement, parent: ProvidesPart) -> BaseShape +``` + +Return appropriate shape object for `shape_elm` on a slide. + +## `SlideShapes` + +Bases: `_BaseGroupShapes` + +Sequence of shapes appearing on a slide. + +The first shape in the sequence is the backmost in z-order and the last shape is topmost. +Supports indexed access, len(), index(), and iteration. + +### `add_copy` + +```python +add_copy(shape) +``` + +Return a copy of `shape` (from this or another slide) added to this slide. + +paper-pptx addition. The copy gets fresh shape ids; its +relationships follow the pinned policy: image/media parts shared, external +(hyperlink) relationships copied, charts deep-copied WITH their embedded workbooks +and style parts. Any other relationship type refuses with `RelationshipPolicyError` +before anything changes. A shape from another presentation raises +`TargetNotFoundError`. + +### `add_movie` + +```python +add_movie(movie_file: str | IO[bytes], left: Length, top: Length, width: Length, height: Length, poster_frame_image: str | IO[bytes] | None = None, mime_type: str = CT.VIDEO) -> GraphicFrame +``` + +Return newly added movie shape displaying video in `movie_file`. + +**EXPERIMENTAL.** This method has important limitations: + +* The size must be specified; no auto-scaling such as that provided by `add_picture` + is performed. +* The MIME type of the video file should be specified, e.g. 'video/mp4'. The provided + video file is not interrogated for its type. The MIME type `video/unknown` is used by + default (and works fine in tests as of this writing). +* A poster frame image must be provided, it cannot be automatically extracted from the + video file. If no poster frame is provided, the default "media loudspeaker" image will + be used. + +Return a newly added movie shape to the slide, positioned at (`left`, `top`), having size +(`width`, `height`), and containing `movie_file`. Before the video is started, +`poster_frame_image` is displayed as a placeholder for the video. + +### `add_table` + +```python +add_table(rows: int, cols: int, left: Length, top: Length, width: Length, height: Length) -> GraphicFrame +``` + +Add a `GraphicFrame` object containing a table. + +The table has the specified number of `rows` and `cols` and the specified position and +size. `width` is evenly distributed between the columns of the new table. Likewise, +`height` is evenly distributed between the rows. Note that the `.table` property on the +returned `GraphicFrame` shape must be used to access the enclosed `Table` object. + +### `chart_by_name` + +```python +chart_by_name(name: str) +``` + +Return the `Chart` held by the shape on this slide named `name`. + +paper-pptx addition, the chart-addressing half of safe chart-data replacement. +Group-aware: shapes inside groups are found too. Raises +`TargetNotFoundError` when no shape has that name, or when shapes with the name +exist but none holds a chart (the message says what was found instead). Raises +`AmbiguousTargetError` when more than one chart-bearing shape has the name — this +API never guesses between them. + +### `clone_layout_placeholders` + +```python +clone_layout_placeholders(slide_layout: SlideLayout) -> None +``` + +Add placeholder shapes based on those in `slide_layout`. + +Z-order of placeholders is preserved. Latent placeholders (date, slide number, and footer) +are not cloned. + +### `delete` + +```python +delete(shape) -> None +``` + +Remove `shape` from this slide, with relationship hygiene. + +paper-pptx addition. Relationships referenced by the removed +subtree are dropped unless something else in the part still references them (two +pictures can share one image relationship). A shape that is not a direct member of +this collection — including a shape inside a group — raises `TargetNotFoundError` +(delete the group, or ungroup first). + +### `move` + +```python +move(shape, to_index: int) -> None +``` + +Move `shape` to 0-based `to_index` in this collection's z-order. + +paper-pptx addition. Index 0 is backmost, the last index topmost — +the same order this collection iterates. `to_index` outside range raises +`ValueError`; a shape not directly in this collection raises `TargetNotFoundError`. + +### `parent` + +```python +parent: Slide +``` + +### `picture_by_name` + +```python +picture_by_name(name: str) +``` + +Return the `Picture` on this slide named `name` (group-aware). + +paper-pptx addition, with the same contract as `chart_by_name`: +`TargetNotFoundError` when nothing (or nothing picture-shaped) has the name, +`AmbiguousTargetError` when several pictures do. + +### `placeholders` + +```python +placeholders: SlidePlaceholders +``` + +Sequence of placeholder shapes in this slide. + +### `shape_by_name` + +```python +shape_by_name(name: str) +``` + +Return the single shape on this slide named `name` (group-aware). + +paper-pptx addition: `TargetNotFoundError` / `AmbiguousTargetError`, +never first-match. + +### `table_by_name` + +```python +table_by_name(name: str) +``` + +Return the `Table` held by the graphic frame on this slide named `name`. + +paper-pptx addition, same contract as `chart_by_name`. + +### `title` + +```python +title: Shape | None +``` + +The title placeholder shape on the slide. + +`None` if the slide has no title placeholder. + + + + + +# `pptx.shared` + +Objects shared by pptx modules. + +## `ElementProxy` + +```python +ElementProxy(element: BaseOxmlElement) +``` + +Bases: `object` + +Base class for lxml element proxy classes. + +An element proxy class is one whose primary responsibilities are fulfilled by manipulating the +attributes and child elements of an XML element. They are the most common type of class in +python-pptx other than custom element (oxml) classes. + +### `element` + +```python +element +``` + +The lxml element proxied by this object. + +## `ParentedElementProxy` + +```python +ParentedElementProxy(element: BaseOxmlElement, parent: ProvidesPart) +``` + +Bases: `ElementProxy` + +Provides access to ancestor objects and part. + +An ancestor may occasionally be required to provide a service, such as add or drop a +relationship. Provides the `_parent` attribute to subclasses and the public +`parent` read-only property. + +### `parent` + +```python +parent +``` + +The ancestor proxy object to this one. + +For example, the parent of a shape is generally the `SlideShapes` object that contains it. + +### `part` + +```python +part: XmlPart +``` + +The package part containing this object. + +## `PartElementProxy` + +```python +PartElementProxy(element: BaseOxmlElement, part: XmlPart) +``` + +Bases: `ElementProxy` + +Provides common members for proxy-objects that wrap a part's root element, e.g. `p:sld`. + +### `part` + +```python +part: XmlPart +``` + +The package part containing this object. + + + + + +# `pptx.slide` + +Slide-related objects, including masters, layouts, and notes. + +## `HeaderFooters` + +```python +HeaderFooters(owner) +``` + +Bases: `object` + +Header/footer placeholder visibility flags of a layout or master (paper-pptx addition). + +Wraps the `p:hf` element. Each property is tri-state: `True`/`False` when the attribute +is explicit, `None` when it is absent — meaning "inherit" (a layout inherits from its +master; the schema default is visible). Assigning `None` removes the attribute. + +Bind to the layout or master that owns these flags. + +### `date_visible` + +```python +date_visible: bool | None +``` + +Visibility of the date placeholder (`p:hf/@dt`). + +### `footer_visible` + +```python +footer_visible: bool | None +``` + +Visibility of the footer placeholder (`p:hf/@ftr`). + +### `slide_number_visible` + +```python +slide_number_visible: bool | None +``` + +Visibility of the slide-number placeholder (`p:hf/@sldNum`). + +## `NotesMaster` + +Bases: `_BaseMaster` + +Proxy for the notes master XML document. + +Provides access to shapes, the most commonly used of which are placeholders. + +## `NotesSlide` + +Bases: `_BaseSlide` + +Notes slide object. + +Provides access to slide notes placeholder and other shapes on the notes handout +page. + +### `clone_master_placeholders` + +```python +clone_master_placeholders(notes_master: NotesMaster) -> None +``` + +Selectively add placeholder shape elements from `notes_master`. + +Selected placeholder shape elements from `notes_master` are added to the shapes +collection of this notes slide. Z-order of placeholders is preserved. Certain +placeholders (header, date, footer) are not cloned. + +### `element` + +```python +element: CT_NotesSlide +``` + +### `notes_placeholder` + +```python +notes_placeholder: NotesSlidePlaceholder | None +``` + +the notes placeholder on this notes slide, the shape that contains the actual notes text. + +Return `None` if no notes placeholder is present; while this is probably uncommon, it can +happen if the notes master does not have a body placeholder, or if the notes placeholder +has been deleted from the notes slide. + +### `notes_text_frame` + +```python +notes_text_frame: TextFrame | None +``` + +The text frame of the notes placeholder on this notes slide. + +`None` if there is no notes placeholder. This is a shortcut to accommodate the common case +of simply adding "notes" text to the notes "page". + +### `placeholders` + +```python +placeholders() -> NotesSlidePlaceholders +``` + +Instance of `NotesSlidePlaceholders` for this notes-slide. + +Contains the sequence of placeholder shapes in this notes slide. + +### `shapes` + +```python +shapes() -> NotesSlideShapes +``` + +Sequence of shape objects appearing on this notes slide. + +## `Slide` + +Bases: `_BaseSlide` + +Slide object. Provides access to shapes and slide-level properties. + +### `apply_footers` + +```python +apply_footers(*, footer: str | None = None, slide_number: bool = False, date_format: str | None = None, fixed_date: str | None = None, now: 'datetime | None' = None) -> None +``` + +Apply the complete footer state to this slide only (the dialog's "Apply"). + +paper-pptx addition. Same parameters, mechanism, and refusals as +`.Presentation.apply_footers`, restricted to this slide — the per-slide +override path (e.g. removing just this slide's footer while the rest of the deck +keeps it). Each call sets this slide's full three-element state. + +### `follow_master_background` + +```python +follow_master_background +``` + +`True` if this slide inherits the slide master background. + +Assigning `False` causes background inheritance from the master to be +interrupted; if there is no custom background for this slide, +a default background is added. If a custom background already exists +for this slide, assigning `False` has no effect. + +Assigning `True` causes any custom background for this slide to be +deleted and inheritance from the master restored. + +### `has_notes_slide` + +```python +has_notes_slide: bool +``` + +`True` if this slide has a notes slide, `False` otherwise. + +A notes slide is created by `.notes_slide` when one doesn't exist; use this property +to test for a notes slide without the possible side effect of creating one. + +### `notes_slide` + +```python +notes_slide: NotesSlide +``` + +The `NotesSlide` instance for this slide. + +If the slide does not have a notes slide, one is created. The same single instance is +returned on each call. + +### `part` + +```python +part: SlidePart +``` + +### `placeholders` + +```python +placeholders() -> SlidePlaceholders +``` + +Sequence of placeholder shapes in this slide. + +### `read_notes_text` + +```python +read_notes_text() -> str +``` + +Return the text of this slide's existing speaker notes. + +paper-pptx addition. Unlike `notes_slide`, this NEVER creates a notes slide: +a slide with no notes part raises `UnsupportedStructureError` (as does a notes slide +with no body placeholder). Returns "" for an empty existing notes body. + +### `rebind_layout` + +```python +rebind_layout(target_layout: 'SlideLayout', *, placeholder_map: 'SlideLayout' = 'auto', orphan_policy: str = 'refuse') -> 'RebindReport' +``` + +Move this slide to `target_layout`; return the required `RebindReport`. + +paper-pptx addition — the template-migration *primitive* (bulk-migration +workflows are left to the caller). Placeholders reconcile against the +target layout: auto-matching binds by exact type+idx, then same type, then +interchangeable type family (title/ctrTitle; body/object/subTitle). The two +fallback tiers bind only when exactly one unclaimed target exists; ambiguity +refuses and requires an explicit map. Pass +`placeholder_map={source_idx: target_idx | None}` to override any of it (None +force-orphans a source). Source placeholders with no destination follow +`orphan_policy`: "refuse" (default; typed, atomic) or "bake" — convert to a free +shape with inherited geometry materialized and each run's *resolved* effective +formatting written locally, so the text keeps its look. + +The report is not optional: the effective-value resolver runs before and after, +and every run whose resolved values changed appears with its before/after payloads +— a rebind never shifts appearance silently. Same-package only (cross-package +composition is `import_slide`'s job); slides carrying `mc:AlternateContent` +refuse (shapes inside are invisible to reconciliation). + +### `replace_notes_text` + +```python +replace_notes_text(text: str) -> None +``` + +Replace the text of this slide's existing speaker notes with `text`. + +paper-pptx addition. Only the notes *body* placeholder is touched — slide-number and +other notes placeholders are preserved untouched. The first paragraph's properties +and its first run's character formatting are kept and applied to the replacement +text; `"\n"` in `text` starts a new paragraph. Never creates a notes slide: a slide +with no notes part raises `UnsupportedStructureError` before anything changes +(creating the notes part graph is intentionally not supported). + +### `shapes` + +```python +shapes() -> SlideShapes +``` + +Sequence of shape objects appearing on this slide. + +### `slide_id` + +```python +slide_id: int +``` + +Integer value that uniquely identifies this slide within this presentation. + +The slide id does not change if the position of this slide in the slide sequence is changed +by adding, rearranging, or deleting slides. + +### `slide_layout` + +```python +slide_layout: SlideLayout +``` + +`SlideLayout` object this slide inherits appearance from. + +## `SlideClonePolicy` + +```python +SlideClonePolicy(deep_copy_charts: bool = True, deep_copy_notes: bool = True, share_media: bool = True) -> None +``` + +Relationship policy for `Slides.clone` (paper-pptx addition). + +Defaults encode the production-proven policy: charts (with their embedded workbooks and +style parts) and speaker notes are deep-copied so clone and original can never +cross-contaminate; image/media parts are shared deliberately. + +- `deep_copy_charts`: must be True to clone a slide bearing charts; False refuses + (`RelationshipPolicyError`) rather than share an editable chart part between slides. +- `deep_copy_notes`: False drops the notes slide from the clone (original unaffected). +- `share_media`: False deep-copies image/media parts instead of sharing them. + +### `deep_copy_charts` + +```python +deep_copy_charts: bool = True +``` + +### `deep_copy_notes` + +```python +deep_copy_notes: bool = True +``` + +### `share_media` + +```python +share_media: bool = True +``` + +## `SlideLayout` + +Bases: `_BaseSlide` + +Slide layout object. + +Provides access to placeholders, regular shapes, and slide layout-level properties. + +### `header_footers` + +```python +header_footers: HeaderFooters +``` + +`HeaderFooters` flags for this layout (paper-pptx addition). + +### `iter_cloneable_placeholders` + +```python +iter_cloneable_placeholders() -> Iterator[LayoutPlaceholder] +``` + +Generate layout-placeholders on this slide-layout that should be cloned to a new slide. + +Used when creating a new slide from this slide-layout. + +### `part` + +```python +part: SlideLayoutPart +``` + +### `placeholders` + +```python +placeholders() -> LayoutPlaceholders +``` + +Sequence of placeholder shapes in this slide layout. + +Placeholders appear in `idx` order. + +### `shapes` + +```python +shapes() -> LayoutShapes +``` + +Sequence of shapes appearing on this slide layout. + +### `slide_master` + +```python +slide_master: SlideMaster +``` + +Slide master from which this slide-layout inherits properties. + +### `used_by_slides` + +```python +used_by_slides +``` + +Tuple of slide objects based on this slide layout. + +## `SlideLayouts` + +```python +SlideLayouts(sldLayoutIdLst: CT_SlideLayoutIdList, parent: SlideMaster) +``` + +Bases: `ParentedElementProxy` + +Sequence of slide layouts belonging to a slide-master. + +Supports indexed access, len(), iteration, index() and remove(). + +### `get_by_name` + +```python +get_by_name(name: str, default: SlideLayout | None = None) -> SlideLayout | None +``` + +Return SlideLayout object having `name`, or `default` if not found. + +### `index` + +```python +index(slide_layout: SlideLayout) -> int +``` + +Return zero-based index of `slide_layout` in this collection. + +Raises `ValueError` if `slide_layout` is not present in this collection. + +### `part` + +```python +part: SlideMasterPart +``` + +### `remove` + +```python +remove(slide_layout: SlideLayout) -> None +``` + +Remove `slide_layout` from the collection. + +Raises ValueError when `slide_layout` is in use; a slide layout which is the basis for one +or more slides cannot be removed. + +Refuses with TargetNotFoundError when the layout belongs to another presentation, and with +UnsupportedStructureError when its part carries inbound relationships beyond this +collection's own, where dropping it would strand whatever else points at it. + +## `SlideMaster` + +Bases: `_BaseMaster` + +Slide master object. + +Provides access to slide layouts. Access to placeholders, regular shapes, and slide master-level +properties is inherited from `_BaseMaster`. + +### `header_footers` + +```python +header_footers: HeaderFooters +``` + +`HeaderFooters` flags for this master (paper-pptx addition). + +### `slide_layouts` + +```python +slide_layouts() -> SlideLayouts +``` + +`SlideLayouts` object providing access to this slide-master's layouts. + +## `SlideMasters` + +```python +SlideMasters(sldMasterIdLst: CT_SlideMasterIdList, parent: Presentation) +``` + +Bases: `ParentedElementProxy` + +Sequence of `SlideMaster` objects belonging to a presentation. + +Has list access semantics, supporting indexed access, len(), and iteration. + +### `part` + +```python +part: PresentationPart +``` + +## `Slides` + +```python +Slides(sldIdLst: CT_SlideIdList, prs: Presentation) +``` + +Bases: `ParentedElementProxy` + +Sequence of slides belonging to an instance of `Presentation`. + +Has list semantics for access to individual slides. Supports indexed access, len(), and +iteration. + +### `add_slide` + +```python +add_slide(slide_layout: SlideLayout) -> Slide +``` + +Return a newly added slide that inherits layout from `slide_layout`. + +### `clone` + +```python +clone(source: Slide | int, *, after: Slide | int | None = None, policy: SlideClonePolicy | None = None) -> Slide +``` + +Return a new slide that is a policy-governed deep copy of `source`. + +paper-pptx addition. The clone's relationship graph follows `policy` (default +`SlideClonePolicy`): layout shared; charts deep-copied WITH their embedded workbooks +and style parts; notes deep-copied and re-linked to the clone; image/media shared; +external (hyperlink) relationships copied. A slide bearing any other relationship +type (OLE objects, controls, SmartArt, comments, …) refuses with +`RelationshipPolicyError` before anything changes. + +The clone is inserted directly after `source`, or after the slide given by `after`. +`source`/`after` accept a `Slide` or a 0-based index; a `Slide` from another +presentation raises `TargetNotFoundError`. + +### `delete` + +```python +delete(slide: Slide | int) -> None +``` + +Remove `slide` from this presentation. + +paper-pptx addition. Removes the slide's `p:sldId` entry and the presentation's +relationship to the slide part; parts then unreachable through the relationship +graph (the slide, and e.g. its charts and notes if unshared) are never serialized +again — orphans structurally cannot reach disk. Deleting the last slide is allowed. + +### `get` + +```python +get(slide_id: int, default: Slide | None = None) -> Slide | None +``` + +Return the slide identified by int `slide_id` in this presentation. + +Returns `default` if not found. + +### `index` + +```python +index(slide: Slide) -> int +``` + +Map `slide` to its zero-based position in this slide sequence. + +Raises `ValueError` on *slide* not present. + +### `move` + +```python +move(slide: Slide | int, to_index: int) -> None +``` + +Move `slide` so it sits at 0-based `to_index` in the slide sequence. + +paper-pptx addition. `to_index` outside `range(len(slides))` raises `ValueError`. + +### `part` + +```python +part: PresentationPart +``` + +### `reorder` + +```python +reorder(new_order: Sequence[int]) -> None +``` + +Permute the slide sequence: new position i shows the slide now at `new_order[i]`. + +paper-pptx addition. `new_order` must be an exact permutation of +`range(len(slides))`; anything else raises `ValueError` before any change. + + + + + +# `pptx.slideops` + +Internal machinery for slide clone/delete/reorder (paper-pptx). Not public API. + +## `clone_slide_part` + +```python +clone_slide_part(source_part: 'SlidePart', policy: 'SlidePart') -> 'SlidePart' +``` + +Return a new `SlidePart` that is a policy-governed deep copy of `source_part`. + +The new part is fully related (layout, media, charts+workbooks, notes per `policy`) but +NOT yet added to the presentation's slide list — the caller owns `p:sldIdLst`. + +## `enroll_clone_in_section` + +```python +enroll_clone_in_section(presentation_elm, source_slide_id: int, clone_slide_id: int) -> None +``` + +Add `clone_slide_id` to the section holding `source_slide_id`, directly after it. + +No-op when the deck has no sections or the source slide is not enrolled in one. Custom +shows are deliberately NOT extended: a copy is not part of a curated show. + +## `remove_slide_from_id_lists` + +```python +remove_slide_from_id_lists(presentation_elm, slide_id: int, rId: str) -> None +``` + +Purge `slide_id`/`rId` bookkeeping for a deleted slide from auxiliary ID lists. + +Sections (`p14:sectionLst`, in the presentation's extension list) reference slides by +slide id; custom shows (`p:custShowLst`) reference them by relationship id. Neither is +reachable through the relationship graph, so without this step a delete leaves dangling +entries behind — the corruption class this step closes. Empty sections and +empty custom-show slide lists are schema-valid and left in place (matching PowerPoint, +which keeps an emptied section). + + + + + +# `pptx.spec` + +Mappings from the ISO/IEC 29500 spec. + +## `AdjustmentValue` + +```python +AdjustmentValue: TypeAlias = 'tuple[str, int]' +``` + +## `GRAPHIC_DATA_URI_CHART` + +```python +GRAPHIC_DATA_URI_CHART = 'http://schemas.openxmlformats.org/drawingml/2006/chart' +``` + +## `GRAPHIC_DATA_URI_OLEOBJ` + +```python +GRAPHIC_DATA_URI_OLEOBJ = 'http://schemas.openxmlformats.org/presentationml/2006/ole' +``` + +## `GRAPHIC_DATA_URI_TABLE` + +```python +GRAPHIC_DATA_URI_TABLE = 'http://schemas.openxmlformats.org/drawingml/2006/table' +``` + +## `ShapeSpec` + +Bases: `TypedDict` + +### `avLst` + +```python +avLst: tuple[AdjustmentValue, ...] +``` + +### `basename` + +```python +basename: str +``` + +## `autoshape_types` + +```python +autoshape_types: dict[MSO_SHAPE, ShapeSpec] = {MSO_SHAPE.ACTION_BUTTON_BACK_OR_PREVIOUS: {'basename': 'Action Button: Back or Previous', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_BEGINNING: {'basename': 'Action Button: Beginning', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_CUSTOM: {'basename': 'Action Button: Custom', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_DOCUMENT: {'basename': 'Action Button: Document', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_END: {'basename': 'Action Button: End', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_FORWARD_OR_NEXT: {'basename': 'Action Button: Forward or Next', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_HELP: {'basename': 'Action Button: Help', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_HOME: {'basename': 'Action Button: Home', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_INFORMATION: {'basename': 'Action Button: Information', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_MOVIE: {'basename': 'Action Button: Movie', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_RETURN: {'basename': 'Action Button: Return', 'avLst': ()}, MSO_SHAPE.ACTION_BUTTON_SOUND: {'basename': 'Action Button: Sound', 'avLst': ()}, MSO_SHAPE.ARC: {'basename': 'Arc', 'avLst': (('adj1', 16200000), ('adj2', 0))}, MSO_SHAPE.BALLOON: {'basename': 'Rounded Rectangular Callout', 'avLst': (('adj1', -20833), ('adj2', 62500), ('adj3', 16667))}, MSO_SHAPE.BENT_ARROW: {'basename': 'Bent Arrow', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 43750))}, MSO_SHAPE.BENT_UP_ARROW: {'basename': 'Bent-Up Arrow', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000))}, MSO_SHAPE.BEVEL: {'basename': 'Bevel', 'avLst': (('adj', 12500),)}, MSO_SHAPE.BLOCK_ARC: {'basename': 'Block Arc', 'avLst': (('adj1', 10800000), ('adj2', 0), ('adj3', 25000))}, MSO_SHAPE.CAN: {'basename': 'Can', 'avLst': (('adj', 25000),)}, MSO_SHAPE.CHART_PLUS: {'basename': 'Chart Plus', 'avLst': ()}, MSO_SHAPE.CHART_STAR: {'basename': 'Chart Star', 'avLst': ()}, MSO_SHAPE.CHART_X: {'basename': 'Chart X', 'avLst': ()}, MSO_SHAPE.CHEVRON: {'basename': 'Chevron', 'avLst': (('adj', 50000),)}, MSO_SHAPE.CHORD: {'basename': 'Chord', 'avLst': (('adj1', 2700000), ('adj2', 16200000))}, MSO_SHAPE.CIRCULAR_ARROW: {'basename': 'Circular Arrow', 'avLst': (('adj1', 12500), ('adj2', 1142319), ('adj3', 20457681), ('adj4', 10800000), ('adj5', 12500))}, MSO_SHAPE.CLOUD: {'basename': 'Cloud', 'avLst': ()}, MSO_SHAPE.CLOUD_CALLOUT: {'basename': 'Cloud Callout', 'avLst': (('adj1', -20833), ('adj2', 62500))}, MSO_SHAPE.CORNER: {'basename': 'Corner', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.CORNER_TABS: {'basename': 'Corner Tabs', 'avLst': ()}, MSO_SHAPE.CROSS: {'basename': 'Cross', 'avLst': (('adj', 25000),)}, MSO_SHAPE.CUBE: {'basename': 'Cube', 'avLst': (('adj', 25000),)}, MSO_SHAPE.CURVED_DOWN_ARROW: {'basename': 'Curved Down Arrow', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 25000))}, MSO_SHAPE.CURVED_DOWN_RIBBON: {'basename': 'Curved Down Ribbon', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 12500))}, MSO_SHAPE.CURVED_LEFT_ARROW: {'basename': 'Curved Left Arrow', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 25000))}, MSO_SHAPE.CURVED_RIGHT_ARROW: {'basename': 'Curved Right Arrow', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 25000))}, MSO_SHAPE.CURVED_UP_ARROW: {'basename': 'Curved Up Arrow', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 25000))}, MSO_SHAPE.CURVED_UP_RIBBON: {'basename': 'Curved Up Ribbon', 'avLst': (('adj1', 25000), ('adj2', 50000), ('adj3', 12500))}, MSO_SHAPE.DECAGON: {'basename': 'Decagon', 'avLst': (('vf', 105146),)}, MSO_SHAPE.DIAGONAL_STRIPE: {'basename': 'Diagonal Stripe', 'avLst': (('adj', 50000),)}, MSO_SHAPE.DIAMOND: {'basename': 'Diamond', 'avLst': ()}, MSO_SHAPE.DODECAGON: {'basename': 'Dodecagon', 'avLst': ()}, MSO_SHAPE.DONUT: {'basename': 'Donut', 'avLst': (('adj', 25000),)}, MSO_SHAPE.DOUBLE_BRACE: {'basename': 'Double Brace', 'avLst': (('adj', 8333),)}, MSO_SHAPE.DOUBLE_BRACKET: {'basename': 'Double Bracket', 'avLst': (('adj', 16667),)}, MSO_SHAPE.DOUBLE_WAVE: {'basename': 'Double Wave', 'avLst': (('adj1', 6250), ('adj2', 0))}, MSO_SHAPE.DOWN_ARROW: {'basename': 'Down Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.DOWN_ARROW_CALLOUT: {'basename': 'Down Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 64977))}, MSO_SHAPE.DOWN_RIBBON: {'basename': 'Down Ribbon', 'avLst': (('adj1', 16667), ('adj2', 50000))}, MSO_SHAPE.EXPLOSION1: {'basename': 'Explosion', 'avLst': ()}, MSO_SHAPE.EXPLOSION2: {'basename': 'Explosion', 'avLst': ()}, MSO_SHAPE.FLOWCHART_ALTERNATE_PROCESS: {'basename': 'Alternate process', 'avLst': ()}, MSO_SHAPE.FLOWCHART_CARD: {'basename': 'Card', 'avLst': ()}, MSO_SHAPE.FLOWCHART_COLLATE: {'basename': 'Collate', 'avLst': ()}, MSO_SHAPE.FLOWCHART_CONNECTOR: {'basename': 'Connector', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DATA: {'basename': 'Data', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DECISION: {'basename': 'Decision', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DELAY: {'basename': 'Delay', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DIRECT_ACCESS_STORAGE: {'basename': 'Direct Access Storage', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DISPLAY: {'basename': 'Display', 'avLst': ()}, MSO_SHAPE.FLOWCHART_DOCUMENT: {'basename': 'Document', 'avLst': ()}, MSO_SHAPE.FLOWCHART_EXTRACT: {'basename': 'Extract', 'avLst': ()}, MSO_SHAPE.FLOWCHART_INTERNAL_STORAGE: {'basename': 'Internal Storage', 'avLst': ()}, MSO_SHAPE.FLOWCHART_MAGNETIC_DISK: {'basename': 'Magnetic Disk', 'avLst': ()}, MSO_SHAPE.FLOWCHART_MANUAL_INPUT: {'basename': 'Manual Input', 'avLst': ()}, MSO_SHAPE.FLOWCHART_MANUAL_OPERATION: {'basename': 'Manual Operation', 'avLst': ()}, MSO_SHAPE.FLOWCHART_MERGE: {'basename': 'Merge', 'avLst': ()}, MSO_SHAPE.FLOWCHART_MULTIDOCUMENT: {'basename': 'Multidocument', 'avLst': ()}, MSO_SHAPE.FLOWCHART_OFFLINE_STORAGE: {'basename': 'Offline Storage', 'avLst': ()}, MSO_SHAPE.FLOWCHART_OFFPAGE_CONNECTOR: {'basename': 'Off-page Connector', 'avLst': ()}, MSO_SHAPE.FLOWCHART_OR: {'basename': 'Or', 'avLst': ()}, MSO_SHAPE.FLOWCHART_PREDEFINED_PROCESS: {'basename': 'Predefined Process', 'avLst': ()}, MSO_SHAPE.FLOWCHART_PREPARATION: {'basename': 'Preparation', 'avLst': ()}, MSO_SHAPE.FLOWCHART_PROCESS: {'basename': 'Process', 'avLst': ()}, MSO_SHAPE.FLOWCHART_PUNCHED_TAPE: {'basename': 'Punched Tape', 'avLst': ()}, MSO_SHAPE.FLOWCHART_SEQUENTIAL_ACCESS_STORAGE: {'basename': 'Sequential Access Storage', 'avLst': ()}, MSO_SHAPE.FLOWCHART_SORT: {'basename': 'Sort', 'avLst': ()}, MSO_SHAPE.FLOWCHART_STORED_DATA: {'basename': 'Stored Data', 'avLst': ()}, MSO_SHAPE.FLOWCHART_SUMMING_JUNCTION: {'basename': 'Summing Junction', 'avLst': ()}, MSO_SHAPE.FLOWCHART_TERMINATOR: {'basename': 'Terminator', 'avLst': ()}, MSO_SHAPE.FOLDED_CORNER: {'basename': 'Folded Corner', 'avLst': ()}, MSO_SHAPE.FRAME: {'basename': 'Frame', 'avLst': (('adj1', 12500),)}, MSO_SHAPE.FUNNEL: {'basename': 'Funnel', 'avLst': ()}, MSO_SHAPE.GEAR_6: {'basename': 'Gear 6', 'avLst': (('adj1', 15000), ('adj2', 3526))}, MSO_SHAPE.GEAR_9: {'basename': 'Gear 9', 'avLst': (('adj1', 10000), ('adj2', 1763))}, MSO_SHAPE.HALF_FRAME: {'basename': 'Half Frame', 'avLst': (('adj1', 33333), ('adj2', 33333))}, MSO_SHAPE.HEART: {'basename': 'Heart', 'avLst': ()}, MSO_SHAPE.HEPTAGON: {'basename': 'Heptagon', 'avLst': (('hf', 102572), ('vf', 105210))}, MSO_SHAPE.HEXAGON: {'basename': 'Hexagon', 'avLst': (('adj', 25000), ('vf', 115470))}, MSO_SHAPE.HORIZONTAL_SCROLL: {'basename': 'Horizontal Scroll', 'avLst': (('adj', 12500),)}, MSO_SHAPE.ISOSCELES_TRIANGLE: {'basename': 'Isosceles Triangle', 'avLst': (('adj', 50000),)}, MSO_SHAPE.LEFT_ARROW: {'basename': 'Left Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.LEFT_ARROW_CALLOUT: {'basename': 'Left Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 64977))}, MSO_SHAPE.LEFT_BRACE: {'basename': 'Left Brace', 'avLst': (('adj1', 8333), ('adj2', 50000))}, MSO_SHAPE.LEFT_BRACKET: {'basename': 'Left Bracket', 'avLst': (('adj', 8333),)}, MSO_SHAPE.LEFT_CIRCULAR_ARROW: {'basename': 'Left Circular Arrow', 'avLst': (('adj1', 12500), ('adj2', -1142319), ('adj3', 1142319), ('adj4', 10800000), ('adj5', 12500))}, MSO_SHAPE.LEFT_RIGHT_ARROW: {'basename': 'Left-Right Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.LEFT_RIGHT_ARROW_CALLOUT: {'basename': 'Left-Right Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 48123))}, MSO_SHAPE.LEFT_RIGHT_CIRCULAR_ARROW: {'basename': 'Left Right Circular Arrow', 'avLst': (('adj1', 12500), ('adj2', 1142319), ('adj3', 20457681), ('adj4', 11942319), ('adj5', 12500))}, MSO_SHAPE.LEFT_RIGHT_RIBBON: {'basename': 'Left Right Ribbon', 'avLst': (('adj1', 50000), ('adj2', 50000), ('adj3', 16667))}, MSO_SHAPE.LEFT_RIGHT_UP_ARROW: {'basename': 'Left-Right-Up Arrow', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000))}, MSO_SHAPE.LEFT_UP_ARROW: {'basename': 'Left-Up Arrow', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000))}, MSO_SHAPE.LIGHTNING_BOLT: {'basename': 'Lightning Bolt', 'avLst': ()}, MSO_SHAPE.LINE_CALLOUT_1: {'basename': 'Line Callout 1', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 112500), ('adj4', -38333))}, MSO_SHAPE.LINE_CALLOUT_1_ACCENT_BAR: {'basename': 'Line Callout 1 (Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 112500), ('adj4', -38333))}, MSO_SHAPE.LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR: {'basename': 'Line Callout 1 (Border and Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 112500), ('adj4', -38333))}, MSO_SHAPE.LINE_CALLOUT_1_NO_BORDER: {'basename': 'Line Callout 1 (No Border)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 112500), ('adj4', -38333))}, MSO_SHAPE.LINE_CALLOUT_2: {'basename': 'Line Callout 2', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 112500), ('adj6', -46667))}, MSO_SHAPE.LINE_CALLOUT_2_ACCENT_BAR: {'basename': 'Line Callout 2 (Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 112500), ('adj6', -46667))}, MSO_SHAPE.LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR: {'basename': 'Line Callout 2 (Border and Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 112500), ('adj6', -46667))}, MSO_SHAPE.LINE_CALLOUT_2_NO_BORDER: {'basename': 'Line Callout 2 (No Border)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 112500), ('adj6', -46667))}, MSO_SHAPE.LINE_CALLOUT_3: {'basename': 'Line Callout 3', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_3_ACCENT_BAR: {'basename': 'Line Callout 3 (Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR: {'basename': 'Line Callout 3 (Border and Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_3_NO_BORDER: {'basename': 'Line Callout 3 (No Border)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_4: {'basename': 'Line Callout 3', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_4_ACCENT_BAR: {'basename': 'Line Callout 3 (Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR: {'basename': 'Line Callout 3 (Border and Accent Bar)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_CALLOUT_4_NO_BORDER: {'basename': 'Line Callout 3 (No Border)', 'avLst': (('adj1', 18750), ('adj2', -8333), ('adj3', 18750), ('adj4', -16667), ('adj5', 100000), ('adj6', -16667), ('adj7', 112963), ('adj8', -8333))}, MSO_SHAPE.LINE_INVERSE: {'basename': 'Straight Connector', 'avLst': ()}, MSO_SHAPE.MATH_DIVIDE: {'basename': 'Division', 'avLst': (('adj1', 23520), ('adj2', 5880), ('adj3', 11760))}, MSO_SHAPE.MATH_EQUAL: {'basename': 'Equal', 'avLst': (('adj1', 23520), ('adj2', 11760))}, MSO_SHAPE.MATH_MINUS: {'basename': 'Minus', 'avLst': (('adj1', 23520),)}, MSO_SHAPE.MATH_MULTIPLY: {'basename': 'Multiply', 'avLst': (('adj1', 23520),)}, MSO_SHAPE.MATH_NOT_EQUAL: {'basename': 'Not Equal', 'avLst': (('adj1', 23520), ('adj2', 6600000), ('adj3', 11760))}, MSO_SHAPE.MATH_PLUS: {'basename': 'Plus', 'avLst': (('adj1', 23520),)}, MSO_SHAPE.MOON: {'basename': 'Moon', 'avLst': (('adj', 50000),)}, MSO_SHAPE.NON_ISOSCELES_TRAPEZOID: {'basename': 'Non-isosceles Trapezoid', 'avLst': (('adj1', 25000), ('adj2', 25000))}, MSO_SHAPE.NOTCHED_RIGHT_ARROW: {'basename': 'Notched Right Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.NO_SYMBOL: {'basename': '"No" Symbol', 'avLst': (('adj', 18750),)}, MSO_SHAPE.OCTAGON: {'basename': 'Octagon', 'avLst': (('adj', 29289),)}, MSO_SHAPE.OVAL: {'basename': 'Oval', 'avLst': ()}, MSO_SHAPE.OVAL_CALLOUT: {'basename': 'Oval Callout', 'avLst': (('adj1', -20833), ('adj2', 62500))}, MSO_SHAPE.PARALLELOGRAM: {'basename': 'Parallelogram', 'avLst': (('adj', 25000),)}, MSO_SHAPE.PENTAGON: {'basename': 'Pentagon', 'avLst': (('adj', 50000),)}, MSO_SHAPE.PIE: {'basename': 'Pie', 'avLst': (('adj1', 0), ('adj2', 16200000))}, MSO_SHAPE.PIE_WEDGE: {'basename': 'Pie', 'avLst': ()}, MSO_SHAPE.PLAQUE: {'basename': 'Plaque', 'avLst': (('adj', 16667),)}, MSO_SHAPE.PLAQUE_TABS: {'basename': 'Plaque Tabs', 'avLst': ()}, MSO_SHAPE.QUAD_ARROW: {'basename': 'Quad Arrow', 'avLst': (('adj1', 22500), ('adj2', 22500), ('adj3', 22500))}, MSO_SHAPE.QUAD_ARROW_CALLOUT: {'basename': 'Quad Arrow Callout', 'avLst': (('adj1', 18515), ('adj2', 18515), ('adj3', 18515), ('adj4', 48123))}, MSO_SHAPE.RECTANGLE: {'basename': 'Rectangle', 'avLst': ()}, MSO_SHAPE.RECTANGULAR_CALLOUT: {'basename': 'Rectangular Callout', 'avLst': (('adj1', -20833), ('adj2', 62500))}, MSO_SHAPE.REGULAR_PENTAGON: {'basename': 'Regular Pentagon', 'avLst': (('hf', 105146), ('vf', 110557))}, MSO_SHAPE.RIGHT_ARROW: {'basename': 'Right Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.RIGHT_ARROW_CALLOUT: {'basename': 'Right Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 64977))}, MSO_SHAPE.RIGHT_BRACE: {'basename': 'Right Brace', 'avLst': (('adj1', 8333), ('adj2', 50000))}, MSO_SHAPE.RIGHT_BRACKET: {'basename': 'Right Bracket', 'avLst': (('adj', 8333),)}, MSO_SHAPE.RIGHT_TRIANGLE: {'basename': 'Right Triangle', 'avLst': ()}, MSO_SHAPE.ROUNDED_RECTANGLE: {'basename': 'Rounded Rectangle', 'avLst': (('adj', 16667),)}, MSO_SHAPE.ROUNDED_RECTANGULAR_CALLOUT: {'basename': 'Rounded Rectangular Callout', 'avLst': (('adj1', -20833), ('adj2', 62500), ('adj3', 16667))}, MSO_SHAPE.ROUND_1_RECTANGLE: {'basename': 'Round Single Corner Rectangle', 'avLst': (('adj', 16667),)}, MSO_SHAPE.ROUND_2_DIAG_RECTANGLE: {'basename': 'Round Diagonal Corner Rectangle', 'avLst': (('adj1', 16667), ('adj2', 0))}, MSO_SHAPE.ROUND_2_SAME_RECTANGLE: {'basename': 'Round Same Side Corner Rectangle', 'avLst': (('adj1', 16667), ('adj2', 0))}, MSO_SHAPE.SMILEY_FACE: {'basename': 'Smiley Face', 'avLst': (('adj', 4653),)}, MSO_SHAPE.SNIP_1_RECTANGLE: {'basename': 'Snip Single Corner Rectangle', 'avLst': (('adj', 16667),)}, MSO_SHAPE.SNIP_2_DIAG_RECTANGLE: {'basename': 'Snip Diagonal Corner Rectangle', 'avLst': (('adj1', 0), ('adj2', 16667))}, MSO_SHAPE.SNIP_2_SAME_RECTANGLE: {'basename': 'Snip Same Side Corner Rectangle', 'avLst': (('adj1', 16667), ('adj2', 0))}, MSO_SHAPE.SNIP_ROUND_RECTANGLE: {'basename': 'Snip and Round Single Corner Rectangle', 'avLst': (('adj1', 16667), ('adj2', 16667))}, MSO_SHAPE.SQUARE_TABS: {'basename': 'Square Tabs', 'avLst': ()}, MSO_SHAPE.STAR_10_POINT: {'basename': '10-Point Star', 'avLst': (('adj', 42533), ('hf', 105146))}, MSO_SHAPE.STAR_12_POINT: {'basename': '12-Point Star', 'avLst': (('adj', 37500),)}, MSO_SHAPE.STAR_16_POINT: {'basename': '16-Point Star', 'avLst': (('adj', 37500),)}, MSO_SHAPE.STAR_24_POINT: {'basename': '24-Point Star', 'avLst': (('adj', 37500),)}, MSO_SHAPE.STAR_32_POINT: {'basename': '32-Point Star', 'avLst': (('adj', 37500),)}, MSO_SHAPE.STAR_4_POINT: {'basename': '4-Point Star', 'avLst': (('adj', 12500),)}, MSO_SHAPE.STAR_5_POINT: {'basename': '5-Point Star', 'avLst': (('adj', 19098), ('hf', 105146), ('vf', 110557))}, MSO_SHAPE.STAR_6_POINT: {'basename': '6-Point Star', 'avLst': (('adj', 28868), ('hf', 115470))}, MSO_SHAPE.STAR_7_POINT: {'basename': '7-Point Star', 'avLst': (('adj', 34601), ('hf', 102572), ('vf', 105210))}, MSO_SHAPE.STAR_8_POINT: {'basename': '8-Point Star', 'avLst': (('adj', 37500),)}, MSO_SHAPE.STRIPED_RIGHT_ARROW: {'basename': 'Striped Right Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.SUN: {'basename': 'Sun', 'avLst': (('adj', 25000),)}, MSO_SHAPE.SWOOSH_ARROW: {'basename': 'Swoosh Arrow', 'avLst': (('adj1', 25000), ('adj2', 16667))}, MSO_SHAPE.TEAR: {'basename': 'Teardrop', 'avLst': (('adj', 100000),)}, MSO_SHAPE.TRAPEZOID: {'basename': 'Trapezoid', 'avLst': (('adj', 25000),)}, MSO_SHAPE.UP_ARROW: {'basename': 'Up Arrow', 'avLst': (('adj1', 50000), ('adj2', 50000))}, MSO_SHAPE.UP_ARROW_CALLOUT: {'basename': 'Up Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 64977))}, MSO_SHAPE.UP_DOWN_ARROW: {'basename': 'Up-Down Arrow', 'avLst': (('adj1', 50000), ('adj1', 50000), ('adj2', 50000), ('adj2', 50000))}, MSO_SHAPE.UP_DOWN_ARROW_CALLOUT: {'basename': 'Up-Down Arrow Callout', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 48123))}, MSO_SHAPE.UP_RIBBON: {'basename': 'Up Ribbon', 'avLst': (('adj1', 16667), ('adj2', 50000))}, MSO_SHAPE.U_TURN_ARROW: {'basename': 'U-Turn Arrow', 'avLst': (('adj1', 25000), ('adj2', 25000), ('adj3', 25000), ('adj4', 43750), ('adj5', 75000))}, MSO_SHAPE.VERTICAL_SCROLL: {'basename': 'Vertical Scroll', 'avLst': (('adj', 12500),)}, MSO_SHAPE.WAVE: {'basename': 'Wave', 'avLst': (('adj1', 12500), ('adj2', 0))}} +``` + + + + + +# `pptx.table` + +Table-related objects such as Table and Cell. + +## `Table` + +```python +Table(tbl: CT_Table, graphic_frame: GraphicFrame) +``` + +Bases: `object` + +A DrawingML table object. + +Not intended to be constructed directly, use +`.Slide.shapes.add_table` to add a table to a slide. + +### `cell` + +```python +cell(row_idx: int, col_idx: int) -> _Cell +``` + +Return cell at `row_idx`, `col_idx`. + +Return value is an instance of `_Cell`. `row_idx` and `col_idx` are zero-based, e.g. +cell(0, 0) is the top, left cell in the table. + +### `columns` + +```python +columns() -> _ColumnCollection +``` + +`_ColumnCollection` instance for this table. + +Provides access to `_Column` objects representing the table's columns. `_Column` objects +are accessed using list notation, e.g. `col = tbl.columns[0]`. + +### `delete_column` + +```python +delete_column(col_idx: int) -> None +``` + +Remove the column at 0-based `col_idx`, cells included. + +paper-pptx addition. The `a:gridCol` and every row's cell at that +grid position are removed together, so each row keeps exactly one `a:tc` per grid +column, and the graphic frame's width is recalculated from the remaining columns. + +Merged-cell guard is cell-wise: the operation refuses +(`UnsupportedStructureError`, tree untouched) only when a *horizontal* merge extends +beyond the deleted column - a vertical merge lying wholly inside the column is +deleted with it. Deleting the last remaining column raises `ValueError` (delete the +table's shape instead). + +### `delete_row` + +```python +delete_row(row_idx: int) -> None +``` + +Remove the row at 0-based `row_idx`, cells included. + +paper-pptx addition. The graphic frame's height is recalculated +from the remaining rows. + +Merged-cell guard is cell-wise: the operation refuses +(`UnsupportedStructureError`, tree untouched) only when a *vertical* merge extends +beyond the deleted row - a horizontal merge lying wholly inside the row (e.g. a +merged header) is deleted with it and must not poison other rows' operations. +Deleting the last remaining row raises `ValueError`. + +### `first_col` + +```python +first_col: bool +``` + +When `True`, indicates first column should have distinct formatting. + +Read/write. Distinct formatting is used, for example, when the first column contains row +headings (is a side-heading column). + +### `first_row` + +```python +first_row: bool +``` + +When `True`, indicates first row should have distinct formatting. + +Read/write. Distinct formatting is used, for example, when the first row contains column +headings. + +### `horz_banding` + +```python +horz_banding: bool +``` + +When `True`, indicates rows should have alternating shading. + +Read/write. Used to allow rows to be traversed more easily without losing track of which +row is being read. + +### `insert_column` + +```python +insert_column(after: int, *, width: Length | None = None, copy_format_from: int | None = None) -> _Column +``` + +Insert a new empty column immediately after 0-based column `after`; return it. + +paper-pptx addition. `after=-1` inserts before the first column. +`copy_format_from` is the zero-based index of a column in the table before insertion. +When provided, each new cell receives a deep copy of that row's template-cell `a:tcPr` +(direct formatting only); text and merge state are never copied. `width` (EMU int) wins +when provided, otherwise the template column supplies the width. With no template, width +defaults to the neighboring column at `after` (the first column when `after=-1`). A new +minimal empty cell is inserted at the same grid position in every row - the grid stays +consistent by construction - and the graphic frame's width is recalculated. + +Merged-cell guard is cell-wise: refuses (`UnsupportedStructureError`, tree +untouched) only when the insertion boundary would split a horizontal merge; vertical +merges elsewhere in the table never block the operation. + +### `insert_row` + +```python +insert_row(after: int, *, copy_format_from: int | None = None) -> _Row +``` + +Insert a new empty row immediately after 0-based row `after`; return it. + +paper-pptx addition. `after=-1` inserts before the first row. The +new row holds one minimal empty cell per grid column. Row height and per-cell +formatting (each cell's `a:tcPr`: fill, margins, anchor) are copied from the row at +`copy_format_from` when given, otherwise the height of the neighboring row at +`after` (the first row when `after=-1`) is used and cells carry default formatting. +Merge attributes are never copied - the new row is always unmerged. Text is never +copied. The graphic frame's height is recalculated. + +Merged-cell guard is cell-wise: refuses (`UnsupportedStructureError`, tree +untouched) only when the insertion boundary would split a vertical merge; a merged +header row never blocks body-row insertion. + +### `iter_cells` + +```python +iter_cells() -> Iterator[_Cell] +``` + +Generate _Cell object for each cell in this table. + +Each grid cell is generated in left-to-right, top-to-bottom order. + +### `last_col` + +```python +last_col: bool +``` + +When `True`, indicates the rightmost column should have distinct formatting. + +Read/write. Used, for example, when a row totals column appears at the far right of the +table. + +### `last_row` + +```python +last_row: bool +``` + +When `True`, indicates the bottom row should have distinct formatting. + +Read/write. Used, for example, when a totals row appears as the bottom row. + +### `notify_height_changed` + +```python +notify_height_changed() -> None +``` + +Called by a row when its height changes. + +Triggers the graphic frame to recalculate its total height (as the sum of the row +heights). + +### `notify_width_changed` + +```python +notify_width_changed() -> None +``` + +Called by a column when its width changes. + +Triggers the graphic frame to recalculate its total width (as the sum of the column +widths). + +### `part` + +```python +part: BaseSlidePart +``` + +The package part containing this table. + +### `rows` + +```python +rows() +``` + +`_RowCollection` instance for this table. + +Provides access to `_Row` objects representing the table's rows. `_Row` objects are +accessed using list notation, e.g. `col = tbl.rows[0]`. + +### `vert_banding` + +```python +vert_banding: bool +``` + +When `True`, indicates columns should have alternating shading. + +Read/write. Used to allow columns to be traversed more easily without losing track of +which column is being read. diff --git a/addons/sandbox/skills/pptx/references/api-005.md b/addons/sandbox/skills/pptx/references/api-005.md new file mode 100644 index 000000000..af8081acf --- /dev/null +++ b/addons/sandbox/skills/pptx/references/api-005.md @@ -0,0 +1,689 @@ + + + + +# `pptx.text.bullet` + +BulletFormat proxy, providing bullet and numbering control for a paragraph (paper-pptx). + +## `BulletFormat` + +```python +BulletFormat(p: CT_TextParagraph, part: CT_TextParagraph = None) +``` + +Bases: `object` + +Bullet and numbering state of a single paragraph. + +Read properties report this paragraph's **local** `a:pPr` state only: `None` means "nothing +set here", in which case rendering inherits from the placeholder/list-style chain (use the +effective-style inspection API to see what actually renders). + +Wrap a paragraph's bullet properties. + +Passing `part` enables the attachment check and the rollback boundary that the setters use. + +### `char` + +```python +char: str | None +``` + +The bullet character (`a:buChar/@char`), `None` unless a character bullet is set. + +### `font_name` + +```python +font_name: str | None +``` + +Bullet-specific typeface (`a:buFont/@typeface`), or `None` when not set locally. + +### `number_scheme` + +```python +number_scheme: str | None +``` + +Numbering scheme token (`a:buAutoNum/@type`), e.g. "arabicPeriod", or `None`. + +### `set_character` + +```python +set_character(char: str = '•', *, font_name: str | None = None, size_percent: float | None = None, left_margin: Length | None = DEFAULT_BULLET_LEFT_MARGIN, hanging_indent: Length | None = DEFAULT_BULLET_HANGING_INDENT) -> None +``` + +Give this paragraph a real character bullet (`a:buChar`). + +`left_margin`/`hanging_indent` write `marL`/`indent` so the bullet hangs correctly; +pass `None` for either to leave the existing paragraph attribute untouched. +`font_name` sets a bullet-specific typeface (`a:buFont`); `size_percent` scales the +bullet relative to the text size (fraction, 0.25–4.0). + +### `set_none` + +```python +set_none() -> None +``` + +Set an explicit "no bullet" (`a:buNone`), overriding any inherited bullet. + +Margins, bullet font, and bullet size attributes are left untouched. + +### `set_numbered` + +```python +set_numbered(scheme: str = 'arabicPeriod', *, start_at: int = 1, font_name: str | None = None, size_percent: float | None = None, left_margin: Length | None = DEFAULT_BULLET_LEFT_MARGIN, hanging_indent: Length | None = DEFAULT_BULLET_HANGING_INDENT) -> None +``` + +Give this paragraph PowerPoint automatic numbering (`a:buAutoNum`). + +`scheme` is an ECMA-376 auto-number token like "arabicPeriod" or "romanUcParenR"; +an unknown token raises `ValueError`. Numbering restarts at `start_at`. + +### `size_percent` + +```python +size_percent: float | None +``` + +Bullet size as a fraction of the text size (`a:buSzPct`), e.g. 0.75, or `None`. + +### `start_at` + +```python +start_at: int | None +``` + +First number of an auto-numbered sequence, `None` unless numbering is set. + +### `type` + +```python +type: PP_BULLET_TYPE | None +``` + +Kind of bullet explicitly set on this paragraph, `None` when nothing local is set. + +## `DEFAULT_BULLET_HANGING_INDENT` + +```python +DEFAULT_BULLET_HANGING_INDENT = Emu(171450) +``` + +## `DEFAULT_BULLET_LEFT_MARGIN` + +```python +DEFAULT_BULLET_LEFT_MARGIN = Emu(342900) +``` + + + + + +# `pptx.text.fonts` + +Objects related to system font file lookup. + +## `FontFiles` + +Bases: `object` + +A class-based singleton serving as a lazy cache for system font details. + +### `find` + +```python +find(family_name: str, is_bold: bool, is_italic: bool) -> str +``` + +Return the absolute path to an installed OpenType font. + +File is matched by `family_name` and the styles `is_bold` and `is_italic`. + + + + + +# `pptx.text.layout` + +Objects related to layout of rendered text, such as TextFitter. + +## `TextFitter` + +Bases: `tuple` + +Value object that knows how to fit text into given rectangular extents. + +### `best_fit_font_size` + +```python +best_fit_font_size(text: str, extents: tuple[Length, Length], max_size: int, font_file: str) -> int +``` + +Return whole-number best fit point size less than or equal to `max_size`. + +The return value is the largest whole-number point size less than or equal to +`max_size` that allows `text` to fit completely within `extents` when rendered +using font defined in `font_file`. + + + + + +# `pptx.text.text` + +Text-related objects such as TextFrame and Paragraph. + +## `Font` + +```python +Font(rPr: CT_TextCharacterProperties) +``` + +Bases: `object` + +Character properties object, providing font size, font name, bold, italic, etc. + +Corresponds to `a:rPr` child element of a run. Also appears as `a:defRPr` and +`a:endParaRPr` in paragraph and `a:defRPr` in list style elements. + +### `bold` + +```python +bold: bool | None +``` + +Get or set boolean bold value of `Font`, e.g. `paragraph.font.bold = True`. + +If set to `None`, the bold setting is cleared and is inherited from an enclosing shape's +setting, or a setting in a style or master. Returns None if no bold attribute is present, +meaning the effective bold value is inherited from a master or the theme. + +### `color` + +```python +color() -> ColorFormat +``` + +The `ColorFormat` instance that provides access to the color settings for this font. + +### `fill` + +```python +fill() -> FillFormat +``` + +`FillFormat` instance for this font. + +Provides access to fill properties such as fill color. + +### `italic` + +```python +italic: bool | None +``` + +Get or set boolean italic value of `Font` instance. + +Has the same behaviors as bold with respect to None values. + +### `language_id` + +```python +language_id: MSO_LANGUAGE_ID | None +``` + +Get or set the language id of this `Font` instance. + +The language id is a member of the `MsoLanguageId` enumeration. Assigning `None` +removes any language setting, the same behavior as assigning `MSO_LANGUAGE_ID.NONE`. + +### `name` + +```python +name: str | None +``` + +Get or set the typeface name for this `Font` instance. + +Causes the text it controls to appear in the named font, if a matching font is found. +Returns `None` if the typeface is currently inherited from the theme. Setting it to `None` +removes any override of the theme typeface. + +### `size` + +```python +size: Length | None +``` + +Indicates the font height in English Metric Units (EMU). + +Read/write. `None` indicates the font size should be inherited from its style hierarchy, +such as a placeholder or document defaults (usually 18pt). `Length` is a subclass of `int` +having properties for convenient conversion into points or other length units. Likewise, +the `pptx.util.Pt` class allows convenient specification of point values:: + + >>> font.size = Pt(24) + >>> font.size + 304800 + >>> font.size.pt + 24.0 + +### `underline` + +```python +underline: bool | MSO_TEXT_UNDERLINE_TYPE | None +``` + +Indicaties the underline setting for this font. + +Value is `True`, `False`, `None`, or a member of the `MsoTextUnderlineType` +enumeration. `None` is the default and indicates the underline setting should be inherited +from the style hierarchy, such as from a placeholder. `True` indicates single underline. +`False` indicates no underline. Other settings such as double and wavy underlining are +indicated with members of the `MsoTextUnderlineType` enumeration. + +## `TextFrame` + +```python +TextFrame(txBody: CT_TextBody, parent: ProvidesPart) +``` + +Bases: `Subshape` + +The part of a shape that contains its text. + +Not all shapes have a text frame. Corresponds to the `p:txBody` element that can +appear as a child element of `p:sp`. Not intended to be constructed directly. + +### `add_paragraph` + +```python +add_paragraph() +``` + +Return new `_Paragraph` instance appended to the sequence of +paragraphs contained in this text frame. + +### `auto_size` + +```python +auto_size: MSO_AUTO_SIZE | None +``` + +Resizing strategy used to fit text within this shape. + +Determins the type of automatic resizing used to fit the text of this shape within its +bounding box when the text would otherwise extend beyond the shape boundaries. May be +`None`, `MSO_AUTO_SIZE.NONE`, `MSO_AUTO_SIZE.SHAPE_TO_FIT_TEXT`, or +`MSO_AUTO_SIZE.TEXT_TO_FIT_SHAPE`. + +### `clear` + +```python +clear() +``` + +Remove all paragraphs except one empty one. + +### `fit_text` + +```python +fit_text(font_family: str = 'Calibri', max_size: int = 18, bold: bool = False, italic: bool = False, font_file: str | None = None) +``` + +Fit text-frame text entirely within bounds of its shape. + +Make the text in this text frame fit entirely within the bounds of its shape by setting +word wrap on and applying the "best-fit" font size to all the text it contains. + +`TextFrame.auto_size` is set to `MSO_AUTO_SIZE.NONE`. The font size will not +be set larger than `max_size` points. If the path to a matching TrueType font is provided +as `font_file`, that font file will be used for the font metrics. If `font_file` is `None`, +best efforts are made to locate a font file with matchhing `font_family`, `bold`, and +`italic` installed on the current system (usually succeeds if the font is installed). + +### `font_scale` + +```python +font_scale: float | None +``` + +Font scale percent of this frame's `a:normAutofit`, e.g. 62.5 (paper-pptx addition). + +100.0 when the frame has `a:normAutofit` with no explicit scale; `None` when the +frame's autofit setting is anything other than `a:normAutofit`. Read-only: PowerPoint +owns this value (it records the shrink-to-fit reduction last applied); use +`normalize_autofit` to freeze it into explicit sizes. + +### `line_space_reduction` + +```python +line_space_reduction: float | None +``` + +Line-spacing reduction percent of `a:normAutofit`, e.g. 20.0 (paper-pptx addition). + +0.0 when the frame has `a:normAutofit` with no explicit reduction; `None` when the +frame's autofit setting is anything other than `a:normAutofit`. Read-only. + +### `margin_bottom` + +```python +margin_bottom: Length +``` + +`Length` value representing the inset of text from the bottom text frame border. + +`pptx.util.Inches` provides a convenient way of setting the value, e.g. +`text_frame.margin_bottom = Inches(0.05)`. + +### `margin_left` + +```python +margin_left: Length +``` + +Inset of text from left text frame border as `Length` value. + +### `margin_right` + +```python +margin_right: Length +``` + +Inset of text from right text frame border as `Length` value. + +### `margin_top` + +```python +margin_top: Length +``` + +Inset of text from top text frame border as `Length` value. + +### `normalize_autofit` + +```python +normalize_autofit(*, min_font_size: Length | None = None, resolve: bool = False) -> None +``` + +Freeze this frame's rendered text metrics and set explicit no-autofit. + +paper-pptx addition. What the reader currently sees is made explicit, then the frame's +autofit is set to `a:noAutofit`: + +- `a:normAutofit` with a font scale: every explicit font size in the frame (run, + paragraph-default, and end-paragraph properties) is multiplied by the scale. If any + run's size is not locally resolvable (neither its own `sz` nor its paragraph's + default), `UnsupportedStructureError` is raised — unless `resolve=True`, in which + case the size is resolved through the effective-style walk (placeholder → layout → + master → theme) and frozen from the resolved value; what the walk cannot resolve + still refuses. This API never silently guesses. +- `a:normAutofit` with a line-spacing reduction: every paragraph's explicit line + spacing is reduced accordingly; any paragraph without explicit line spacing raises + `UnsupportedStructureError` (`resolve` covers font sizes only in this version). +- `a:spAutoFit`, `a:noAutofit`, or no autofit element: no text metrics change. + +`min_font_size` (a `Length`, e.g. `Pt(11)`) is applied after freezing: explicit sizes +below the floor are raised to it. Validation completes fully before the first write +(a refusal leaves the frame byte-identical). + +### `paragraphs` + +```python +paragraphs: tuple[_Paragraph, ...] +``` + +Sequence of paragraphs in this text frame. + +A text frame always contains at least one paragraph. + +### `text` + +```python +text: str +``` + +All text in this text-frame as a single string. + +Read/write. The return value contains all text in this text-frame. A line-feed character +(`"\n"`) separates the text for each paragraph. A vertical-tab character (`"\v"`) appears +for each line break (aka. soft carriage-return) encountered. + +The vertical-tab character is how PowerPoint represents a soft carriage return in clipboard +text, which is why that encoding was chosen. + +Assignment replaces all text in the text frame. A new paragraph is added for each line-feed +character (`"\n"`) encountered. A line-break (soft carriage-return) is inserted for each +vertical-tab character (`"\v"`) encountered. + +Any control character other than newline, tab, or vertical-tab are escaped as plain-text +like "_x001B_" (for ESC (ASCII 32) in this example). + +### `vertical_anchor` + +```python +vertical_anchor: MSO_VERTICAL_ANCHOR | None +``` + +Represents the vertical alignment of text in this text frame. + +`None` indicates the effective value should be inherited from this object's style hierarchy. + +### `word_wrap` + +```python +word_wrap: bool | None +``` + +`True` when lines of text in this shape are wrapped to fit within the shape's width. + +Read-write. Valid values are True, False, or None. True and False turn word wrap on and +off, respectively. Assigning None to word wrap causes any word wrap setting to be removed +from the text frame, causing it to inherit this setting from its style hierarchy. + + + + + +# `pptx.types` + +Abstract types used by `python-pptx`. + +## `ProvidesExtents` + +Bases: `Protocol` + +An object that has width and height. + +### `height` + +```python +height: Length +``` + +Distance between top and bottom extents of shape in EMUs. + +### `width` + +```python +width: Length +``` + +Distance between left and right extents of shape in EMUs. + +## `ProvidesPart` + +Bases: `Protocol` + +An object that provides access to its XmlPart. + +This type is for objects that need access to their part, possibly because they need access to +the package or related parts. + +### `part` + +```python +part: XmlPart +``` + + + + + +# `pptx.util` + +Utility functions and classes. + +## `Centipoints` + +Bases: `Length` + +Convenience constructor for length in hundredths of a point. + +## `Cm` + +Bases: `Length` + +Convenience constructor for length in centimeters. + +## `Emu` + +Bases: `Length` + +Convenience constructor for length in english metric units. + +## `Inches` + +Bases: `Length` + +Convenience constructor for length in inches. + +## `Length` + +Bases: `int` + +Base class for length classes Inches, Emu, Cm, Mm, and Pt. + +Provides properties for converting length values to convenient units. + +### `centipoints` + +```python +centipoints: int +``` + +Integer length in hundredths of a point (1/7200 inch). + +Used internally because PowerPoint stores font size in centipoints. + +### `cm` + +```python +cm: float +``` + +Floating point length in centimeters. + +### `emu` + +```python +emu: int +``` + +Integer length in English Metric Units. + +### `inches` + +```python +inches: float +``` + +Floating point length in inches. + +### `mm` + +```python +mm: float +``` + +Floating point length in millimeters. + +### `pt` + +```python +pt: float +``` + +Floating point length in points. + +## `Mm` + +Bases: `Length` + +Convenience constructor for length in millimeters. + +## `Pt` + +Bases: `Length` + +Convenience value class for specifying a length in points. + +## `lazyproperty` + +```python +lazyproperty(fget: Callable[..., _T]) -> None +``` + +Bases: `Generic[_T]` + +Decorator like @property, but evaluated only on first access. + +Like @property, this can only be used to decorate methods having only a `self` parameter, and +is accessed like an attribute on an instance, i.e. trailing parentheses are not used. Unlike +@property, the decorated method is only evaluated on first access; the resulting value is +cached and that same value returned on second and later access without re-evaluation of the +method. + +Like @property, this class produces a *data descriptor* object, which is stored in the __dict__ +of the *class* under the name of the decorated method ('fget' nominally). The cached value is +stored in the __dict__ of the *instance* under that same name. + +Because it is a data descriptor (as opposed to a *non-data descriptor*), its `__get__()` method +is executed on each access of the decorated attribute; the __dict__ item of the same name is +"shadowed" by the descriptor. + +While this may represent a performance improvement over a property, its greater benefit may be +its other characteristics. One common use is to construct collaborator objects, removing that +"real work" from the constructor, while still only executing once. It also de-couples client +code from any sequencing considerations; if it's accessed from more than one location, it's +assured it will be ready whenever needed. + +Loosely based on: https://stackoverflow.com/a/6849299/1902513. + +A lazyproperty is read-only. There is no counterpart to the optional "setter" (or deleter) +behavior of an @property. This is critically important to maintaining its immutability and +idempotence guarantees. Attempting to assign to a lazyproperty raises AttributeError +unconditionally. + +The parameter names in the methods below correspond to this usage example:: + + class Obj(object) + + @lazyproperty + def fget(self): + return 'some result' + + obj = Obj() + +Not suitable for wrapping a function (as opposed to a method) because it is not callable. + +*fget* is the decorated method (a "getter" function). + +A lazyproperty is read-only, so there is only an *fget* function (a regular +@property can also have an fset and fdel function). This name was chosen for +consistency with Python's `property` class which uses this name for the +corresponding parameter. diff --git a/core/services/studio/builtinskills/tree/pptx/references/paper-api.md b/addons/sandbox/skills/pptx/references/paper-api.md similarity index 99% rename from core/services/studio/builtinskills/tree/pptx/references/paper-api.md rename to addons/sandbox/skills/pptx/references/paper-api.md index e10da3f8d..1972f0e22 100644 --- a/core/services/studio/builtinskills/tree/pptx/references/paper-api.md +++ b/addons/sandbox/skills/pptx/references/paper-api.md @@ -1,3 +1,5 @@ + + # Paper PPTX API companion This companion covers capabilities beyond familiar `python-pptx`. The installed distribution is diff --git a/core/services/studio/builtinskills/tree/xlsx/SKILL.md b/addons/sandbox/skills/xlsx/SKILL.md similarity index 89% rename from core/services/studio/builtinskills/tree/xlsx/SKILL.md rename to addons/sandbox/skills/xlsx/SKILL.md index ceb046a3c..aa1f575f7 100644 --- a/core/services/studio/builtinskills/tree/xlsx/SKILL.md +++ b/addons/sandbox/skills/xlsx/SKILL.md @@ -22,7 +22,7 @@ Use your existing knowledge of `openpyxl` for worksheets, cells, formulas, style `paper-xlsx` is installed under the `openpyxl` import. -The [Paper API companion](references/paper-api.md) maps Paper-specific capabilities to their public symbols. The [generated API reference](references/api/index.md) covers the complete public API, including the surface inherited from `openpyxl`, with one page per module. It is large; search by symbol and read only the relevant section. +The [Paper API companion](references/paper-api.md#source-1d5d2fa5f7f8302a) maps Paper-specific capabilities to their public symbols. The [generated API reference](references/api-003.md#source-52f276c95ae6d391) covers the complete public API, including the surface inherited from `openpyxl`, with one page per module. It is large; search by symbol and read only the relevant section. ## Package behavior diff --git a/addons/sandbox/skills/xlsx/notice.txt b/addons/sandbox/skills/xlsx/notice.txt new file mode 100644 index 000000000..e2afba80e --- /dev/null +++ b/addons/sandbox/skills/xlsx/notice.txt @@ -0,0 +1,107 @@ +Sandbox document skills +============================= + +The skills "docx", "xlsx", "pptx" and "pdf" are adapted from the skills of the +Feather project. + + Source: https://github.com/paper-instruments/feather-train + (folder feather-harness/src/feather_harness/skills) + Commit: b7463092af862ebbdf4c5920c4bc9ab38ab17ad9 + Licence: MIT, Copyright (c) 2026 Paper Instruments, Inc. + +What was changed: the text about LibreOffice was replaced by a note that +LibreOffice is not installed, the text about OCR was shortened in the same way, +and the generated page of the LibreOffice-backed module "openpyxl.oracle" got +the same note. Each of the four got one line that says to write +helper scripts in the chat's work folder. The remaining built-in skills are not part of this package. + +The MIT licence of the Feather project +-------------------------------------- + +MIT License + +Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +The generated API pages +----------------------- + +The pages under docx/references/api, xlsx/references/api and +pptx/references/api are generated from the docstrings of the Paper libraries +and of the libraries that they extend. The licences of those projects apply to +that text. All three are MIT licences. + +paper-docx extends python-docx, and paper-pptx extends python-pptx. Steve Canny +wrote both upstream libraries, so the two licence files of the Paper packages +have the same text. Each applies to its own package. + + paper-docx https://pypi.org/project/paper-docx/ (python-docx) + paper-pptx https://pypi.org/project/paper-pptx/ (python-pptx) + +The MIT License (MIT) +Copyright (c) 2013 Steve Canny, https://github.com/scanny +Portions Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +paper-xlsx extends openpyxl. + + paper-xlsx https://pypi.org/project/paper-xlsx/ (openpyxl) + +This software is under the MIT Licence +====================================== + +Copyright (c) 2010 openpyxl +Portions Copyright (c) 2026 Paper Instruments, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/addons/sandbox/skills/xlsx/references/api-001.md b/addons/sandbox/skills/xlsx/references/api-001.md new file mode 100644 index 000000000..bd70734ce --- /dev/null +++ b/addons/sandbox/skills/xlsx/references/api-001.md @@ -0,0 +1,7614 @@ + + + + +# `openpyxl.cell.cell` + +Manage individual cells in a spreadsheet. + +## `Cell` + +```python +Cell(worksheet, row = None, column = None, value = None, style_array = None) +``` + +Bases: `StyleableObject` + +Describes cell associated properties. + +Properties of interest include style, type, value, and address. + +### `base_date` + +```python +base_date +``` + +### `check_error` + +```python +check_error(value) +``` + +Tries to convert Error" else N/A + +### `check_string` + +```python +check_string(value) +``` + +Check string coding, length, and line break character + +### `col_idx` + +```python +col_idx +``` + +The numerical index of the column + +### `column` + +```python +column = column +``` + +Column number of this cell (1-based) + +### `column_letter` + +```python +column_letter +``` + +### `comment` + +```python +comment +``` + +Returns the comment associated with this cell + +:type: `openpyxl.comments.Comment` + +### `coordinate` + +```python +coordinate +``` + +This cell's coordinate (ex. 'A5') + +### `data_type` + +```python +data_type +``` + +### `encoding` + +```python +encoding +``` + +### `hyperlink` + +```python +hyperlink +``` + +Return the hyperlink target or an empty string + +### `internal_value` + +```python +internal_value +``` + +Always returns the value for excel. + +### `is_date` + +```python +is_date +``` + +True if the value is formatted as a date + +:type: bool + +### `offset` + +```python +offset(row = 0, column = 0) +``` + +Returns a cell location relative to this cell. + +**Parameters:** + +- **row** (`int`) – number of rows to offset +- **column** (`int`) – number of columns to offset + +### `row` + +```python +row = row +``` + +Row number of this cell (1-based) + +### `value` + +```python +value +``` + +Get or set the value held in the cell. + +## `ERROR_CODES` + +```python +ERROR_CODES = ('#NULL!', '#DIV/0!', '#VALUE!', '#REF!', '#NAME?', '#NUM!', '#N/A') +``` + +## `ILLEGAL_CHARACTERS_RE` + +```python +ILLEGAL_CHARACTERS_RE = re.compile('[\\000-\\010]|[\\013-\\014]|[\\016-\\037]') +``` + +## `KNOWN_TYPES` + +```python +KNOWN_TYPES = NUMERIC_TYPES + TIME_TYPES + STRING_TYPES + (bool, type(None)) +``` + +## `MergedCell` + +```python +MergedCell(worksheet, row = None, column = None) +``` + +Bases: `StyleableObject` + +Describes the properties of a cell in a merged cell and helps to +display the borders of the merged cell. + +The value of a MergedCell is always None. + +### `column` + +```python +column = column +``` + +### `comment` + +```python +comment = None +``` + +### `coordinate` + +```python +coordinate = Cell.coordinate +``` + +### `data_type` + +```python +data_type = 'n' +``` + +### `hyperlink` + +```python +hyperlink = None +``` + +### `row` + +```python +row = row +``` + +### `value` + +```python +value = _value +``` + +## `STRING_TYPES` + +```python +STRING_TYPES = (str, bytes, CellRichText) +``` + +## `TIME_FORMATS` + +```python +TIME_FORMATS = {datetime.datetime: numbers.FORMAT_DATE_DATETIME, datetime.date: numbers.FORMAT_DATE_YYYYMMDD2, datetime.time: numbers.FORMAT_DATE_TIME6, datetime.timedelta: numbers.FORMAT_DATE_TIMEDELTA} +``` + +## `TIME_TYPES` + +```python +TIME_TYPES = (datetime.datetime, datetime.date, datetime.time, datetime.timedelta) +``` + +## `TYPE_BOOL` + +```python +TYPE_BOOL = 'b' +``` + +## `TYPE_ERROR` + +```python +TYPE_ERROR = 'e' +``` + +## `TYPE_FORMULA` + +```python +TYPE_FORMULA = 'f' +``` + +## `TYPE_FORMULA_CACHE_STRING` + +```python +TYPE_FORMULA_CACHE_STRING = 'str' +``` + +## `TYPE_INLINE` + +```python +TYPE_INLINE = 'inlineStr' +``` + +## `TYPE_NULL` + +```python +TYPE_NULL = 'n' +``` + +## `TYPE_NUMERIC` + +```python +TYPE_NUMERIC = 'n' +``` + +## `TYPE_STRING` + +```python +TYPE_STRING = 's' +``` + +## `VALID_TYPES` + +```python +VALID_TYPES = (TYPE_STRING, TYPE_FORMULA, TYPE_NUMERIC, TYPE_BOOL, TYPE_NULL, TYPE_INLINE, TYPE_ERROR, TYPE_FORMULA_CACHE_STRING) +``` + +## `WriteOnlyCell` + +```python +WriteOnlyCell(ws = None, value = None) +``` + +## `get_time_format` + +```python +get_time_format(t) +``` + +## `get_type` + +```python +get_type(t, value) +``` + + + + + +# `openpyxl.cell.read_only` + +## `EMPTY_CELL` + +```python +EMPTY_CELL = EmptyCell() +``` + +## `EmptyCell` + +### `alignment` + +```python +alignment = None +``` + +### `border` + +```python +border = None +``` + +### `data_type` + +```python +data_type = 'n' +``` + +### `fill` + +```python +fill = None +``` + +### `font` + +```python +font = None +``` + +### `is_date` + +```python +is_date = False +``` + +### `number_format` + +```python +number_format = None +``` + +### `value` + +```python +value = None +``` + +## `ReadOnlyCell` + +```python +ReadOnlyCell(sheet, row, column, value, data_type = 'n', style_id = 0) +``` + +### `alignment` + +```python +alignment +``` + +### `border` + +```python +border +``` + +### `column` + +```python +column = column +``` + +### `column_letter` + +```python +column_letter +``` + +### `coordinate` + +```python +coordinate +``` + +### `data_type` + +```python +data_type = data_type +``` + +### `fill` + +```python +fill +``` + +### `font` + +```python +font +``` + +### `has_style` + +```python +has_style +``` + +### `internal_value` + +```python +internal_value +``` + +### `is_date` + +```python +is_date +``` + +### `number_format` + +```python +number_format +``` + +### `parent` + +```python +parent = sheet +``` + +### `protection` + +```python +protection +``` + +### `row` + +```python +row = row +``` + +### `style_array` + +```python +style_array +``` + +### `value` + +```python +value +``` + + + + + +# `openpyxl.cell.rich_text` + +RichText definition + +## `CellRichText` + +```python +CellRichText(*args) +``` + +Bases: `list` + +Represents a rich text string. + +Initialize with a list made of pure strings or `TextBlock` elements +Can index object to access or modify individual rich text elements +it also supports the + and += operators between rich text strings +There are no user methods for this class + +operations which modify the string will generally call an optimization pass afterwards, +that merges text blocks with identical formats, consecutive pure text strings, +and remove empty strings and empty text blocks + +### `append` + +```python +append(arg) +``` + +### `as_list` + +```python +as_list() +``` + +Returns a list of the strings contained. +The main reason for this is to make editing easier. + +### `extend` + +```python +extend(arg) +``` + +### `from_tree` + +```python +from_tree(node) +``` + +### `to_tree` + +```python +to_tree() +``` + +Return the full XML representation + +## `TextBlock` + +```python +TextBlock(font, text) +``` + +Bases: `Strict` + +Represents text string in a specific format + +This class is used as part of constructing a rich text strings. + +### `font` + +```python +font = font +``` + +### `text` + +```python +text = text +``` + +### `to_tree` + +```python +to_tree() +``` + + + + + +# `openpyxl.cell.text` + +Richtext definition + +## `InlineFont` + +```python +InlineFont(rFont = None, charset = None, family = None, b = None, i = None, strike = None, outline = None, shadow = None, condense = None, extend = None, color = None, sz = None, u = None, vertAlign = None, scheme = None) +``` + +Bases: `Font` + +Font for inline text because, yes what you need are different objects with the same elements but different constraints. + +### `b` + +```python +b = b +``` + +### `charset` + +```python +charset = charset +``` + +### `color` + +```python +color = color +``` + +### `condense` + +```python +condense = condense +``` + +### `extend` + +```python +extend = extend +``` + +### `family` + +```python +family = family +``` + +### `i` + +```python +i = i +``` + +### `outline` + +```python +outline = outline +``` + +### `rFont` + +```python +rFont = rFont +``` + +### `scheme` + +```python +scheme = scheme +``` + +### `shadow` + +```python +shadow = shadow +``` + +### `strike` + +```python +strike = strike +``` + +### `sz` + +```python +sz = sz +``` + +### `tagname` + +```python +tagname = 'RPrElt' +``` + +### `u` + +```python +u = u +``` + +### `vertAlign` + +```python +vertAlign = vertAlign +``` + +## `PhoneticProperties` + +```python +PhoneticProperties(fontId = None, type = None, alignment = None) +``` + +Bases: `Serialisable` + +### `alignment` + +```python +alignment = alignment +``` + +### `fontId` + +```python +fontId = fontId +``` + +### `tagname` + +```python +tagname = 'phoneticPr' +``` + +### `type` + +```python +type = type +``` + +## `PhoneticText` + +```python +PhoneticText(sb = None, eb = None, t = None) +``` + +Bases: `Serialisable` + +### `eb` + +```python +eb = eb +``` + +### `sb` + +```python +sb = sb +``` + +### `t` + +```python +t = t +``` + +### `tagname` + +```python +tagname = 'rPh' +``` + +### `text` + +```python +text = Alias('t') +``` + +## `RichText` + +```python +RichText(rPr = None, t = None) +``` + +Bases: `Serialisable` + +### `font` + +```python +font = Alias('rPr') +``` + +### `rPr` + +```python +rPr = rPr +``` + +### `t` + +```python +t = t +``` + +### `tagname` + +```python +tagname = 'RElt' +``` + +### `text` + +```python +text = Alias('t') +``` + +## `Text` + +```python +Text(t = None, r = (), rPh = (), phoneticPr = None) +``` + +Bases: `Serialisable` + +### `PhoneticProperties` + +```python +PhoneticProperties = Alias('phoneticPr') +``` + +### `content` + +```python +content +``` + +Text stripped of all formatting + +### `formatted` + +```python +formatted = Alias('r') +``` + +### `phonetic` + +```python +phonetic = Alias('rPh') +``` + +### `phoneticPr` + +```python +phoneticPr = phoneticPr +``` + +### `plain` + +```python +plain = Alias('t') +``` + +### `r` + +```python +r = r +``` + +### `rPh` + +```python +rPh = rPh +``` + +### `t` + +```python +t = t +``` + +### `tagname` + +```python +tagname = 'text' +``` + + + + + +# `openpyxl.chart.area_chart` + +## `AreaChart` + +```python +AreaChart(axId = None, extLst = None, **kw) +``` + +Bases: `_AreaChartBase` + +### `dLbls` + +```python +dLbls = _AreaChartBase.dLbls +``` + +### `dropLines` + +```python +dropLines = _AreaChartBase.dropLines +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `grouping` + +```python +grouping = _AreaChartBase.grouping +``` + +### `ser` + +```python +ser = _AreaChartBase.ser +``` + +### `tagname` + +```python +tagname = 'areaChart' +``` + +### `varyColors` + +```python +varyColors = _AreaChartBase.varyColors +``` + +### `x_axis` + +```python +x_axis = TextAxis() +``` + +### `y_axis` + +```python +y_axis = NumericAxis() +``` + +## `AreaChart3D` + +```python +AreaChart3D(gapDepth = None, **kw) +``` + +Bases: `AreaChart` + +### `dLbls` + +```python +dLbls = _AreaChartBase.dLbls +``` + +### `dropLines` + +```python +dropLines = _AreaChartBase.dropLines +``` + +### `gapDepth` + +```python +gapDepth = gapDepth +``` + +### `grouping` + +```python +grouping = _AreaChartBase.grouping +``` + +### `ser` + +```python +ser = _AreaChartBase.ser +``` + +### `tagname` + +```python +tagname = 'area3DChart' +``` + +### `varyColors` + +```python +varyColors = _AreaChartBase.varyColors +``` + +### `x_axis` + +```python +x_axis = TextAxis() +``` + +### `y_axis` + +```python +y_axis = NumericAxis() +``` + +### `z_axis` + +```python +z_axis = SeriesAxis() +``` + +## `ChartBase` + +```python +ChartBase(axId = (), **kw) +``` + +Bases: `Serialisable` + +Base class for all charts + +### `add_data` + +```python +add_data(data, from_rows = False, titles_from_data = False) +``` + +Add a range of data in a single pass. +The default is to treat each column as a data series. + +### `anchor` + +```python +anchor = 'E15' +``` + +### `append` + +```python +append(value) +``` + +Append a data series to the chart + +### `axId` + +```python +axId = axId +``` + +### `display_blanks` + +```python +display_blanks = 'gap' +``` + +### `graphical_properties` + +```python +graphical_properties = None +``` + +### `height` + +```python +height = 7.5 +``` + +### `idx_base` + +```python +idx_base = 0 +``` + +### `layout` + +```python +layout = None +``` + +### `legend` + +```python +legend = Legend() +``` + +### `mime_type` + +```python +mime_type = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml' +``` + +### `path` + +```python +path +``` + +### `pivotFormats` + +```python +pivotFormats = () +``` + +### `pivotSource` + +```python +pivotSource = None +``` + +### `plot_area` + +```python +plot_area = PlotArea() +``` + +### `repoint` + +```python +repoint(series_index, new_range) +``` + +Point a series' VALUES at ``new_range`` — "the chart now covers +Q1-Q4" (paper-xlsx). ``new_range`` must be a +sheet-qualified single-area range like "'Data'!$B$2:$B$13"; it is +validated here, and under preserve mode the save expresses the +change as a byte patch of the chart's `` text. + +### `roundedCorners` + +```python +roundedCorners = None +``` + +### `ser` + +```python +ser = () +``` + +### `series` + +```python +series = Alias('ser') +``` + +### `set_categories` + +```python +set_categories(labels) +``` + +Set the categories / x-axis values + +### `style` + +```python +style = None +``` + +### `title` + +```python +title = None +``` + +### `to_tree` + +```python +to_tree(namespace = None, tagname = None, idx = None) +``` + +### `visible_cells_only` + +```python +visible_cells_only = True +``` + +### `width` + +```python +width = 15 +``` + + + + + +# `openpyxl.chart.axis` + +## `ChartLines` + +```python +ChartLines(spPr = None) +``` + +Bases: `Serialisable` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'chartLines' +``` + +## `DateAxis` + +```python +DateAxis(auto = None, lblOffset = None, baseTimeUnit = None, majorUnit = None, majorTimeUnit = None, minorUnit = None, minorTimeUnit = None, extLst = None, **kw) +``` + +Bases: `TextAxis` + +### `auto` + +```python +auto = auto +``` + +### `axId` + +```python +axId = _BaseAxis.axId +``` + +### `axPos` + +```python +axPos = _BaseAxis.axPos +``` + +### `baseTimeUnit` + +```python +baseTimeUnit = baseTimeUnit +``` + +### `crossAx` + +```python +crossAx = _BaseAxis.crossAx +``` + +### `crosses` + +```python +crosses = _BaseAxis.crosses +``` + +### `crossesAt` + +```python +crossesAt = _BaseAxis.crossesAt +``` + +### `delete` + +```python +delete = _BaseAxis.delete +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `lblOffset` + +```python +lblOffset = lblOffset +``` + +### `majorGridlines` + +```python +majorGridlines = _BaseAxis.majorGridlines +``` + +### `majorTickMark` + +```python +majorTickMark = _BaseAxis.majorTickMark +``` + +### `majorTimeUnit` + +```python +majorTimeUnit = majorTimeUnit +``` + +### `majorUnit` + +```python +majorUnit = majorUnit +``` + +### `minorGridlines` + +```python +minorGridlines = _BaseAxis.minorGridlines +``` + +### `minorTickMark` + +```python +minorTickMark = _BaseAxis.minorTickMark +``` + +### `minorTimeUnit` + +```python +minorTimeUnit = minorTimeUnit +``` + +### `minorUnit` + +```python +minorUnit = minorUnit +``` + +### `numFmt` + +```python +numFmt = _BaseAxis.numFmt +``` + +### `scaling` + +```python +scaling = _BaseAxis.scaling +``` + +### `spPr` + +```python +spPr = _BaseAxis.spPr +``` + +### `tagname` + +```python +tagname = 'dateAx' +``` + +### `tickLblPos` + +```python +tickLblPos = _BaseAxis.tickLblPos +``` + +### `title` + +```python +title = _BaseAxis.title +``` + +### `txPr` + +```python +txPr = _BaseAxis.txPr +``` + +## `DisplayUnitsLabel` + +```python +DisplayUnitsLabel(layout = None, tx = None, spPr = None, txPr = None) +``` + +Bases: `Serialisable` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `layout` + +```python +layout = layout +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'dispUnitsLbl' +``` + +### `text` + +```python +text = Alias('tx') +``` + +### `textPropertes` + +```python +textPropertes = Alias('txPr') +``` + +### `tx` + +```python +tx = tx +``` + +### `txPr` + +```python +txPr = txPr +``` + +## `DisplayUnitsLabelList` + +```python +DisplayUnitsLabelList(custUnit = None, builtInUnit = None, dispUnitsLbl = None, extLst = None) +``` + +Bases: `Serialisable` + +### `builtInUnit` + +```python +builtInUnit = builtInUnit +``` + +### `custUnit` + +```python +custUnit = custUnit +``` + +### `dispUnitsLbl` + +```python +dispUnitsLbl = dispUnitsLbl +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `tagname` + +```python +tagname = 'dispUnits' +``` + +## `NumericAxis` + +```python +NumericAxis(crossBetween = None, majorUnit = None, minorUnit = None, dispUnits = None, extLst = None, **kw) +``` + +Bases: `_BaseAxis` + +### `axId` + +```python +axId = _BaseAxis.axId +``` + +### `axPos` + +```python +axPos = _BaseAxis.axPos +``` + +### `crossAx` + +```python +crossAx = _BaseAxis.crossAx +``` + +### `crossBetween` + +```python +crossBetween = crossBetween +``` + +### `crosses` + +```python +crosses = _BaseAxis.crosses +``` + +### `crossesAt` + +```python +crossesAt = _BaseAxis.crossesAt +``` + +### `delete` + +```python +delete = _BaseAxis.delete +``` + +### `dispUnits` + +```python +dispUnits = dispUnits +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `from_tree` + +```python +from_tree(node) +``` + +Special case value axes with no gridlines + +### `majorGridlines` + +```python +majorGridlines = _BaseAxis.majorGridlines +``` + +### `majorTickMark` + +```python +majorTickMark = _BaseAxis.majorTickMark +``` + +### `majorUnit` + +```python +majorUnit = majorUnit +``` + +### `minorGridlines` + +```python +minorGridlines = _BaseAxis.minorGridlines +``` + +### `minorTickMark` + +```python +minorTickMark = _BaseAxis.minorTickMark +``` + +### `minorUnit` + +```python +minorUnit = minorUnit +``` + +### `numFmt` + +```python +numFmt = _BaseAxis.numFmt +``` + +### `scaling` + +```python +scaling = _BaseAxis.scaling +``` + +### `spPr` + +```python +spPr = _BaseAxis.spPr +``` + +### `tagname` + +```python +tagname = 'valAx' +``` + +### `tickLblPos` + +```python +tickLblPos = _BaseAxis.tickLblPos +``` + +### `title` + +```python +title = _BaseAxis.title +``` + +### `txPr` + +```python +txPr = _BaseAxis.txPr +``` + +## `Scaling` + +```python +Scaling(logBase = None, orientation = 'minMax', max = None, min = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `logBase` + +```python +logBase = logBase +``` + +### `max` + +```python +max = max +``` + +### `min` + +```python +min = min +``` + +### `orientation` + +```python +orientation = orientation +``` + +### `tagname` + +```python +tagname = 'scaling' +``` + +## `SeriesAxis` + +```python +SeriesAxis(tickLblSkip = None, tickMarkSkip = None, extLst = None, **kw) +``` + +Bases: `_BaseAxis` + +### `axId` + +```python +axId = _BaseAxis.axId +``` + +### `axPos` + +```python +axPos = _BaseAxis.axPos +``` + +### `crossAx` + +```python +crossAx = _BaseAxis.crossAx +``` + +### `crosses` + +```python +crosses = _BaseAxis.crosses +``` + +### `crossesAt` + +```python +crossesAt = _BaseAxis.crossesAt +``` + +### `delete` + +```python +delete = _BaseAxis.delete +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `majorGridlines` + +```python +majorGridlines = _BaseAxis.majorGridlines +``` + +### `majorTickMark` + +```python +majorTickMark = _BaseAxis.majorTickMark +``` + +### `minorGridlines` + +```python +minorGridlines = _BaseAxis.minorGridlines +``` + +### `minorTickMark` + +```python +minorTickMark = _BaseAxis.minorTickMark +``` + +### `numFmt` + +```python +numFmt = _BaseAxis.numFmt +``` + +### `scaling` + +```python +scaling = _BaseAxis.scaling +``` + +### `spPr` + +```python +spPr = _BaseAxis.spPr +``` + +### `tagname` + +```python +tagname = 'serAx' +``` + +### `tickLblPos` + +```python +tickLblPos = _BaseAxis.tickLblPos +``` + +### `tickLblSkip` + +```python +tickLblSkip = tickLblSkip +``` + +### `tickMarkSkip` + +```python +tickMarkSkip = tickMarkSkip +``` + +### `title` + +```python +title = _BaseAxis.title +``` + +### `txPr` + +```python +txPr = _BaseAxis.txPr +``` + +## `TextAxis` + +```python +TextAxis(auto = None, lblAlgn = None, lblOffset = 100, tickLblSkip = None, tickMarkSkip = None, noMultiLvlLbl = None, extLst = None, **kw) +``` + +Bases: `_BaseAxis` + +### `auto` + +```python +auto = auto +``` + +### `axId` + +```python +axId = _BaseAxis.axId +``` + +### `axPos` + +```python +axPos = _BaseAxis.axPos +``` + +### `crossAx` + +```python +crossAx = _BaseAxis.crossAx +``` + +### `crosses` + +```python +crosses = _BaseAxis.crosses +``` + +### `crossesAt` + +```python +crossesAt = _BaseAxis.crossesAt +``` + +### `delete` + +```python +delete = _BaseAxis.delete +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `lblAlgn` + +```python +lblAlgn = lblAlgn +``` + +### `lblOffset` + +```python +lblOffset = lblOffset +``` + +### `majorGridlines` + +```python +majorGridlines = _BaseAxis.majorGridlines +``` + +### `majorTickMark` + +```python +majorTickMark = _BaseAxis.majorTickMark +``` + +### `minorGridlines` + +```python +minorGridlines = _BaseAxis.minorGridlines +``` + +### `minorTickMark` + +```python +minorTickMark = _BaseAxis.minorTickMark +``` + +### `noMultiLvlLbl` + +```python +noMultiLvlLbl = noMultiLvlLbl +``` + +### `numFmt` + +```python +numFmt = _BaseAxis.numFmt +``` + +### `scaling` + +```python +scaling = _BaseAxis.scaling +``` + +### `spPr` + +```python +spPr = _BaseAxis.spPr +``` + +### `tagname` + +```python +tagname = 'catAx' +``` + +### `tickLblPos` + +```python +tickLblPos = _BaseAxis.tickLblPos +``` + +### `tickLblSkip` + +```python +tickLblSkip = tickLblSkip +``` + +### `tickMarkSkip` + +```python +tickMarkSkip = tickMarkSkip +``` + +### `title` + +```python +title = _BaseAxis.title +``` + +### `txPr` + +```python +txPr = _BaseAxis.txPr +``` + + + + + +# `openpyxl.chart.bar_chart` + +## `BarChart` + +```python +BarChart(gapWidth = 150, overlap = None, serLines = None, extLst = None, **kw) +``` + +Bases: `_BarChartBase` + +### `barDir` + +```python +barDir = _BarChartBase.barDir +``` + +### `dLbls` + +```python +dLbls = _BarChartBase.dLbls +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `gapWidth` + +```python +gapWidth = gapWidth +``` + +### `grouping` + +```python +grouping = _BarChartBase.grouping +``` + +### `legend` + +```python +legend = Legend() +``` + +### `overlap` + +```python +overlap = overlap +``` + +### `ser` + +```python +ser = _BarChartBase.ser +``` + +### `serLines` + +```python +serLines = serLines +``` + +### `tagname` + +```python +tagname = 'barChart' +``` + +### `varyColors` + +```python +varyColors = _BarChartBase.varyColors +``` + +### `x_axis` + +```python +x_axis = TextAxis() +``` + +### `y_axis` + +```python +y_axis = NumericAxis() +``` + +## `BarChart3D` + +```python +BarChart3D(gapWidth = 150, gapDepth = 150, shape = None, serLines = None, extLst = None, **kw) +``` + +Bases: `_BarChartBase`, `_3DBase` + +### `backWall` + +```python +backWall = _3DBase.backWall +``` + +### `barDir` + +```python +barDir = _BarChartBase.barDir +``` + +### `dLbls` + +```python +dLbls = _BarChartBase.dLbls +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `floor` + +```python +floor = _3DBase.floor +``` + +### `gapDepth` + +```python +gapDepth = gapDepth +``` + +### `gapWidth` + +```python +gapWidth = gapWidth +``` + +### `grouping` + +```python +grouping = _BarChartBase.grouping +``` + +### `ser` + +```python +ser = _BarChartBase.ser +``` + +### `serLines` + +```python +serLines = serLines +``` + +### `shape` + +```python +shape = shape +``` + +### `sideWall` + +```python +sideWall = _3DBase.sideWall +``` + +### `tagname` + +```python +tagname = 'bar3DChart' +``` + +### `varyColors` + +```python +varyColors = _BarChartBase.varyColors +``` + +### `view3D` + +```python +view3D = _3DBase.view3D +``` + +### `x_axis` + +```python +x_axis = TextAxis() +``` + +### `y_axis` + +```python +y_axis = NumericAxis() +``` + +### `z_axis` + +```python +z_axis = SeriesAxis() +``` + + + + + +# `openpyxl.chart.bubble_chart` + +## `BubbleChart` + +```python +BubbleChart(varyColors = None, ser = (), dLbls = None, bubble3D = None, bubbleScale = None, showNegBubbles = None, sizeRepresents = None, extLst = None, **kw) +``` + +Bases: `ChartBase` + +### `bubble3D` + +```python +bubble3D = bubble3D +``` + +### `bubbleScale` + +```python +bubbleScale = bubbleScale +``` + +### `dLbls` + +```python +dLbls = dLbls +``` + +### `dataLabels` + +```python +dataLabels = Alias('dLbls') +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `ser` + +```python +ser = ser +``` + +### `showNegBubbles` + +```python +showNegBubbles = showNegBubbles +``` + +### `sizeRepresents` + +```python +sizeRepresents = sizeRepresents +``` + +### `tagname` + +```python +tagname = 'bubbleChart' +``` + +### `varyColors` + +```python +varyColors = varyColors +``` + +### `x_axis` + +```python +x_axis = NumericAxis(axId=10, crossAx=20) +``` + +### `y_axis` + +```python +y_axis = NumericAxis(axId=20, crossAx=10) +``` + + + + + +# `openpyxl.chart.chartspace` + +Enclosing chart object. The various chart types are actually child objects. + +## `ChartContainer` + +```python +ChartContainer(title = None, autoTitleDeleted = None, pivotFmts = (), view3D = None, floor = None, sideWall = None, backWall = None, plotArea = None, legend = None, plotVisOnly = True, dispBlanksAs = 'gap', showDLblsOverMax = None, extLst = None) +``` + +Bases: `Serialisable` + +### `autoTitleDeleted` + +```python +autoTitleDeleted = autoTitleDeleted +``` + +### `backWall` + +```python +backWall = backWall +``` + +### `dispBlanksAs` + +```python +dispBlanksAs = dispBlanksAs +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `floor` + +```python +floor = floor +``` + +### `legend` + +```python +legend = legend +``` + +### `pivotFmts` + +```python +pivotFmts = pivotFmts +``` + +### `plotArea` + +```python +plotArea = plotArea +``` + +### `plotVisOnly` + +```python +plotVisOnly = plotVisOnly +``` + +### `showDLblsOverMax` + +```python +showDLblsOverMax = showDLblsOverMax +``` + +### `sideWall` + +```python +sideWall = sideWall +``` + +### `tagname` + +```python +tagname = 'chart' +``` + +### `title` + +```python +title = title +``` + +### `view3D` + +```python +view3D = view3D +``` + +## `ChartSpace` + +```python +ChartSpace(date1904 = None, lang = None, roundedCorners = None, style = None, clrMapOvr = None, pivotSource = None, protection = None, chart = None, spPr = None, txPr = None, externalData = None, printSettings = None, userShapes = None, extLst = None) +``` + +Bases: `Serialisable` + +### `chart` + +```python +chart = chart +``` + +### `clrMapOvr` + +```python +clrMapOvr = clrMapOvr +``` + +### `date1904` + +```python +date1904 = date1904 +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `externalData` + +```python +externalData = externalData +``` + +### `graphical_properties` + +```python +graphical_properties = Alias('spPr') +``` + +### `lang` + +```python +lang = lang +``` + +### `pivotSource` + +```python +pivotSource = pivotSource +``` + +### `printSettings` + +```python +printSettings = printSettings +``` + +### `protection` + +```python +protection = protection +``` + +### `roundedCorners` + +```python +roundedCorners = roundedCorners +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `style` + +```python +style = style +``` + +### `tagname` + +```python +tagname = 'chartSpace' +``` + +### `textProperties` + +```python +textProperties = Alias('txPr') +``` + +### `to_tree` + +```python +to_tree(tagname = None, idx = None, namespace = None) +``` + +### `txPr` + +```python +txPr = txPr +``` + +### `userShapes` + +```python +userShapes = userShapes +``` + +## `ExternalData` + +```python +ExternalData(autoUpdate = None, id = None) +``` + +Bases: `Serialisable` + +### `autoUpdate` + +```python +autoUpdate = autoUpdate +``` + +### `id` + +```python +id = id +``` + +### `tagname` + +```python +tagname = 'externalData' +``` + +## `Protection` + +```python +Protection(chartObject = None, data = None, formatting = None, selection = None, userInterface = None) +``` + +Bases: `Serialisable` + +### `chartObject` + +```python +chartObject = chartObject +``` + +### `data` + +```python +data = data +``` + +### `formatting` + +```python +formatting = formatting +``` + +### `selection` + +```python +selection = selection +``` + +### `tagname` + +```python +tagname = 'protection' +``` + +### `userInterface` + +```python +userInterface = userInterface +``` + + + + + +# `openpyxl.chart.data_source` + +Collection of utility primitives for charts. + +## `AxDataSource` + +```python +AxDataSource(numRef = None, numLit = None, strRef = None, strLit = None, multiLvlStrRef = None) +``` + +Bases: `Serialisable` + +### `multiLvlStrRef` + +```python +multiLvlStrRef = multiLvlStrRef +``` + +### `numLit` + +```python +numLit = numLit +``` + +### `numRef` + +```python +numRef = numRef +``` + +### `strLit` + +```python +strLit = strLit +``` + +### `strRef` + +```python +strRef = strRef +``` + +### `tagname` + +```python +tagname = 'cat' +``` + +## `Level` + +```python +Level(pt = ()) +``` + +Bases: `Serialisable` + +### `pt` + +```python +pt = pt +``` + +### `tagname` + +```python +tagname = 'lvl' +``` + +## `MultiLevelStrData` + +```python +MultiLevelStrData(ptCount = None, lvl = (), extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `lvl` + +```python +lvl = lvl +``` + +### `ptCount` + +```python +ptCount = ptCount +``` + +### `tagname` + +```python +tagname = 'multiLvlStrData' +``` + +## `MultiLevelStrRef` + +```python +MultiLevelStrRef(f = None, multiLvlStrCache = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `f` + +```python +f = f +``` + +### `multiLvlStrCache` + +```python +multiLvlStrCache = multiLvlStrCache +``` + +### `tagname` + +```python +tagname = 'multiLvlStrRef' +``` + +## `NumData` + +```python +NumData(formatCode = None, ptCount = None, pt = (), extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `formatCode` + +```python +formatCode = formatCode +``` + +### `pt` + +```python +pt = pt +``` + +### `ptCount` + +```python +ptCount = ptCount +``` + +## `NumDataSource` + +```python +NumDataSource(numRef = None, numLit = None) +``` + +Bases: `Serialisable` + +### `numLit` + +```python +numLit = numLit +``` + +### `numRef` + +```python +numRef = numRef +``` + +## `NumFmt` + +```python +NumFmt(formatCode = None, sourceLinked = False) +``` + +Bases: `Serialisable` + +### `formatCode` + +```python +formatCode = formatCode +``` + +### `sourceLinked` + +```python +sourceLinked = sourceLinked +``` + +## `NumRef` + +```python +NumRef(f = None, numCache = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `f` + +```python +f = f +``` + +### `numCache` + +```python +numCache = numCache +``` + +### `ref` + +```python +ref = Alias('f') +``` + +## `NumVal` + +```python +NumVal(idx = None, formatCode = None, v = None) +``` + +Bases: `Serialisable` + +### `formatCode` + +```python +formatCode = formatCode +``` + +### `idx` + +```python +idx = idx +``` + +### `v` + +```python +v = v +``` + +## `NumberValueDescriptor` + +Bases: `NestedText` + +Data should be numerical but isn't always :-/ + +### `allow_none` + +```python +allow_none = True +``` + +## `StrData` + +```python +StrData(ptCount = None, pt = (), extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `pt` + +```python +pt = pt +``` + +### `ptCount` + +```python +ptCount = ptCount +``` + +### `tagname` + +```python +tagname = 'strData' +``` + +## `StrRef` + +```python +StrRef(f = None, strCache = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `f` + +```python +f = f +``` + +### `strCache` + +```python +strCache = strCache +``` + +### `tagname` + +```python +tagname = 'strRef' +``` + +## `StrVal` + +```python +StrVal(idx = 0, v = None) +``` + +Bases: `Serialisable` + +### `idx` + +```python +idx = idx +``` + +### `tagname` + +```python +tagname = 'strVal' +``` + +### `v` + +```python +v = v +``` + + + + + +# `openpyxl.chart.descriptors` + +## `NestedGapAmount` + +Bases: `NestedMinMax` + +### `allow_none` + +```python +allow_none = True +``` + +### `max` + +```python +max = 500 +``` + +### `min` + +```python +min = 0 +``` + +## `NestedOverlap` + +Bases: `NestedMinMax` + +### `allow_none` + +```python +allow_none = True +``` + +### `max` + +```python +max = 100 +``` + +### `min` + +```python +min = -100 +``` + +## `NumberFormatDescriptor` + +Bases: `Typed` + +Allow direct assignment of format code + +### `allow_none` + +```python +allow_none = True +``` + +### `expected_type` + +```python +expected_type = NumFmt +``` + + + + + +# `openpyxl.chart.error_bar` + +## `ErrorBars` + +```python +ErrorBars(errDir = None, errBarType = 'both', errValType = 'fixedVal', noEndCap = None, plus = None, minus = None, val = None, spPr = None, extLst = None) +``` + +Bases: `Serialisable` + +### `direction` + +```python +direction = Alias('errDir') +``` + +### `errBarType` + +```python +errBarType = errBarType +``` + +### `errDir` + +```python +errDir = errDir +``` + +### `errValType` + +```python +errValType = errValType +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `minus` + +```python +minus = minus +``` + +### `noEndCap` + +```python +noEndCap = noEndCap +``` + +### `plus` + +```python +plus = plus +``` + +### `size` + +```python +size = Alias('errValType') +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `style` + +```python +style = Alias('errBarType') +``` + +### `tagname` + +```python +tagname = 'errBars' +``` + +### `val` + +```python +val = val +``` + + + + + +# `openpyxl.chart.label` + +## `DataLabel` + +```python +DataLabel(idx = 0, **kw) +``` + +Bases: `_DataLabelBase` + +### `dLblPos` + +```python +dLblPos = _DataLabelBase.dLblPos +``` + +### `extLst` + +```python +extLst = _DataLabelBase.extLst +``` + +### `idx` + +```python +idx = idx +``` + +### `numFmt` + +```python +numFmt = _DataLabelBase.numFmt +``` + +### `separator` + +```python +separator = _DataLabelBase.separator +``` + +### `showBubbleSize` + +```python +showBubbleSize = _DataLabelBase.showBubbleSize +``` + +### `showCatName` + +```python +showCatName = _DataLabelBase.showCatName +``` + +### `showLeaderLines` + +```python +showLeaderLines = _DataLabelBase.showLeaderLines +``` + +### `showLegendKey` + +```python +showLegendKey = _DataLabelBase.showLegendKey +``` + +### `showPercent` + +```python +showPercent = _DataLabelBase.showPercent +``` + +### `showSerName` + +```python +showSerName = _DataLabelBase.showSerName +``` + +### `showVal` + +```python +showVal = _DataLabelBase.showVal +``` + +### `spPr` + +```python +spPr = _DataLabelBase.spPr +``` + +### `tagname` + +```python +tagname = 'dLbl' +``` + +### `txPr` + +```python +txPr = _DataLabelBase.txPr +``` + +## `DataLabelList` + +```python +DataLabelList(dLbl = (), delete = None, **kw) +``` + +Bases: `_DataLabelBase` + +### `dLbl` + +```python +dLbl = dLbl +``` + +### `dLblPos` + +```python +dLblPos = _DataLabelBase.dLblPos +``` + +### `delete` + +```python +delete = delete +``` + +### `extLst` + +```python +extLst = _DataLabelBase.extLst +``` + +### `numFmt` + +```python +numFmt = _DataLabelBase.numFmt +``` + +### `separator` + +```python +separator = _DataLabelBase.separator +``` + +### `showBubbleSize` + +```python +showBubbleSize = _DataLabelBase.showBubbleSize +``` + +### `showCatName` + +```python +showCatName = _DataLabelBase.showCatName +``` + +### `showLeaderLines` + +```python +showLeaderLines = _DataLabelBase.showLeaderLines +``` + +### `showLegendKey` + +```python +showLegendKey = _DataLabelBase.showLegendKey +``` + +### `showPercent` + +```python +showPercent = _DataLabelBase.showPercent +``` + +### `showSerName` + +```python +showSerName = _DataLabelBase.showSerName +``` + +### `showVal` + +```python +showVal = _DataLabelBase.showVal +``` + +### `spPr` + +```python +spPr = _DataLabelBase.spPr +``` + +### `tagname` + +```python +tagname = 'dLbls' +``` + +### `txPr` + +```python +txPr = _DataLabelBase.txPr +``` + + + + + +# `openpyxl.chart.layout` + +## `Layout` + +```python +Layout(manualLayout = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `manualLayout` + +```python +manualLayout = manualLayout +``` + +### `tagname` + +```python +tagname = 'layout' +``` + +## `ManualLayout` + +```python +ManualLayout(layoutTarget = None, xMode = None, yMode = None, wMode = 'factor', hMode = 'factor', x = None, y = None, w = None, h = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `h` + +```python +h = h +``` + +### `hMode` + +```python +hMode = hMode +``` + +### `height` + +```python +height = Alias('h') +``` + +### `layoutTarget` + +```python +layoutTarget = layoutTarget +``` + +### `tagname` + +```python +tagname = 'manualLayout' +``` + +### `w` + +```python +w = w +``` + +### `wMode` + +```python +wMode = wMode +``` + +### `width` + +```python +width = Alias('w') +``` + +### `x` + +```python +x = x +``` + +### `xMode` + +```python +xMode = xMode +``` + +### `y` + +```python +y = y +``` + +### `yMode` + +```python +yMode = yMode +``` + + + + + +# `openpyxl.chart.legend` + +## `Legend` + +```python +Legend(legendPos = 'r', legendEntry = (), layout = None, overlay = None, spPr = None, txPr = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `layout` + +```python +layout = layout +``` + +### `legendEntry` + +```python +legendEntry = legendEntry +``` + +### `legendPos` + +```python +legendPos = legendPos +``` + +### `overlay` + +```python +overlay = overlay +``` + +### `position` + +```python +position = Alias('legendPos') +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'legend' +``` + +### `textProperties` + +```python +textProperties = Alias('txPr') +``` + +### `txPr` + +```python +txPr = txPr +``` + +## `LegendEntry` + +```python +LegendEntry(idx = 0, delete = False, txPr = None, extLst = None) +``` + +Bases: `Serialisable` + +### `delete` + +```python +delete = delete +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `idx` + +```python +idx = idx +``` + +### `tagname` + +```python +tagname = 'legendEntry' +``` + +### `txPr` + +```python +txPr = txPr +``` + + + + + +# `openpyxl.chart.line_chart` + +## `LineChart` + +```python +LineChart(hiLowLines = None, upDownBars = None, marker = None, smooth = None, extLst = None, **kw) +``` + +Bases: `_LineChartBase` + +### `dLbls` + +```python +dLbls = _LineChartBase.dLbls +``` + +### `dropLines` + +```python +dropLines = _LineChartBase.dropLines +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `grouping` + +```python +grouping = _LineChartBase.grouping +``` + +### `hiLowLines` + +```python +hiLowLines = hiLowLines +``` + +### `marker` + +```python +marker = marker +``` + +### `ser` + +```python +ser = _LineChartBase.ser +``` + +### `smooth` + +```python +smooth = smooth +``` + +### `tagname` + +```python +tagname = 'lineChart' +``` + +### `upDownBars` + +```python +upDownBars = upDownBars +``` + +### `varyColors` + +```python +varyColors = _LineChartBase.varyColors +``` + +### `x_axis` + +```python +x_axis = TextAxis() +``` + +### `y_axis` + +```python +y_axis = NumericAxis() +``` + +## `LineChart3D` + +```python +LineChart3D(gapDepth = None, hiLowLines = None, upDownBars = None, marker = None, smooth = None, **kw) +``` + +Bases: `_LineChartBase` + +### `dLbls` + +```python +dLbls = _LineChartBase.dLbls +``` + +### `dropLines` + +```python +dropLines = _LineChartBase.dropLines +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `gapDepth` + +```python +gapDepth = gapDepth +``` + +### `grouping` + +```python +grouping = _LineChartBase.grouping +``` + +### `hiLowLines` + +```python +hiLowLines = hiLowLines +``` + +### `marker` + +```python +marker = marker +``` + +### `ser` + +```python +ser = _LineChartBase.ser +``` + +### `smooth` + +```python +smooth = smooth +``` + +### `tagname` + +```python +tagname = 'line3DChart' +``` + +### `upDownBars` + +```python +upDownBars = upDownBars +``` + +### `varyColors` + +```python +varyColors = _LineChartBase.varyColors +``` + +### `x_axis` + +```python +x_axis = TextAxis() +``` + +### `y_axis` + +```python +y_axis = NumericAxis() +``` + +### `z_axis` + +```python +z_axis = SeriesAxis() +``` + + + + + +# `openpyxl.chart.marker` + +## `DataPoint` + +```python +DataPoint(idx = None, invertIfNegative = None, marker = None, bubble3D = None, explosion = None, spPr = None, pictureOptions = None, extLst = None) +``` + +Bases: `Serialisable` + +### `bubble3D` + +```python +bubble3D = bubble3D +``` + +### `explosion` + +```python +explosion = explosion +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `idx` + +```python +idx = idx +``` + +### `invertIfNegative` + +```python +invertIfNegative = invertIfNegative +``` + +### `marker` + +```python +marker = marker +``` + +### `pictureOptions` + +```python +pictureOptions = pictureOptions +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'dPt' +``` + +## `Marker` + +```python +Marker(symbol = None, size = None, spPr = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `size` + +```python +size = size +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `symbol` + +```python +symbol = symbol +``` + +### `tagname` + +```python +tagname = 'marker' +``` + + + + + +# `openpyxl.chart.picture` + +## `PictureOptions` + +```python +PictureOptions(applyToFront = None, applyToSides = None, applyToEnd = None, pictureFormat = None, pictureStackUnit = None) +``` + +Bases: `Serialisable` + +### `applyToEnd` + +```python +applyToEnd = applyToEnd +``` + +### `applyToFront` + +```python +applyToFront = applyToFront +``` + +### `applyToSides` + +```python +applyToSides = applyToSides +``` + +### `pictureFormat` + +```python +pictureFormat = pictureFormat +``` + +### `pictureStackUnit` + +```python +pictureStackUnit = pictureStackUnit +``` + +### `tagname` + +```python +tagname = 'pictureOptions' +``` + + + + + +# `openpyxl.chart.pie_chart` + +## `CustomSplit` + +```python +CustomSplit(secondPiePt = ()) +``` + +Bases: `Serialisable` + +### `secondPiePt` + +```python +secondPiePt = secondPiePt +``` + +### `tagname` + +```python +tagname = 'custSplit' +``` + +## `DoughnutChart` + +```python +DoughnutChart(firstSliceAng = 0, holeSize = 10, extLst = None, **kw) +``` + +Bases: `_PieChartBase` + +### `dLbls` + +```python +dLbls = _PieChartBase.dLbls +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `firstSliceAng` + +```python +firstSliceAng = firstSliceAng +``` + +### `holeSize` + +```python +holeSize = holeSize +``` + +### `ser` + +```python +ser = _PieChartBase.ser +``` + +### `tagname` + +```python +tagname = 'doughnutChart' +``` + +### `varyColors` + +```python +varyColors = _PieChartBase.varyColors +``` + +## `PieChart` + +```python +PieChart(firstSliceAng = 0, extLst = None, **kw) +``` + +Bases: `_PieChartBase` + +### `dLbls` + +```python +dLbls = _PieChartBase.dLbls +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `firstSliceAng` + +```python +firstSliceAng = firstSliceAng +``` + +### `ser` + +```python +ser = _PieChartBase.ser +``` + +### `tagname` + +```python +tagname = 'pieChart' +``` + +### `varyColors` + +```python +varyColors = _PieChartBase.varyColors +``` + +## `PieChart3D` + +Bases: `_PieChartBase` + +### `dLbls` + +```python +dLbls = _PieChartBase.dLbls +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `ser` + +```python +ser = _PieChartBase.ser +``` + +### `tagname` + +```python +tagname = 'pie3DChart' +``` + +### `varyColors` + +```python +varyColors = _PieChartBase.varyColors +``` + +## `ProjectedPieChart` + +```python +ProjectedPieChart(ofPieType = 'pie', gapWidth = None, splitType = 'auto', splitPos = None, custSplit = None, secondPieSize = 75, serLines = None, extLst = None, **kw) +``` + +Bases: `_PieChartBase` + +From the spec 21.2.2.126 + +This element contains the pie of pie or bar of pie series on this +chart. Only the first series shall be displayed. The splitType element +shall determine whether the splitPos and custSplit elements apply. + +### `custSplit` + +```python +custSplit = custSplit +``` + +### `dLbls` + +```python +dLbls = _PieChartBase.dLbls +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `gapWidth` + +```python +gapWidth = gapWidth +``` + +### `join_lines` + +```python +join_lines = Alias('serLines') +``` + +### `ofPieType` + +```python +ofPieType = ofPieType +``` + +### `secondPieSize` + +```python +secondPieSize = secondPieSize +``` + +### `ser` + +```python +ser = _PieChartBase.ser +``` + +### `serLines` + +```python +serLines = Typed(expected_type=ChartLines, allow_none=True) +``` + +### `splitPos` + +```python +splitPos = splitPos +``` + +### `splitType` + +```python +splitType = splitType +``` + +### `tagname` + +```python +tagname = 'ofPieChart' +``` + +### `type` + +```python +type = Alias('ofPieType') +``` + +### `varyColors` + +```python +varyColors = _PieChartBase.varyColors +``` + + + + + +# `openpyxl.chart.pivot` + +## `PivotFormat` + +```python +PivotFormat(idx = 0, spPr = None, txPr = None, marker = None, dLbl = None, extLst = None) +``` + +Bases: `Serialisable` + +### `DataLabel` + +```python +DataLabel = Alias('dLbl') +``` + +### `TextBody` + +```python +TextBody = Alias('txPr') +``` + +### `dLbl` + +```python +dLbl = dLbl +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `idx` + +```python +idx = idx +``` + +### `marker` + +```python +marker = marker +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'pivotFmt' +``` + +### `txPr` + +```python +txPr = txPr +``` + +## `PivotSource` + +```python +PivotSource(name = None, fmtId = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `fmtId` + +```python +fmtId = fmtId +``` + +### `name` + +```python +name = name +``` + +### `tagname` + +```python +tagname = 'pivotSource' +``` + + + + + +# `openpyxl.chart.plotarea` + +## `DataTable` + +```python +DataTable(showHorzBorder = None, showVertBorder = None, showOutline = None, showKeys = None, spPr = None, txPr = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `showHorzBorder` + +```python +showHorzBorder = showHorzBorder +``` + +### `showKeys` + +```python +showKeys = showKeys +``` + +### `showOutline` + +```python +showOutline = showOutline +``` + +### `showVertBorder` + +```python +showVertBorder = showVertBorder +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'dTable' +``` + +### `txPr` + +```python +txPr = txPr +``` + +## `PlotArea` + +```python +PlotArea(layout = None, dTable = None, spPr = None, _charts = (), _axes = (), extLst = None) +``` + +Bases: `Serialisable` + +### `area3DChart` + +```python +area3DChart = MultiSequencePart(expected_type=AreaChart3D, store='_charts') +``` + +### `areaChart` + +```python +areaChart = MultiSequencePart(expected_type=AreaChart, store='_charts') +``` + +### `bar3DChart` + +```python +bar3DChart = MultiSequencePart(expected_type=BarChart3D, store='_charts') +``` + +### `barChart` + +```python +barChart = MultiSequencePart(expected_type=BarChart, store='_charts') +``` + +### `bubbleChart` + +```python +bubbleChart = MultiSequencePart(expected_type=BubbleChart, store='_charts') +``` + +### `catAx` + +```python +catAx = MultiSequencePart(expected_type=TextAxis, store='_axes') +``` + +### `dTable` + +```python +dTable = dTable +``` + +### `dateAx` + +```python +dateAx = MultiSequencePart(expected_type=DateAxis, store='_axes') +``` + +### `doughnutChart` + +```python +doughnutChart = MultiSequencePart(expected_type=DoughnutChart, store='_charts') +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `from_tree` + +```python +from_tree(node) +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `layout` + +```python +layout = layout +``` + +### `line3DChart` + +```python +line3DChart = MultiSequencePart(expected_type=LineChart3D, store='_charts') +``` + +### `lineChart` + +```python +lineChart = MultiSequencePart(expected_type=LineChart, store='_charts') +``` + +### `ofPieChart` + +```python +ofPieChart = MultiSequencePart(expected_type=ProjectedPieChart, store='_charts') +``` + +### `pie3DChart` + +```python +pie3DChart = MultiSequencePart(expected_type=PieChart3D, store='_charts') +``` + +### `pieChart` + +```python +pieChart = MultiSequencePart(expected_type=PieChart, store='_charts') +``` + +### `radarChart` + +```python +radarChart = MultiSequencePart(expected_type=RadarChart, store='_charts') +``` + +### `scatterChart` + +```python +scatterChart = MultiSequencePart(expected_type=ScatterChart, store='_charts') +``` + +### `serAx` + +```python +serAx = MultiSequencePart(expected_type=SeriesAxis, store='_axes') +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `stockChart` + +```python +stockChart = MultiSequencePart(expected_type=StockChart, store='_charts') +``` + +### `surface3DChart` + +```python +surface3DChart = MultiSequencePart(expected_type=SurfaceChart3D, store='_charts') +``` + +### `surfaceChart` + +```python +surfaceChart = MultiSequencePart(expected_type=SurfaceChart, store='_charts') +``` + +### `tagname` + +```python +tagname = 'plotArea' +``` + +### `to_tree` + +```python +to_tree(tagname = None, idx = None, namespace = None) +``` + +### `valAx` + +```python +valAx = MultiSequencePart(expected_type=NumericAxis, store='_axes') +``` + + + + + +# `openpyxl.chart.print_settings` + +## `PageMargins` + +```python +PageMargins(l = 0.75, r = 0.75, t = 1, b = 1, header = 0.5, footer = 0.5) +``` + +Bases: `Serialisable` + +Identical to openpyxl.worksheet.page.Pagemargins but element names are different :-/ + +### `b` + +```python +b = b +``` + +### `bottom` + +```python +bottom = Alias('b') +``` + +### `footer` + +```python +footer = footer +``` + +### `header` + +```python +header = header +``` + +### `l` + +```python +l = l +``` + +### `left` + +```python +left = Alias('l') +``` + +### `r` + +```python +r = r +``` + +### `right` + +```python +right = Alias('r') +``` + +### `t` + +```python +t = t +``` + +### `tagname` + +```python +tagname = 'pageMargins' +``` + +### `top` + +```python +top = Alias('t') +``` + +## `PrintSettings` + +```python +PrintSettings(headerFooter = None, pageMargins = None, pageSetup = None) +``` + +Bases: `Serialisable` + +### `headerFooter` + +```python +headerFooter = headerFooter +``` + +### `pageMargins` + +```python +pageMargins = pageMargins +``` + +### `pageSetup` + +```python +pageSetup = pageSetup +``` + +### `tagname` + +```python +tagname = 'printSettings' +``` + + + + + +# `openpyxl.chart.radar_chart` + +## `RadarChart` + +```python +RadarChart(radarStyle = 'standard', varyColors = None, ser = (), dLbls = None, extLst = None, **kw) +``` + +Bases: `ChartBase` + +### `dLbls` + +```python +dLbls = dLbls +``` + +### `dataLabels` + +```python +dataLabels = Alias('dLbls') +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `radarStyle` + +```python +radarStyle = radarStyle +``` + +### `ser` + +```python +ser = ser +``` + +### `tagname` + +```python +tagname = 'radarChart' +``` + +### `type` + +```python +type = Alias('radarStyle') +``` + +### `varyColors` + +```python +varyColors = varyColors +``` + +### `x_axis` + +```python +x_axis = TextAxis() +``` + +### `y_axis` + +```python +y_axis = NumericAxis() +``` + + + + + +# `openpyxl.chart.reader` + +Read a chart + +## `read_chart` + +```python +read_chart(chartspace) +``` + + + + + +# `openpyxl.chart.reference` + +## `DummyWorksheet` + +```python +DummyWorksheet(title) +``` + +### `title` + +```python +title = title +``` + +## `Reference` + +```python +Reference(worksheet = None, min_col = None, min_row = None, max_col = None, max_row = None, range_string = None) +``` + +Bases: `Strict` + +Normalise cell range references + +### `cols` + +```python +cols +``` + +Return all columns in the range + +### `max_col` + +```python +max_col = max_col +``` + +### `max_row` + +```python +max_row = max_row +``` + +### `min_col` + +```python +min_col = min_col +``` + +### `min_row` + +```python +min_row = min_row +``` + +### `pop` + +```python +pop() +``` + +Return and remove the first cell + +### `range_string` + +```python +range_string = String(allow_none=True) +``` + +### `rows` + +```python +rows +``` + +Return all rows in the range + +### `sheetname` + +```python +sheetname +``` + +### `worksheet` + +```python +worksheet = worksheet +``` + + + + + +# `openpyxl.chart.scatter_chart` + +## `ScatterChart` + +```python +ScatterChart(scatterStyle = None, varyColors = None, ser = (), dLbls = None, extLst = None, **kw) +``` + +Bases: `ChartBase` + +### `dLbls` + +```python +dLbls = dLbls +``` + +### `dataLabels` + +```python +dataLabels = Alias('dLbls') +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `scatterStyle` + +```python +scatterStyle = scatterStyle +``` + +### `ser` + +```python +ser = ser +``` + +### `tagname` + +```python +tagname = 'scatterChart' +``` + +### `varyColors` + +```python +varyColors = varyColors +``` + +### `x_axis` + +```python +x_axis = NumericAxis(axId=10, crossAx=20) +``` + +### `y_axis` + +```python +y_axis = NumericAxis(axId=20, crossAx=10) +``` + + + + + +# `openpyxl.chart.series` + +## `Series` + +```python +Series(idx = 0, order = 0, tx = None, spPr = None, pictureOptions = None, dPt = (), dLbls = None, trendline = None, errBars = None, cat = None, val = None, invertIfNegative = None, shape = None, xVal = None, yVal = None, bubbleSize = None, bubble3D = None, marker = None, smooth = None, explosion = None, extLst = None) +``` + +Bases: `Serialisable` + +Generic series object. Should not be instantiated directly. +User the chart.Series factory instead. + +### `bubble3D` + +```python +bubble3D = bubble3D +``` + +### `bubbleSize` + +```python +bubbleSize = bubbleSize +``` + +### `cat` + +```python +cat = cat +``` + +### `dLbls` + +```python +dLbls = dLbls +``` + +### `dPt` + +```python +dPt = dPt +``` + +### `data_points` + +```python +data_points = Alias('dPt') +``` + +### `errBars` + +```python +errBars = errBars +``` + +### `explosion` + +```python +explosion = explosion +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `identifiers` + +```python +identifiers = Alias('cat') +``` + +### `idx` + +```python +idx = idx +``` + +### `invertIfNegative` + +```python +invertIfNegative = invertIfNegative +``` + +### `labels` + +```python +labels = Alias('dLbls') +``` + +### `marker` + +```python +marker = marker +``` + +### `order` + +```python +order = order +``` + +### `pictureOptions` + +```python +pictureOptions = pictureOptions +``` + +### `shape` + +```python +shape = shape +``` + +### `smooth` + +```python +smooth = smooth +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'ser' +``` + +### `title` + +```python +title = Alias('tx') +``` + +### `to_tree` + +```python +to_tree(tagname = None, idx = None) +``` + +The index can need rebasing + +### `trendline` + +```python +trendline = trendline +``` + +### `tx` + +```python +tx = tx +``` + +### `val` + +```python +val = val +``` + +### `xVal` + +```python +xVal = xVal +``` + +### `yVal` + +```python +yVal = yVal +``` + +### `zVal` + +```python +zVal = Alias('bubbleSize') +``` + +## `SeriesLabel` + +```python +SeriesLabel(strRef = None, v = None) +``` + +Bases: `Serialisable` + +### `strRef` + +```python +strRef = strRef +``` + +### `tagname` + +```python +tagname = 'tx' +``` + +### `v` + +```python +v = v +``` + +### `value` + +```python +value = Alias('v') +``` + +## `XYSeries` + +Bases: `Series` + +Dedicated series for charts that have x and y series + +### `bubble3D` + +```python +bubble3D = Series.bubble3D +``` + +### `bubbleSize` + +```python +bubbleSize = Series.bubbleSize +``` + +### `dLbls` + +```python +dLbls = Series.dLbls +``` + +### `dPt` + +```python +dPt = Series.dPt +``` + +### `errBars` + +```python +errBars = Series.errBars +``` + +### `idx` + +```python +idx = Series.idx +``` + +### `invertIfNegative` + +```python +invertIfNegative = Series.invertIfNegative +``` + +### `marker` + +```python +marker = Series.marker +``` + +### `order` + +```python +order = Series.order +``` + +### `smooth` + +```python +smooth = Series.smooth +``` + +### `spPr` + +```python +spPr = Series.spPr +``` + +### `trendline` + +```python +trendline = Series.trendline +``` + +### `tx` + +```python +tx = Series.tx +``` + +### `xVal` + +```python +xVal = Series.xVal +``` + +### `yVal` + +```python +yVal = Series.yVal +``` + +## `attribute_mapping` + +```python +attribute_mapping = {'area': ('idx', 'order', 'tx', 'spPr', 'pictureOptions', 'dPt', 'dLbls', 'errBars', 'trendline', 'cat', 'val'), 'bar': ('idx', 'order', 'tx', 'spPr', 'invertIfNegative', 'pictureOptions', 'dPt', 'dLbls', 'trendline', 'errBars', 'cat', 'val', 'shape'), 'bubble': ('idx', 'order', 'tx', 'spPr', 'invertIfNegative', 'dPt', 'dLbls', 'trendline', 'errBars', 'xVal', 'yVal', 'bubbleSize', 'bubble3D'), 'line': ('idx', 'order', 'tx', 'spPr', 'marker', 'dPt', 'dLbls', 'trendline', 'errBars', 'cat', 'val', 'smooth'), 'pie': ('idx', 'order', 'tx', 'spPr', 'explosion', 'dPt', 'dLbls', 'cat', 'val'), 'radar': ('idx', 'order', 'tx', 'spPr', 'marker', 'dPt', 'dLbls', 'cat', 'val'), 'scatter': ('idx', 'order', 'tx', 'spPr', 'marker', 'dPt', 'dLbls', 'trendline', 'errBars', 'xVal', 'yVal', 'smooth'), 'surface': ('idx', 'order', 'tx', 'spPr', 'cat', 'val')} +``` + + + + + +# `openpyxl.chart.series_factory` + +## `SeriesFactory` + +```python +SeriesFactory(values, xvalues = None, zvalues = None, title = None, title_from_data = False) +``` + +Convenience Factory for creating chart data series. + + + + + +# `openpyxl.chart.shapes` + +## `GraphicalProperties` + +```python +GraphicalProperties(bwMode = None, xfrm = None, noFill = None, solidFill = None, gradFill = None, pattFill = None, ln = None, scene3d = None, custGeom = None, prstGeom = None, sp3d = None, extLst = None) +``` + +Bases: `Serialisable` + +Somewhat vaguely 21.2.2.197 says this: + +This element specifies the formatting for the parent chart element. The +custGeom, prstGeom, scene3d, and xfrm elements are not supported. The +bwMode attribute is not supported. + +This doesn't leave much. And the element is used in different places. + +### `bwMode` + +```python +bwMode = bwMode +``` + +### `custGeom` + +```python +custGeom = custGeom +``` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `gradFill` + +```python +gradFill = gradFill +``` + +### `line` + +```python +line = Alias('ln') +``` + +### `ln` + +```python +ln = ln +``` + +### `noFill` + +```python +noFill = noFill +``` + +### `pattFill` + +```python +pattFill = pattFill +``` + +### `prstGeom` + +```python +prstGeom = prstGeom +``` + +### `scene3d` + +```python +scene3d = scene3d +``` + +### `shape3D` + +```python +shape3D = Alias('sp3d') +``` + +### `solidFill` + +```python +solidFill = solidFill +``` + +### `sp3d` + +```python +sp3d = sp3d +``` + +### `tagname` + +```python +tagname = 'spPr' +``` + +### `transform` + +```python +transform = Alias('xfrm') +``` + +### `xfrm` + +```python +xfrm = xfrm +``` + + + + + +# `openpyxl.chart.stock_chart` + +## `StockChart` + +```python +StockChart(ser = (), dLbls = None, dropLines = None, hiLowLines = None, upDownBars = None, extLst = None, **kw) +``` + +Bases: `ChartBase` + +### `dLbls` + +```python +dLbls = dLbls +``` + +### `dataLabels` + +```python +dataLabels = Alias('dLbls') +``` + +### `dropLines` + +```python +dropLines = dropLines +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `hiLowLines` + +```python +hiLowLines = hiLowLines +``` + +### `ser` + +```python +ser = ser +``` + +### `tagname` + +```python +tagname = 'stockChart' +``` + +### `upDownBars` + +```python +upDownBars = upDownBars +``` + +### `x_axis` + +```python +x_axis = TextAxis() +``` + +### `y_axis` + +```python +y_axis = NumericAxis() +``` + + + + + +# `openpyxl.chart.surface_chart` + +## `BandFormat` + +```python +BandFormat(idx = 0, spPr = None) +``` + +Bases: `Serialisable` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `idx` + +```python +idx = idx +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'bandFmt' +``` + +## `BandFormatList` + +```python +BandFormatList(bandFmt = ()) +``` + +Bases: `Serialisable` + +### `bandFmt` + +```python +bandFmt = bandFmt +``` + +### `tagname` + +```python +tagname = 'bandFmts' +``` + +## `SurfaceChart` + +```python +SurfaceChart(**kw) +``` + +Bases: `SurfaceChart3D` + +### `bandFmts` + +```python +bandFmts = _SurfaceChartBase.bandFmts +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `ser` + +```python +ser = _SurfaceChartBase.ser +``` + +### `tagname` + +```python +tagname = 'surfaceChart' +``` + +### `wireframe` + +```python +wireframe = _SurfaceChartBase.wireframe +``` + +## `SurfaceChart3D` + +```python +SurfaceChart3D(**kw) +``` + +Bases: `_SurfaceChartBase`, `_3DBase` + +### `bandFmts` + +```python +bandFmts = _SurfaceChartBase.bandFmts +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `ser` + +```python +ser = _SurfaceChartBase.ser +``` + +### `tagname` + +```python +tagname = 'surface3DChart' +``` + +### `wireframe` + +```python +wireframe = _SurfaceChartBase.wireframe +``` + +### `x_axis` + +```python +x_axis = TextAxis() +``` + +### `y_axis` + +```python +y_axis = NumericAxis() +``` + +### `z_axis` + +```python +z_axis = SeriesAxis() +``` + + + + + +# `openpyxl.chart.text` + +## `RichText` + +```python +RichText(bodyPr = None, lstStyle = None, p = None) +``` + +Bases: `Serialisable` + +From the specification: 21.2.2.216 + +This element specifies text formatting. The lstStyle element is not supported. + +### `bodyPr` + +```python +bodyPr = bodyPr +``` + +### `lstStyle` + +```python +lstStyle = lstStyle +``` + +### `p` + +```python +p = p +``` + +### `paragraphs` + +```python +paragraphs = Alias('p') +``` + +### `properties` + +```python +properties = Alias('bodyPr') +``` + +### `tagname` + +```python +tagname = 'rich' +``` + +## `Text` + +```python +Text(strRef = None, rich = None) +``` + +Bases: `Serialisable` + +The value can be either a cell reference or a text element +If both are present then the reference will be used. + +### `rich` + +```python +rich = rich +``` + +### `strRef` + +```python +strRef = strRef +``` + +### `tagname` + +```python +tagname = 'tx' +``` + +### `to_tree` + +```python +to_tree(tagname = None, idx = None, namespace = None) +``` + + + + + +# `openpyxl.chart.title` + +## `Title` + +```python +Title(tx = None, layout = None, overlay = None, spPr = None, txPr = None, extLst = None) +``` + +Bases: `Serialisable` + +### `body` + +```python +body = Alias('txPr') +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `layout` + +```python +layout = layout +``` + +### `overlay` + +```python +overlay = overlay +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'title' +``` + +### `text` + +```python +text = Alias('tx') +``` + +### `tx` + +```python +tx = tx +``` + +### `txPr` + +```python +txPr = txPr +``` + +## `TitleDescriptor` + +Bases: `Typed` + +### `allow_none` + +```python +allow_none = True +``` + +### `expected_type` + +```python +expected_type = Title +``` + +## `title_maker` + +```python +title_maker(text) +``` + + + + + +# `openpyxl.chart.trendline` + +## `Trendline` + +```python +Trendline(name = None, spPr = None, trendlineType = 'linear', order = None, period = None, forward = None, backward = None, intercept = None, dispRSqr = None, dispEq = None, trendlineLbl = None, extLst = None) +``` + +Bases: `Serialisable` + +### `backward` + +```python +backward = backward +``` + +### `dispEq` + +```python +dispEq = dispEq +``` + +### `dispRSqr` + +```python +dispRSqr = dispRSqr +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `forward` + +```python +forward = forward +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `intercept` + +```python +intercept = intercept +``` + +### `name` + +```python +name = name +``` + +### `order` + +```python +order = order +``` + +### `period` + +```python +period = period +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'trendline' +``` + +### `trendlineLbl` + +```python +trendlineLbl = trendlineLbl +``` + +### `trendlineType` + +```python +trendlineType = trendlineType +``` + +## `TrendlineLabel` + +```python +TrendlineLabel(layout = None, tx = None, numFmt = None, spPr = None, txPr = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `layout` + +```python +layout = layout +``` + +### `numFmt` + +```python +numFmt = numFmt +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `tagname` + +```python +tagname = 'trendlineLbl' +``` + +### `textProperties` + +```python +textProperties = Alias('txPr') +``` + +### `tx` + +```python +tx = tx +``` + +### `txPr` + +```python +txPr = txPr +``` + + + + + +# `openpyxl.chart.updown_bars` + +## `UpDownBars` + +```python +UpDownBars(gapWidth = 150, upBars = None, downBars = None, extLst = None) +``` + +Bases: `Serialisable` + +### `downBars` + +```python +downBars = downBars +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `gapWidth` + +```python +gapWidth = gapWidth +``` + +### `tagname` + +```python +tagname = 'upbars' +``` + +### `upBars` + +```python +upBars = upBars +``` + + + + + +# `openpyxl.chartsheet.chartsheet` + +## `Chartsheet` + +```python +Chartsheet(sheetPr = None, sheetViews = None, sheetProtection = None, customSheetViews = None, pageMargins = None, pageSetup = None, headerFooter = None, drawing = None, drawingHF = None, picture = None, webPublishItems = None, extLst = None, parent = None, title = '', sheet_state = 'visible') +``` + +Bases: `_WorkbookChild`, `Serialisable` + +### `HeaderFooter` + +```python +HeaderFooter = Alias('headerFooter') +``` + +### `add_chart` + +```python +add_chart(chart) +``` + +### `customSheetViews` + +```python +customSheetViews = customSheetViews +``` + +### `drawing` + +```python +drawing = Drawing('rId1') +``` + +### `drawingHF` + +```python +drawingHF = drawingHF +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `headerFooter` + +```python +headerFooter = Typed(expected_type=HeaderFooter) +``` + +### `mime_type` + +```python +mime_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml' +``` + +### `pageMargins` + +```python +pageMargins = pageMargins +``` + +### `pageSetup` + +```python +pageSetup = pageSetup +``` + +### `picture` + +```python +picture = picture +``` + +### `sheetPr` + +```python +sheetPr = sheetPr +``` + +### `sheetProtection` + +```python +sheetProtection = sheetProtection +``` + +### `sheetViews` + +```python +sheetViews = sheetViews +``` + +### `sheet_state` + +```python +sheet_state = sheet_state +``` + +### `tagname` + +```python +tagname = 'chartsheet' +``` + +### `to_tree` + +```python +to_tree() +``` + +### `webPublishItems` + +```python +webPublishItems = webPublishItems +``` + + + + + +# `openpyxl.chartsheet.custom` + +## `CustomChartsheetView` + +```python +CustomChartsheetView(guid = None, scale = None, state = 'visible', zoomToFit = None, pageMargins = None, pageSetup = None, headerFooter = None) +``` + +Bases: `Serialisable` + +### `guid` + +```python +guid = guid +``` + +### `headerFooter` + +```python +headerFooter = headerFooter +``` + +### `pageMargins` + +```python +pageMargins = pageMargins +``` + +### `pageSetup` + +```python +pageSetup = pageSetup +``` + +### `scale` + +```python +scale = scale +``` + +### `state` + +```python +state = state +``` + +### `tagname` + +```python +tagname = 'customSheetView' +``` + +### `zoomToFit` + +```python +zoomToFit = zoomToFit +``` + +## `CustomChartsheetViews` + +```python +CustomChartsheetViews(customSheetView = None) +``` + +Bases: `Serialisable` + +### `customSheetView` + +```python +customSheetView = customSheetView +``` + +### `tagname` + +```python +tagname = 'customSheetViews' +``` + + + + + +# `openpyxl.chartsheet.properties` + +## `ChartsheetProperties` + +```python +ChartsheetProperties(published = None, codeName = None, tabColor = None) +``` + +Bases: `Serialisable` + +### `codeName` + +```python +codeName = codeName +``` + +### `published` + +```python +published = published +``` + +### `tabColor` + +```python +tabColor = tabColor +``` + +### `tagname` + +```python +tagname = 'sheetPr' +``` + + + + + +# `openpyxl.chartsheet.protection` + +## `ChartsheetProtection` + +```python +ChartsheetProtection(content = None, objects = None, hashValue = None, spinCount = None, saltValue = None, algorithmName = None, password = None) +``` + +Bases: `Serialisable`, `_Protected` + +### `algorithmName` + +```python +algorithmName = algorithmName +``` + +### `content` + +```python +content = content +``` + +### `hashValue` + +```python +hashValue = hashValue +``` + +### `objects` + +```python +objects = objects +``` + +### `password` + +```python +password = password +``` + +### `saltValue` + +```python +saltValue = saltValue +``` + +### `spinCount` + +```python +spinCount = spinCount +``` + +### `tagname` + +```python +tagname = 'sheetProtection' +``` + + + + + +# `openpyxl.chartsheet.publish` + +## `WebPublishItem` + +```python +WebPublishItem(id = None, divId = None, sourceType = None, sourceRef = None, sourceObject = None, destinationFile = None, title = None, autoRepublish = None) +``` + +Bases: `Serialisable` + +### `autoRepublish` + +```python +autoRepublish = autoRepublish +``` + +### `destinationFile` + +```python +destinationFile = destinationFile +``` + +### `divId` + +```python +divId = divId +``` + +### `id` + +```python +id = id +``` + +### `sourceObject` + +```python +sourceObject = sourceObject +``` + +### `sourceRef` + +```python +sourceRef = sourceRef +``` + +### `sourceType` + +```python +sourceType = sourceType +``` + +### `tagname` + +```python +tagname = 'webPublishItem' +``` + +### `title` + +```python +title = title +``` + +## `WebPublishItems` + +```python +WebPublishItems(count = None, webPublishItem = None) +``` + +Bases: `Serialisable` + +### `count` + +```python +count = len(webPublishItem) +``` + +### `tagname` + +```python +tagname = 'WebPublishItems' +``` + +### `webPublishItem` + +```python +webPublishItem = webPublishItem +``` + + + + + +# `openpyxl.chartsheet.relation` + +## `DrawingHF` + +```python +DrawingHF(id = None, lho = None, lhe = None, lhf = None, cho = None, che = None, chf = None, rho = None, rhe = None, rhf = None, lfo = None, lfe = None, lff = None, cfo = None, cfe = None, cff = None, rfo = None, rfe = None, rff = None) +``` + +Bases: `Serialisable` + +### `centerFooterEvenPages` + +```python +centerFooterEvenPages = Alias('cfe') +``` + +### `centerFooterFirstPage` + +```python +centerFooterFirstPage = Alias('cff') +``` + +### `centerFooterOddPages` + +```python +centerFooterOddPages = Alias('cfo') +``` + +### `centerHeaderEvenPages` + +```python +centerHeaderEvenPages = Alias('che') +``` + +### `centerHeaderFirstPage` + +```python +centerHeaderFirstPage = Alias('chf') +``` + +### `centerHeaderOddPages` + +```python +centerHeaderOddPages = Alias('cho') +``` + +### `cfe` + +```python +cfe = cfe +``` + +### `cff` + +```python +cff = cff +``` + +### `cfo` + +```python +cfo = cfo +``` + +### `che` + +```python +che = che +``` + +### `chf` + +```python +chf = chf +``` + +### `cho` + +```python +cho = cho +``` + +### `id` + +```python +id = id +``` + +### `leftFooterEvenPages` + +```python +leftFooterEvenPages = Alias('lfe') +``` + +### `leftFooterFirstPage` + +```python +leftFooterFirstPage = Alias('lff') +``` + +### `leftFooterOddPages` + +```python +leftFooterOddPages = Alias('lfo') +``` + +### `leftHeaderEvenPages` + +```python +leftHeaderEvenPages = Alias('lhe') +``` + +### `leftHeaderFirstPage` + +```python +leftHeaderFirstPage = Alias('lhf') +``` + +### `leftHeaderOddPages` + +```python +leftHeaderOddPages = Alias('lho') +``` + +### `lfe` + +```python +lfe = lfe +``` + +### `lff` + +```python +lff = lff +``` + +### `lfo` + +```python +lfo = lfo +``` + +### `lhe` + +```python +lhe = lhe +``` + +### `lhf` + +```python +lhf = lhf +``` + +### `lho` + +```python +lho = lho +``` + +### `rfe` + +```python +rfe = rfe +``` + +### `rff` + +```python +rff = rff +``` + +### `rfo` + +```python +rfo = rfo +``` + +### `rhe` + +```python +rhe = rhe +``` + +### `rhf` + +```python +rhf = rhf +``` + +### `rho` + +```python +rho = rho +``` + +### `rightFooterEvenPages` + +```python +rightFooterEvenPages = Alias('rfe') +``` + +### `rightFooterFirstPage` + +```python +rightFooterFirstPage = Alias('rff') +``` + +### `rightFooterOddPages` + +```python +rightFooterOddPages = Alias('rfo') +``` + +### `rightHeaderEvenPages` + +```python +rightHeaderEvenPages = Alias('rhe') +``` + +### `rightHeaderFirstPage` + +```python +rightHeaderFirstPage = Alias('rhf') +``` + +### `rightHeaderOddPages` + +```python +rightHeaderOddPages = Alias('rho') +``` + +## `SheetBackgroundPicture` + +```python +SheetBackgroundPicture(id) +``` + +Bases: `Serialisable` + +### `id` + +```python +id = id +``` + +### `tagname` + +```python +tagname = 'picture' +``` + + + + + +# `openpyxl.chartsheet.views` + +## `ChartsheetView` + +```python +ChartsheetView(tabSelected = None, zoomScale = None, workbookViewId = 0, zoomToFit = True, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `tabSelected` + +```python +tabSelected = tabSelected +``` + +### `tagname` + +```python +tagname = 'sheetView' +``` + +### `workbookViewId` + +```python +workbookViewId = workbookViewId +``` + +### `zoomScale` + +```python +zoomScale = zoomScale +``` + +### `zoomToFit` + +```python +zoomToFit = zoomToFit +``` + +## `ChartsheetViewList` + +```python +ChartsheetViewList(sheetView = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `sheetView` + +```python +sheetView = sheetView +``` + +### `tagname` + +```python +tagname = 'sheetViews' +``` + + + + + +# `openpyxl.comments.author` + +## `AuthorList` + +```python +AuthorList(author = ()) +``` + +Bases: `Serialisable` + +### `author` + +```python +author = author +``` + +### `authors` + +```python +authors = Alias('author') +``` + +### `tagname` + +```python +tagname = 'authors' +``` + + + + + +# `openpyxl.comments.comment_sheet` + +## `CommentRecord` + +```python +CommentRecord(ref = '', authorId = 0, guid = None, shapeId = 0, text = None, commentPr = None, author = None, height = 79, width = 144) +``` + +Bases: `Serialisable` + +### `author` + +```python +author = author +``` + +### `authorId` + +```python +authorId = authorId +``` + +### `commentPr` + +```python +commentPr = commentPr +``` + +### `content` + +```python +content +``` + +Remove all inline formatting and stuff + +### `from_cell` + +```python +from_cell(cell) +``` + +Class method to convert cell comment + +### `guid` + +```python +guid = guid +``` + +### `height` + +```python +height = height +``` + +### `ref` + +```python +ref = ref +``` + +### `shapeId` + +```python +shapeId = shapeId +``` + +### `tagname` + +```python +tagname = 'comment' +``` + +### `text` + +```python +text = text +``` + +### `width` + +```python +width = width +``` + +## `CommentSheet` + +```python +CommentSheet(authors = None, commentList = None, extLst = None) +``` + +Bases: `Serialisable` + +### `authors` + +```python +authors = authors +``` + +### `commentList` + +```python +commentList = commentList +``` + +### `comments` + +```python +comments +``` + +Return a dictionary of comments keyed by coord + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `from_comments` + +```python +from_comments(comments) +``` + +Create a comment sheet from a list of comments for a particular worksheet + +### `mime_type` + +```python +mime_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml' +``` + +### `path` + +```python +path +``` + +Return path within the archive + +### `tagname` + +```python +tagname = 'comments' +``` + +### `to_tree` + +```python +to_tree() +``` + +### `write_shapes` + +```python +write_shapes(vml = None) +``` + +Create the VML for comments + +## `Properties` + +```python +Properties(locked = None, defaultSize = None, _print = None, disabled = None, uiObject = None, autoFill = None, autoLine = None, altText = None, textHAlign = None, textVAlign = None, lockText = None, justLastX = None, autoScale = None, rowHidden = None, colHidden = None, anchor = None) +``` + +Bases: `Serialisable` + +### `altText` + +```python +altText = altText +``` + +### `anchor` + +```python +anchor = anchor +``` + +### `autoFill` + +```python +autoFill = autoFill +``` + +### `autoLine` + +```python +autoLine = autoLine +``` + +### `autoScale` + +```python +autoScale = autoScale +``` + +### `colHidden` + +```python +colHidden = colHidden +``` + +### `defaultSize` + +```python +defaultSize = defaultSize +``` + +### `disabled` + +```python +disabled = disabled +``` + +### `justLastX` + +```python +justLastX = justLastX +``` + +### `lockText` + +```python +lockText = lockText +``` + +### `locked` + +```python +locked = locked +``` + +### `rowHidden` + +```python +rowHidden = rowHidden +``` + +### `textHAlign` + +```python +textHAlign = textHAlign +``` + +### `textVAlign` + +```python +textVAlign = textVAlign +``` + +### `uiObject` + +```python +uiObject = uiObject +``` + + + + + +# `openpyxl.comments.comments` + +## `Comment` + +```python +Comment(text, author, height = 79, width = 144) +``` + +### `author` + +```python +author = author +``` + +### `bind` + +```python +bind(cell) +``` + +Bind comment to a particular cell + +### `content` + +```python +content = text +``` + +### `height` + +```python +height = height +``` + +### `parent` + +```python +parent +``` + +### `text` + +```python +text +``` + +Any comment text stripped of all formatting. + +### `unbind` + +```python +unbind() +``` + +Unbind a comment from a cell + +### `width` + +```python +width = width +``` + + + + + +# `openpyxl.comments.shape_writer` + +## `ShapeWriter` + +```python +ShapeWriter(comments) +``` + +Create VML for comments + +### `add_comment_shape` + +```python +add_comment_shape(root, idx, coord, height, width) +``` + +### `add_comment_shapetype` + +```python +add_comment_shapetype(root) +``` + +### `comments` + +```python +comments = comments +``` + +### `vml` + +```python +vml = None +``` + +### `vml_path` + +```python +vml_path = None +``` + +### `write` + +```python +write(root) +``` + +## `excelns` + +```python +excelns = 'urn:schemas-microsoft-com:office:excel' +``` + +## `officens` + +```python +officens = 'urn:schemas-microsoft-com:office:office' +``` + +## `vmlns` + +```python +vmlns = 'urn:schemas-microsoft-com:vml' +``` + + + + + +# `openpyxl.compat` + +## `DummyCode` + +## `deprecated` + +```python +deprecated(reason) +``` + +## `string_types` + +```python +string_types = (type(b''), type('')) +``` + + + + + +# `openpyxl.compat.numbers` + +## `NUMERIC_TYPES` + +```python +NUMERIC_TYPES = (int, float, Decimal) +``` + +## `NUMPY` + +```python +NUMPY = True +``` + + + + + +# `openpyxl.compat.product` + +math.prod equivalent for < Python 3.8 + +## `product` + +```python +product(sequence) +``` + + + + + +# `openpyxl.compat.singleton` + +## `Cached` + +```python +Cached(*args, **kw) +``` + +Bases: `type` + +Caching metaclass +Child classes will only create new instances of themselves if +one doesn't already exist. Does not work with __slots__ + +## `Singleton` + +```python +Singleton(*args, **kw) +``` + +Bases: `type` + +Singleton metaclass +Based on Python Cookbook 3rd Edition Recipe 9.13 +Only one instance of a class can exist. Does not work with __slots__ + + + + + +# `openpyxl.compat.strings` + +## `VER` + +```python +VER = sys.version_info +``` + +## `safe_string` + +```python +safe_string(value) +``` + +Safely and consistently format numeric values + + + + + +# `openpyxl.descriptors.base` + +Based on Python Cookbook 3rd Edition, 8.13 + +## `ASCII` + +Bases: `Typed` + +### `expected_type` + +```python +expected_type = bytes +``` + +## `Alias` + +```python +Alias(alias) +``` + +Bases: `Descriptor` + +Aliases can be used when either the desired attribute name is not allowed +or confusing in Python (eg. "type") or a more descriptive name is desired +(eg. "underline" for "u") + +### `alias` + +```python +alias = alias +``` + +## `Bool` + +Bases: `Convertible` + +### `expected_type` + +```python +expected_type = bool +``` + +## `Convertible` + +Bases: `Typed` + +Values must be convertible to a particular type + +## `DEBUG` + +```python +DEBUG = False +``` + +## `DateTime` + +Bases: `Typed` + +### `expected_type` + +```python +expected_type = datetime.datetime +``` + +## `Default` + +```python +Default(name = None, **kw) +``` + +Bases: `Typed` + +When called returns an instance of the expected type. +Additional default values can be passed in to the descriptor + +## `Descriptor` + +```python +Descriptor(name = None, **kw) +``` + +### `name` + +```python +name = name +``` + +## `Float` + +Bases: `Convertible` + +### `expected_type` + +```python +expected_type = float +``` + +## `Integer` + +Bases: `Convertible` + +### `expected_type` + +```python +expected_type = int +``` + +## `Length` + +```python +Length(name = None, **kw) +``` + +Bases: `Descriptor` + +## `MatchPattern` + +```python +MatchPattern(name = None, **kw) +``` + +Bases: `Descriptor` + +Values must match a regex pattern + +### `allow_none` + +```python +allow_none = False +``` + +### `test_pattern` + +```python +test_pattern = re.compile(self.pattern, re.VERBOSE) +``` + +## `Max` + +```python +Max(**kw) +``` + +Bases: `Convertible` + +Values must be less than a `max` value + +### `allow_none` + +```python +allow_none = False +``` + +### `expected_type` + +```python +expected_type = float +``` + +## `Min` + +```python +Min(**kw) +``` + +Bases: `Convertible` + +Values must be greater than a `min` value + +### `allow_none` + +```python +allow_none = False +``` + +### `expected_type` + +```python +expected_type = float +``` + +## `MinMax` + +Bases: `Min`, `Max` + +Values must be greater than `min` value and less than a `max` one + +## `NoneSet` + +```python +NoneSet(name = None, **kw) +``` + +Bases: `Set` + +'none' will be treated as None + +## `Set` + +```python +Set(name = None, **kw) +``` + +Bases: `Descriptor` + +Value can only be from a set of know values + +## `String` + +Bases: `Typed` + +### `expected_type` + +```python +expected_type = str +``` + +## `Text` + +Bases: `String`, `Convertible` + +## `Tuple` + +Bases: `Typed` + +### `expected_type` + +```python +expected_type = tuple +``` + +## `Typed` + +```python +Typed(*args, **kw) +``` + +Bases: `Descriptor` + +Values must of a particular type + +### `allow_none` + +```python +allow_none = False +``` + +### `expected_type` + +```python +expected_type = type(None) +``` + +### `nested` + +```python +nested = False +``` + + + + + +# `openpyxl.descriptors.container` + +Utility list for top level containers that contain one type of element + +## `ElementList` + +Bases: `list` + +### `append` + +```python +append(value) +``` + +### `expected_type` + +```python +expected_type +``` + +### `from_tree` + +```python +from_tree(tree) +``` + +### `tagname` + +```python +tagname +``` + +### `to_tree` + +```python +to_tree() +``` + + + + + +# `openpyxl.descriptors.excel` + +Excel specific descriptors + +## `Base64Binary` + +Bases: `MatchPattern` + +### `pattern` + +```python +pattern = '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$' +``` + +## `CellRange` + +Bases: `MatchPattern` + +### `allow_none` + +```python +allow_none = True +``` + +### `pattern` + +```python +pattern = '^[$]?([A-Za-z]{1,3})[$]?(\\d+)(:[$]?([A-Za-z]{1,3})[$]?(\\d+)?)?$|^[A-Za-z]{1,3}:[A-Za-z]{1,3}$' +``` + +## `Coordinate` + +```python +Coordinate = Integer +``` + +## `Extension` + +```python +Extension(uri = None) +``` + +Bases: `Serialisable` + +### `uri` + +```python +uri = uri +``` + +## `ExtensionList` + +```python +ExtensionList(ext = ()) +``` + +Bases: `Serialisable` + +### `ext` + +```python +ext = ext +``` + +## `Guid` + +Bases: `MatchPattern` + +### `pattern` + +```python +pattern = '{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\\}' +``` + +## `HexBinary` + +Bases: `MatchPattern` + +### `pattern` + +```python +pattern = '[0-9a-fA-F]+$' +``` + +## `Percentage` + +Bases: `MinMax` + +### `max` + +```python +max = 1000000 +``` + +### `min` + +```python +min = -1000000 +``` + +### `pattern` + +```python +pattern = '((100)|([0-9][0-9]?))(\\.[0-9][0-9]?)?%' +``` + +## `Relation` + +Bases: `String` + +### `allow_none` + +```python +allow_none = True +``` + +### `namespace` + +```python +namespace = REL_NS +``` + +## `TextPoint` + +Bases: `MinMax` + +Size in hundredths of points. +In theory other units of measurement can be used but these are unbounded + +### `expected_type` + +```python +expected_type = int +``` + +### `max` + +```python +max = 400000 +``` + +### `min` + +```python +min = -400000 +``` + +## `UniversalMeasure` + +Bases: `MatchPattern` + +### `pattern` + +```python +pattern = '[0-9]+(\\.[0-9]+)?(mm`cm`in`pt`pc|pi)' +``` diff --git a/addons/sandbox/skills/xlsx/references/api-002.md b/addons/sandbox/skills/xlsx/references/api-002.md new file mode 100644 index 000000000..96948c8c6 --- /dev/null +++ b/addons/sandbox/skills/xlsx/references/api-002.md @@ -0,0 +1,7251 @@ + + + + +# `openpyxl.descriptors` + +## `MetaSerialisable` + +Bases: `type` + +## `MetaStrict` + +Bases: `type` + +## `Strict` + + + + + +# `openpyxl.descriptors.namespace` + +## `namespaced` + +```python +namespaced(obj, tagname, namespace = None) +``` + +Utility to create a namespaced tag for an object + + + + + +# `openpyxl.descriptors.nested` + +Generic serialisable classes + +## `EmptyTag` + +Bases: `Nested`, `Bool` + +Boolean if a tag exists or not. + +### `from_tree` + +```python +from_tree(node) +``` + +### `to_tree` + +```python +to_tree(tagname = None, value = None, namespace = None) +``` + +## `Nested` + +Bases: `Descriptor` + +### `attribute` + +```python +attribute = 'val' +``` + +### `from_tree` + +```python +from_tree(node) +``` + +### `nested` + +```python +nested = True +``` + +### `to_tree` + +```python +to_tree(tagname = None, value = None, namespace = None) +``` + +## `NestedBool` + +Bases: `NestedValue`, `Bool` + +### `from_tree` + +```python +from_tree(node) +``` + +## `NestedFloat` + +Bases: `NestedValue`, `Float` + +## `NestedInteger` + +Bases: `NestedValue`, `Integer` + +## `NestedMinMax` + +Bases: `Nested`, `MinMax` + +## `NestedNoneSet` + +Bases: `Nested`, `NoneSet` + +## `NestedSet` + +Bases: `Nested`, `Set` + +## `NestedString` + +Bases: `NestedValue`, `String` + +## `NestedText` + +Bases: `NestedValue` + +Represents any nested tag with the value as the contents of the tag + +### `from_tree` + +```python +from_tree(node) +``` + +### `to_tree` + +```python +to_tree(tagname = None, value = None, namespace = None) +``` + +## `NestedValue` + +Bases: `Nested`, `Convertible` + +Nested tag storing the value on the 'val' attribute + + + + + +# `openpyxl.descriptors.sequence` + +## `MultiSequence` + +Bases: `Sequence` + +Sequences can contain objects with different tags + +### `to_tree` + +```python +to_tree(tagname, obj, namespace = None) +``` + +Convert the sequence represented by the descriptor to an XML element + +## `MultiSequencePart` + +```python +MultiSequencePart(expected_type, store) +``` + +Bases: `Alias` + +Allow a multisequence to be built up from parts + +Excluded from the instance __elements__ or __attrs__ as is effectively an Alias + +### `expected_type` + +```python +expected_type = expected_type +``` + +### `store` + +```python +store = store +``` + +## `NestedSequence` + +Bases: `Sequence` + +Wrap a sequence in an containing object + +### `count` + +```python +count = False +``` + +### `from_tree` + +```python +from_tree(node) +``` + +### `to_tree` + +```python +to_tree(tagname, obj, namespace = None) +``` + +## `Sequence` + +Bases: `Descriptor` + +A sequence (list or tuple) that may only contain objects of the declared +type + +### `container` + +```python +container = list +``` + +### `expected_type` + +```python +expected_type = type(None) +``` + +### `idx_base` + +```python +idx_base = 0 +``` + +### `seq_types` + +```python +seq_types = (list, tuple) +``` + +### `to_tree` + +```python +to_tree(tagname, obj, namespace = None) +``` + +Convert the sequence represented by the descriptor to an XML element + +### `unique` + +```python +unique = False +``` + +## `UniqueSequence` + +Bases: `Sequence` + +Use a set to keep values unique + +### `container` + +```python +container = set +``` + +### `seq_types` + +```python +seq_types = (list, tuple, set) +``` + +## `ValueSequence` + +Bases: `Sequence` + +A sequence of primitive types that are stored as a single attribute. +"val" is the default attribute + +### `attribute` + +```python +attribute = 'val' +``` + +### `from_tree` + +```python +from_tree(node) +``` + +### `to_tree` + +```python +to_tree(tagname, obj, namespace = None) +``` + + + + + +# `openpyxl.descriptors.serialisable` + +## `KEYWORDS` + +```python +KEYWORDS = frozenset(kwlist) +``` + +## `Serialisable` + +Objects can serialise to XML their attributes and child objects. +The following class attributes are created by the metaclass at runtime: +__attrs__ = attributes +__nested__ = single-valued child treated as an attribute +__elements__ = child elements + +### `from_tree` + +```python +from_tree(node) +``` + +Create object from XML + +### `idx_base` + +```python +idx_base = 0 +``` + +### `namespace` + +```python +namespace = None +``` + +### `tagname` + +```python +tagname +``` + +### `to_tree` + +```python +to_tree(tagname = None, idx = None, namespace = None) +``` + +## `seq_types` + +```python +seq_types = (list, tuple) +``` + + + + + +# `openpyxl.descriptors.slots` + +## `AutoSlotProperties` + +Bases: `type` + + + + + +# `openpyxl.drawing.colors` + +## `ColorChoice` + +```python +ColorChoice(scrgbClr = None, srgbClr = None, hslClr = None, sysClr = None, schemeClr = None, prstClr = None) +``` + +Bases: `Serialisable` + +### `RGB` + +```python +RGB = Alias('srgbClr') +``` + +### `RGBPercent` + +```python +RGBPercent = Alias('scrgbClr') +``` + +### `hslClr` + +```python +hslClr = hslClr +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `prstClr` + +```python +prstClr = prstClr +``` + +### `schemeClr` + +```python +schemeClr = schemeClr +``` + +### `scrgbClr` + +```python +scrgbClr = scrgbClr +``` + +### `srgbClr` + +```python +srgbClr = srgbClr +``` + +### `sysClr` + +```python +sysClr = sysClr +``` + +### `tagname` + +```python +tagname = 'colorChoice' +``` + +## `ColorChoiceDescriptor` + +Bases: `Typed` + +Objects can choose from 7 different kinds of color system. +Assume RGBHex if a string is passed in. + +### `allow_none` + +```python +allow_none = True +``` + +### `expected_type` + +```python +expected_type = ColorChoice +``` + +## `ColorMapping` + +```python +ColorMapping(bg1 = 'lt1', tx1 = 'dk1', bg2 = 'lt2', tx2 = 'dk2', accent1 = 'accent1', accent2 = 'accent2', accent3 = 'accent3', accent4 = 'accent4', accent5 = 'accent5', accent6 = 'accent6', hlink = 'hlink', folHlink = 'folHlink', extLst = None) +``` + +Bases: `Serialisable` + +### `accent1` + +```python +accent1 = accent1 +``` + +### `accent2` + +```python +accent2 = accent2 +``` + +### `accent3` + +```python +accent3 = accent3 +``` + +### `accent4` + +```python +accent4 = accent4 +``` + +### `accent5` + +```python +accent5 = accent5 +``` + +### `accent6` + +```python +accent6 = accent6 +``` + +### `bg1` + +```python +bg1 = bg1 +``` + +### `bg2` + +```python +bg2 = bg2 +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `folHlink` + +```python +folHlink = folHlink +``` + +### `hlink` + +```python +hlink = hlink +``` + +### `tagname` + +```python +tagname = 'clrMapOvr' +``` + +### `tx1` + +```python +tx1 = tx1 +``` + +### `tx2` + +```python +tx2 = tx2 +``` + +## `HSLColor` + +```python +HSLColor(hue = None, sat = None, lum = None) +``` + +Bases: `Serialisable` + +### `hue` + +```python +hue = hue +``` + +### `lum` + +```python +lum = lum +``` + +### `sat` + +```python +sat = sat +``` + +### `tagname` + +```python +tagname = 'hslClr' +``` + +## `PRESET_COLORS` + +```python +PRESET_COLORS = ['aliceBlue', 'antiqueWhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedAlmond', 'blue', 'blueViolet', 'brown', 'burlyWood', 'cadetBlue', 'chartreuse', 'chocolate', 'coral', 'cornflowerBlue', 'cornsilk', 'crimson', 'cyan', 'darkBlue', 'darkCyan', 'darkGoldenrod', 'darkGray', 'darkGrey', 'darkGreen', 'darkKhaki', 'darkMagenta', 'darkOliveGreen', 'darkOrange', 'darkOrchid', 'darkRed', 'darkSalmon', 'darkSeaGreen', 'darkSlateBlue', 'darkSlateGray', 'darkSlateGrey', 'darkTurquoise', 'darkViolet', 'dkBlue', 'dkCyan', 'dkGoldenrod', 'dkGray', 'dkGrey', 'dkGreen', 'dkKhaki', 'dkMagenta', 'dkOliveGreen', 'dkOrange', 'dkOrchid', 'dkRed', 'dkSalmon', 'dkSeaGreen', 'dkSlateBlue', 'dkSlateGray', 'dkSlateGrey', 'dkTurquoise', 'dkViolet', 'deepPink', 'deepSkyBlue', 'dimGray', 'dimGrey', 'dodgerBlue', 'firebrick', 'floralWhite', 'forestGreen', 'fuchsia', 'gainsboro', 'ghostWhite', 'gold', 'goldenrod', 'gray', 'grey', 'green', 'greenYellow', 'honeydew', 'hotPink', 'indianRed', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderBlush', 'lawnGreen', 'lemonChiffon', 'lightBlue', 'lightCoral', 'lightCyan', 'lightGoldenrodYellow', 'lightGray', 'lightGrey', 'lightGreen', 'lightPink', 'lightSalmon', 'lightSeaGreen', 'lightSkyBlue', 'lightSlateGray', 'lightSlateGrey', 'lightSteelBlue', 'lightYellow', 'ltBlue', 'ltCoral', 'ltCyan', 'ltGoldenrodYellow', 'ltGray', 'ltGrey', 'ltGreen', 'ltPink', 'ltSalmon', 'ltSeaGreen', 'ltSkyBlue', 'ltSlateGray', 'ltSlateGrey', 'ltSteelBlue', 'ltYellow', 'lime', 'limeGreen', 'linen', 'magenta', 'maroon', 'medAquamarine', 'medBlue', 'medOrchid', 'medPurple', 'medSeaGreen', 'medSlateBlue', 'medSpringGreen', 'medTurquoise', 'medVioletRed', 'mediumAquamarine', 'mediumBlue', 'mediumOrchid', 'mediumPurple', 'mediumSeaGreen', 'mediumSlateBlue', 'mediumSpringGreen', 'mediumTurquoise', 'mediumVioletRed', 'midnightBlue', 'mintCream', 'mistyRose', 'moccasin', 'navajoWhite', 'navy', 'oldLace', 'olive', 'oliveDrab', 'orange', 'orangeRed', 'orchid', 'paleGoldenrod', 'paleGreen', 'paleTurquoise', 'paleVioletRed', 'papayaWhip', 'peachPuff', 'peru', 'pink', 'plum', 'powderBlue', 'purple', 'red', 'rosyBrown', 'royalBlue', 'saddleBrown', 'salmon', 'sandyBrown', 'seaGreen', 'seaShell', 'sienna', 'silver', 'skyBlue', 'slateBlue', 'slateGray', 'slateGrey', 'snow', 'springGreen', 'steelBlue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'white', 'whiteSmoke', 'yellow', 'yellowGreen'] +``` + +## `RGBPercent` + +```python +RGBPercent(r = None, g = None, b = None) +``` + +Bases: `Serialisable` + +### `b` + +```python +b = b +``` + +### `g` + +```python +g = g +``` + +### `r` + +```python +r = r +``` + +### `tagname` + +```python +tagname = 'rgbClr' +``` + +## `SCHEME_COLORS` + +```python +SCHEME_COLORS = ['bg1', 'tx1', 'bg2', 'tx2', 'accent1', 'accent2', 'accent3', 'accent4', 'accent5', 'accent6', 'hlink', 'folHlink', 'phClr', 'dk1', 'lt1', 'dk2', 'lt2'] +``` + +## `SchemeColor` + +```python +SchemeColor(tint = None, shade = None, comp = None, inv = None, gray = None, alpha = None, alphaOff = None, alphaMod = None, hue = None, hueOff = None, hueMod = None, sat = None, satOff = None, satMod = None, lum = None, lumOff = None, lumMod = None, red = None, redOff = None, redMod = None, green = None, greenOff = None, greenMod = None, blue = None, blueOff = None, blueMod = None, gamma = None, invGamma = None, val = None) +``` + +Bases: `Serialisable` + +### `alpha` + +```python +alpha = alpha +``` + +### `alphaMod` + +```python +alphaMod = alphaMod +``` + +### `alphaOff` + +```python +alphaOff = alphaOff +``` + +### `blue` + +```python +blue = blue +``` + +### `blueMod` + +```python +blueMod = blueMod +``` + +### `blueOff` + +```python +blueOff = blueOff +``` + +### `comp` + +```python +comp = comp +``` + +### `gamma` + +```python +gamma = gamma +``` + +### `gray` + +```python +gray = gray +``` + +### `green` + +```python +green = green +``` + +### `greenMod` + +```python +greenMod = greenMod +``` + +### `greenOff` + +```python +greenOff = greenOff +``` + +### `hue` + +```python +hue = hue +``` + +### `hueMod` + +```python +hueMod = hueMod +``` + +### `hueOff` + +```python +hueOff = hueOff +``` + +### `inv` + +```python +inv = inv +``` + +### `invGamma` + +```python +invGamma = invGamma +``` + +### `lum` + +```python +lum = lum +``` + +### `lumMod` + +```python +lumMod = lumMod +``` + +### `lumOff` + +```python +lumOff = lumOff +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `red` + +```python +red = red +``` + +### `redMod` + +```python +redMod = redMod +``` + +### `redOff` + +```python +redOff = redOff +``` + +### `sat` + +```python +sat = sat +``` + +### `satMod` + +```python +satMod = satMod +``` + +### `satOff` + +```python +satOff = satOff +``` + +### `shade` + +```python +shade = shade +``` + +### `tagname` + +```python +tagname = 'schemeClr' +``` + +### `tint` + +```python +tint = tint +``` + +### `val` + +```python +val = val +``` + +## `SystemColor` + +```python +SystemColor(val = 'windowText', lastClr = None, tint = None, shade = None, comp = None, inv = None, gray = None, alpha = None, alphaOff = None, alphaMod = None, hue = None, hueOff = None, hueMod = None, sat = None, satOff = None, satMod = None, lum = None, lumOff = None, lumMod = None, red = None, redOff = None, redMod = None, green = None, greenOff = None, greenMod = None, blue = None, blueOff = None, blueMod = None, gamma = None, invGamma = None) +``` + +Bases: `Serialisable` + +### `alpha` + +```python +alpha = alpha +``` + +### `alphaMod` + +```python +alphaMod = alphaMod +``` + +### `alphaOff` + +```python +alphaOff = alphaOff +``` + +### `blue` + +```python +blue = blue +``` + +### `blueMod` + +```python +blueMod = blueMod +``` + +### `blueOff` + +```python +blueOff = blueOff +``` + +### `comp` + +```python +comp = comp +``` + +### `gamma` + +```python +gamma = gamma +``` + +### `gray` + +```python +gray = gray +``` + +### `green` + +```python +green = green +``` + +### `greenMod` + +```python +greenMod = greenMod +``` + +### `greenOff` + +```python +greenOff = greenOff +``` + +### `hue` + +```python +hue = hue +``` + +### `hueMod` + +```python +hueMod = hueMod +``` + +### `hueOff` + +```python +hueOff = hueOff +``` + +### `inv` + +```python +inv = inv +``` + +### `invGamma` + +```python +invGamma = invGamma +``` + +### `lastClr` + +```python +lastClr = lastClr +``` + +### `lum` + +```python +lum = lum +``` + +### `lumMod` + +```python +lumMod = lumMod +``` + +### `lumOff` + +```python +lumOff = lumOff +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `red` + +```python +red = red +``` + +### `redMod` + +```python +redMod = redMod +``` + +### `redOff` + +```python +redOff = redOff +``` + +### `sat` + +```python +sat = sat +``` + +### `satMod` + +```python +satMod = satMod +``` + +### `satOff` + +```python +satOff = satOff +``` + +### `shade` + +```python +shade = shade +``` + +### `tagname` + +```python +tagname = 'sysClr' +``` + +### `tint` + +```python +tint = tint +``` + +### `val` + +```python +val = val +``` + +## `Transform` + +Bases: `Serialisable` + + + + + +# `openpyxl.drawing.connector` + +## `Connection` + +```python +Connection(id = None, idx = None) +``` + +Bases: `Serialisable` + +### `id` + +```python +id = id +``` + +### `idx` + +```python +idx = idx +``` + +## `ConnectorLocking` + +```python +ConnectorLocking(extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = extLst +``` + +## `ConnectorNonVisual` + +```python +ConnectorNonVisual(cNvPr = None, cNvCxnSpPr = None) +``` + +Bases: `Serialisable` + +### `cNvCxnSpPr` + +```python +cNvCxnSpPr = cNvCxnSpPr +``` + +### `cNvPr` + +```python +cNvPr = cNvPr +``` + +## `ConnectorShape` + +```python +ConnectorShape(nvCxnSpPr = None, spPr = None, style = None, macro = None, fPublished = None) +``` + +Bases: `Serialisable` + +### `fPublished` + +```python +fPublished = fPublished +``` + +### `macro` + +```python +macro = macro +``` + +### `nvCxnSpPr` + +```python +nvCxnSpPr = nvCxnSpPr +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `style` + +```python +style = style +``` + +### `tagname` + +```python +tagname = 'cxnSp' +``` + +## `NonVisualConnectorProperties` + +```python +NonVisualConnectorProperties(cxnSpLocks = None, stCxn = None, endCxn = None, extLst = None) +``` + +Bases: `Serialisable` + +### `cxnSpLocks` + +```python +cxnSpLocks = cxnSpLocks +``` + +### `endCxn` + +```python +endCxn = endCxn +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `stCxn` + +```python +stCxn = stCxn +``` + +## `Shape` + +```python +Shape(macro = None, textlink = None, fPublished = None, fLocksText = None, nvSpPr = None, spPr = None, style = None, txBody = None) +``` + +Bases: `Serialisable` + +### `fLocksText` + +```python +fLocksText = fLocksText +``` + +### `fPublished` + +```python +fPublished = fPublished +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `macro` + +```python +macro = macro +``` + +### `meta` + +```python +meta = Alias('nvSpPr') +``` + +### `nvSpPr` + +```python +nvSpPr = nvSpPr +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `style` + +```python +style = style +``` + +### `textlink` + +```python +textlink = textlink +``` + +### `txBody` + +```python +txBody = txBody +``` + +## `ShapeMeta` + +```python +ShapeMeta(cNvPr = None, cNvSpPr = None) +``` + +Bases: `Serialisable` + +### `cNvPr` + +```python +cNvPr = cNvPr +``` + +### `cNvSpPr` + +```python +cNvSpPr = cNvSpPr +``` + +### `tagname` + +```python +tagname = 'nvSpPr' +``` + + + + + +# `openpyxl.drawing.drawing` + +## `Drawing` + +```python +Drawing() +``` + +a drawing object - eg container for shapes or charts +we assume user specifies dimensions in pixels; units are +converted to EMU in the drawing part + +### `anchor` + +```python +anchor +``` + +### `anchorcol` + +```python +anchorcol = 0 +``` + +### `anchorrow` + +```python +anchorrow = 0 +``` + +### `anchortype` + +```python +anchortype = 'absolute' +``` + +### `coordinates` + +```python +coordinates = ((1, 2), (16, 8)) +``` + +### `count` + +```python +count = 0 +``` + +### `description` + +```python +description = '' +``` + +### `height` + +```python +height +``` + +### `left` + +```python +left = 0 +``` + +### `name` + +```python +name = '' +``` + +### `resize_proportional` + +```python +resize_proportional = False +``` + +### `rotation` + +```python +rotation = 0 +``` + +### `set_dimension` + +```python +set_dimension(w = 0, h = 0) +``` + +### `top` + +```python +top = 0 +``` + +### `width` + +```python +width +``` + + + + + +# `openpyxl.drawing.effect` + +## `AlphaBiLevelEffect` + +```python +AlphaBiLevelEffect(thresh = None) +``` + +Bases: `Serialisable` + +### `thresh` + +```python +thresh = thresh +``` + +## `AlphaCeilingEffect` + +Bases: `Serialisable` + +## `AlphaFloorEffect` + +Bases: `Serialisable` + +## `AlphaInverseEffect` + +Bases: `Serialisable` + +## `AlphaModulateEffect` + +```python +AlphaModulateEffect(cont = None) +``` + +Bases: `Serialisable` + +### `cont` + +```python +cont = cont +``` + +## `AlphaModulateFixedEffect` + +```python +AlphaModulateFixedEffect(amt = None) +``` + +Bases: `Serialisable` + +### `amt` + +```python +amt = amt +``` + +## `AlphaReplaceEffect` + +```python +AlphaReplaceEffect(a = None) +``` + +Bases: `Serialisable` + +### `a` + +```python +a = a +``` + +## `BiLevelEffect` + +```python +BiLevelEffect(thresh = None) +``` + +Bases: `Serialisable` + +### `thresh` + +```python +thresh = thresh +``` + +## `BlurEffect` + +```python +BlurEffect(rad = None, grow = None) +``` + +Bases: `Serialisable` + +### `grow` + +```python +grow = grow +``` + +### `rad` + +```python +rad = rad +``` + +## `Color` + +Bases: `Serialisable` + +## `ColorChangeEffect` + +```python +ColorChangeEffect(useA = None, clrFrom = None, clrTo = None) +``` + +Bases: `Serialisable` + +### `clrFrom` + +```python +clrFrom = clrFrom +``` + +### `clrTo` + +```python +clrTo = clrTo +``` + +### `useA` + +```python +useA = useA +``` + +## `ColorReplaceEffect` + +Bases: `Serialisable` + +## `DuotoneEffect` + +Bases: `Serialisable` + +## `EffectContainer` + +```python +EffectContainer(type = None, name = None) +``` + +Bases: `Serialisable` + +### `name` + +```python +name = name +``` + +### `type` + +```python +type = type +``` + +## `EffectList` + +```python +EffectList(blur = None, fillOverlay = None, glow = None, innerShdw = None, outerShdw = None, prstShdw = None, reflection = None, softEdge = None) +``` + +Bases: `Serialisable` + +### `blur` + +```python +blur = blur +``` + +### `fillOverlay` + +```python +fillOverlay = fillOverlay +``` + +### `glow` + +```python +glow = glow +``` + +### `innerShdw` + +```python +innerShdw = innerShdw +``` + +### `outerShdw` + +```python +outerShdw = outerShdw +``` + +### `prstShdw` + +```python +prstShdw = prstShdw +``` + +### `reflection` + +```python +reflection = reflection +``` + +### `softEdge` + +```python +softEdge = softEdge +``` + +## `FillOverlayEffect` + +```python +FillOverlayEffect(blend = None) +``` + +Bases: `Serialisable` + +### `blend` + +```python +blend = blend +``` + +## `GlowEffect` + +```python +GlowEffect(rad = None, **kw) +``` + +Bases: `ColorChoice` + +### `hslClr` + +```python +hslClr = ColorChoice.hslClr +``` + +### `prstClr` + +```python +prstClr = ColorChoice.prstClr +``` + +### `rad` + +```python +rad = rad +``` + +### `schemeClr` + +```python +schemeClr = ColorChoice.schemeClr +``` + +### `scrgbClr` + +```python +scrgbClr = ColorChoice.scrgbClr +``` + +### `srgbClr` + +```python +srgbClr = ColorChoice.srgbClr +``` + +### `sysClr` + +```python +sysClr = ColorChoice.sysClr +``` + +## `GrayscaleEffect` + +Bases: `Serialisable` + +### `tagname` + +```python +tagname = 'grayscl' +``` + +## `HSLEffect` + +```python +HSLEffect(hue = None, sat = None, lum = None) +``` + +Bases: `Serialisable` + +### `hue` + +```python +hue = hue +``` + +### `lum` + +```python +lum = lum +``` + +### `sat` + +```python +sat = sat +``` + +## `InnerShadowEffect` + +```python +InnerShadowEffect(blurRad = None, dist = None, dir = None, **kw) +``` + +Bases: `ColorChoice` + +### `blurRad` + +```python +blurRad = blurRad +``` + +### `dir` + +```python +dir = dir +``` + +### `dist` + +```python +dist = dist +``` + +### `hslClr` + +```python +hslClr = ColorChoice.hslClr +``` + +### `prstClr` + +```python +prstClr = ColorChoice.prstClr +``` + +### `schemeClr` + +```python +schemeClr = ColorChoice.schemeClr +``` + +### `scrgbClr` + +```python +scrgbClr = ColorChoice.scrgbClr +``` + +### `srgbClr` + +```python +srgbClr = ColorChoice.srgbClr +``` + +### `sysClr` + +```python +sysClr = ColorChoice.sysClr +``` + +## `LuminanceEffect` + +```python +LuminanceEffect(bright = 0, contrast = 0) +``` + +Bases: `Serialisable` + +### `bright` + +```python +bright = bright +``` + +### `contrast` + +```python +contrast = contrast +``` + +### `tagname` + +```python +tagname = 'lum' +``` + +## `OuterShadow` + +```python +OuterShadow(blurRad = None, dist = None, dir = None, sx = None, sy = None, kx = None, ky = None, algn = None, rotWithShape = None, **kw) +``` + +Bases: `ColorChoice` + +### `algn` + +```python +algn = algn +``` + +### `blurRad` + +```python +blurRad = blurRad +``` + +### `dir` + +```python +dir = dir +``` + +### `dist` + +```python +dist = dist +``` + +### `hslClr` + +```python +hslClr = ColorChoice.hslClr +``` + +### `kx` + +```python +kx = kx +``` + +### `ky` + +```python +ky = ky +``` + +### `prstClr` + +```python +prstClr = ColorChoice.prstClr +``` + +### `rotWithShape` + +```python +rotWithShape = rotWithShape +``` + +### `schemeClr` + +```python +schemeClr = ColorChoice.schemeClr +``` + +### `scrgbClr` + +```python +scrgbClr = ColorChoice.scrgbClr +``` + +### `srgbClr` + +```python +srgbClr = ColorChoice.srgbClr +``` + +### `sx` + +```python +sx = sx +``` + +### `sy` + +```python +sy = sy +``` + +### `sysClr` + +```python +sysClr = ColorChoice.sysClr +``` + +### `tagname` + +```python +tagname = 'outerShdw' +``` + +## `PresetShadowEffect` + +```python +PresetShadowEffect(prst = None, dist = None, dir = None, **kw) +``` + +Bases: `ColorChoice` + +### `dir` + +```python +dir = dir +``` + +### `dist` + +```python +dist = dist +``` + +### `hslClr` + +```python +hslClr = ColorChoice.hslClr +``` + +### `prst` + +```python +prst = prst +``` + +### `prstClr` + +```python +prstClr = ColorChoice.prstClr +``` + +### `schemeClr` + +```python +schemeClr = ColorChoice.schemeClr +``` + +### `scrgbClr` + +```python +scrgbClr = ColorChoice.scrgbClr +``` + +### `srgbClr` + +```python +srgbClr = ColorChoice.srgbClr +``` + +### `sysClr` + +```python +sysClr = ColorChoice.sysClr +``` + +## `ReflectionEffect` + +```python +ReflectionEffect(blurRad = None, stA = None, stPos = None, endA = None, endPos = None, dist = None, dir = None, fadeDir = None, sx = None, sy = None, kx = None, ky = None, algn = None, rotWithShape = None) +``` + +Bases: `Serialisable` + +### `algn` + +```python +algn = algn +``` + +### `blurRad` + +```python +blurRad = blurRad +``` + +### `dir` + +```python +dir = dir +``` + +### `dist` + +```python +dist = dist +``` + +### `endA` + +```python +endA = endA +``` + +### `endPos` + +```python +endPos = endPos +``` + +### `fadeDir` + +```python +fadeDir = fadeDir +``` + +### `kx` + +```python +kx = kx +``` + +### `ky` + +```python +ky = ky +``` + +### `rotWithShape` + +```python +rotWithShape = rotWithShape +``` + +### `stA` + +```python +stA = stA +``` + +### `stPos` + +```python +stPos = stPos +``` + +### `sx` + +```python +sx = sx +``` + +### `sy` + +```python +sy = sy +``` + +## `SoftEdgesEffect` + +```python +SoftEdgesEffect(rad = None) +``` + +Bases: `Serialisable` + +### `rad` + +```python +rad = rad +``` + +## `TintEffect` + +```python +TintEffect(hue = 0, amt = 0) +``` + +Bases: `Serialisable` + +### `amt` + +```python +amt = amt +``` + +### `hue` + +```python +hue = hue +``` + +### `tagname` + +```python +tagname = 'tint' +``` + + + + + +# `openpyxl.drawing.fill` + +## `Blip` + +```python +Blip(cstate = None, embed = None, link = None, noGrp = None, noSelect = None, noRot = None, noChangeAspect = None, noMove = None, noResize = None, noEditPoints = None, noAdjustHandles = None, noChangeArrowheads = None, noChangeShapeType = None, extLst = None, alphaBiLevel = None, alphaCeiling = None, alphaFloor = None, alphaInv = None, alphaMod = None, alphaModFix = None, alphaRepl = None, biLevel = None, blur = None, clrChange = None, clrRepl = None, duotone = None, fillOverlay = None, grayscl = None, hsl = None, lum = None, tint = None) +``` + +Bases: `Serialisable` + +### `alphaBiLevel` + +```python +alphaBiLevel = alphaBiLevel +``` + +### `alphaCeiling` + +```python +alphaCeiling = alphaCeiling +``` + +### `alphaFloor` + +```python +alphaFloor = alphaFloor +``` + +### `alphaInv` + +```python +alphaInv = alphaInv +``` + +### `alphaMod` + +```python +alphaMod = alphaMod +``` + +### `alphaModFix` + +```python +alphaModFix = alphaModFix +``` + +### `alphaRepl` + +```python +alphaRepl = alphaRepl +``` + +### `biLevel` + +```python +biLevel = biLevel +``` + +### `blur` + +```python +blur = blur +``` + +### `clrChange` + +```python +clrChange = clrChange +``` + +### `clrRepl` + +```python +clrRepl = clrRepl +``` + +### `cstate` + +```python +cstate = cstate +``` + +### `duotone` + +```python +duotone = duotone +``` + +### `embed` + +```python +embed = embed +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `fillOverlay` + +```python +fillOverlay = fillOverlay +``` + +### `grayscl` + +```python +grayscl = grayscl +``` + +### `hsl` + +```python +hsl = hsl +``` + +### `link` + +```python +link = link +``` + +### `lum` + +```python +lum = lum +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `noAdjustHandles` + +```python +noAdjustHandles = noAdjustHandles +``` + +### `noChangeArrowheads` + +```python +noChangeArrowheads = noChangeArrowheads +``` + +### `noChangeAspect` + +```python +noChangeAspect = noChangeAspect +``` + +### `noChangeShapeType` + +```python +noChangeShapeType = noChangeShapeType +``` + +### `noEditPoints` + +```python +noEditPoints = noEditPoints +``` + +### `noGrp` + +```python +noGrp = noGrp +``` + +### `noMove` + +```python +noMove = noMove +``` + +### `noResize` + +```python +noResize = noResize +``` + +### `noRot` + +```python +noRot = noRot +``` + +### `noSelect` + +```python +noSelect = noSelect +``` + +### `tagname` + +```python +tagname = 'blip' +``` + +### `tint` + +```python +tint = tint +``` + +## `BlipFillProperties` + +```python +BlipFillProperties(dpi = None, rotWithShape = None, blip = None, tile = None, stretch = StretchInfoProperties(), srcRect = None) +``` + +Bases: `Serialisable` + +### `blip` + +```python +blip = blip +``` + +### `dpi` + +```python +dpi = dpi +``` + +### `rotWithShape` + +```python +rotWithShape = rotWithShape +``` + +### `srcRect` + +```python +srcRect = srcRect +``` + +### `stretch` + +```python +stretch = stretch +``` + +### `tagname` + +```python +tagname = 'blipFill' +``` + +### `tile` + +```python +tile = tile +``` + +## `GradientFillProperties` + +```python +GradientFillProperties(flip = None, rotWithShape = None, gsLst = (), lin = None, path = None, tileRect = None) +``` + +Bases: `Serialisable` + +### `flip` + +```python +flip = flip +``` + +### `gsLst` + +```python +gsLst = gsLst +``` + +### `lin` + +```python +lin = lin +``` + +### `linear` + +```python +linear = Alias('lin') +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `path` + +```python +path = path +``` + +### `rotWithShape` + +```python +rotWithShape = rotWithShape +``` + +### `stop_list` + +```python +stop_list = Alias('gsLst') +``` + +### `tagname` + +```python +tagname = 'gradFill' +``` + +### `tileRect` + +```python +tileRect = tileRect +``` + +## `GradientStop` + +```python +GradientStop(pos = None, scrgbClr = None, srgbClr = None, hslClr = None, sysClr = None, schemeClr = None, prstClr = None) +``` + +Bases: `Serialisable` + +### `RGB` + +```python +RGB = Alias('srgbClr') +``` + +### `RGBPercent` + +```python +RGBPercent = Alias('scrgbClr') +``` + +### `hslClr` + +```python +hslClr = hslClr +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `pos` + +```python +pos = pos +``` + +### `prstClr` + +```python +prstClr = prstClr +``` + +### `schemeClr` + +```python +schemeClr = schemeClr +``` + +### `scrgbClr` + +```python +scrgbClr = scrgbClr +``` + +### `srgbClr` + +```python +srgbClr = srgbClr +``` + +### `sysClr` + +```python +sysClr = sysClr +``` + +### `tagname` + +```python +tagname = 'gs' +``` + +## `LinearShadeProperties` + +```python +LinearShadeProperties(ang = None, scaled = None) +``` + +Bases: `Serialisable` + +### `ang` + +```python +ang = ang +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `scaled` + +```python +scaled = scaled +``` + +### `tagname` + +```python +tagname = 'lin' +``` + +## `PathShadeProperties` + +```python +PathShadeProperties(path = None, fillToRect = None) +``` + +Bases: `Serialisable` + +### `fillToRect` + +```python +fillToRect = fillToRect +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `path` + +```python +path = path +``` + +### `tagname` + +```python +tagname = 'path' +``` + +## `PatternFillProperties` + +```python +PatternFillProperties(prst = None, fgClr = None, bgClr = None) +``` + +Bases: `Serialisable` + +### `background` + +```python +background = Alias('bgClr') +``` + +### `bgClr` + +```python +bgClr = bgClr +``` + +### `fgClr` + +```python +fgClr = fgClr +``` + +### `foreground` + +```python +foreground = Alias('fgClr') +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `preset` + +```python +preset = Alias('prst') +``` + +### `prst` + +```python +prst = prst +``` + +### `tagname` + +```python +tagname = 'pattFill' +``` + +## `RelativeRect` + +```python +RelativeRect(l = None, t = None, r = None, b = None) +``` + +Bases: `Serialisable` + +### `b` + +```python +b = b +``` + +### `bottom` + +```python +bottom = Alias('b') +``` + +### `l` + +```python +l = l +``` + +### `left` + +```python +left = Alias('l') +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `r` + +```python +r = r +``` + +### `right` + +```python +right = Alias('r') +``` + +### `t` + +```python +t = t +``` + +### `tagname` + +```python +tagname = 'rect' +``` + +### `top` + +```python +top = Alias('t') +``` + +## `SolidColorFillProperties` + +```python +SolidColorFillProperties(scrgbClr = None, srgbClr = None, hslClr = None, sysClr = None, schemeClr = None, prstClr = None) +``` + +Bases: `Serialisable` + +### `RGB` + +```python +RGB = Alias('srgbClr') +``` + +### `RGBPercent` + +```python +RGBPercent = Alias('scrgbClr') +``` + +### `hslClr` + +```python +hslClr = hslClr +``` + +### `prstClr` + +```python +prstClr = prstClr +``` + +### `schemeClr` + +```python +schemeClr = schemeClr +``` + +### `scrgbClr` + +```python +scrgbClr = scrgbClr +``` + +### `srgbClr` + +```python +srgbClr = srgbClr +``` + +### `sysClr` + +```python +sysClr = sysClr +``` + +### `tagname` + +```python +tagname = 'solidFill' +``` + +## `StretchInfoProperties` + +```python +StretchInfoProperties(fillRect = RelativeRect()) +``` + +Bases: `Serialisable` + +### `fillRect` + +```python +fillRect = fillRect +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `tagname` + +```python +tagname = 'stretch' +``` + +## `TileInfoProperties` + +```python +TileInfoProperties(tx = None, ty = None, sx = None, sy = None, flip = None, algn = None) +``` + +Bases: `Serialisable` + +### `algn` + +```python +algn = algn +``` + +### `flip` + +```python +flip = flip +``` + +### `sx` + +```python +sx = sx +``` + +### `sy` + +```python +sy = sy +``` + +### `tx` + +```python +tx = tx +``` + +### `ty` + +```python +ty = ty +``` + + + + + +# `openpyxl.drawing.geometry` + +## `AdjPoint2D` + +```python +AdjPoint2D(x = None, y = None) +``` + +Bases: `Serialisable` + +### `x` + +```python +x = x +``` + +### `y` + +```python +y = y +``` + +## `AdjustHandleList` + +Bases: `Serialisable` + +## `Backdrop` + +```python +Backdrop(anchor = None, norm = None, up = None, extLst = None) +``` + +Bases: `Serialisable` + +### `anchor` + +```python +anchor = anchor +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `norm` + +```python +norm = norm +``` + +### `up` + +```python +up = up +``` + +## `Bevel` + +```python +Bevel(w = None, h = None, prst = None) +``` + +Bases: `Serialisable` + +### `h` + +```python +h = h +``` + +### `prst` + +```python +prst = prst +``` + +### `tagname` + +```python +tagname = 'bevel' +``` + +### `w` + +```python +w = w +``` + +## `Camera` + +```python +Camera(prst = None, fov = None, zoom = None, rot = None) +``` + +Bases: `Serialisable` + +### `fov` + +```python +fov = fov +``` + +### `prst` + +```python +prst = prst +``` + +### `rot` + +```python +rot = rot +``` + +### `tagname` + +```python +tagname = 'camera' +``` + +### `zoom` + +```python +zoom = zoom +``` + +## `ConnectionSite` + +```python +ConnectionSite(ang = None, pos = None) +``` + +Bases: `Serialisable` + +### `ang` + +```python +ang = ang +``` + +### `pos` + +```python +pos = pos +``` + +## `ConnectionSiteList` + +```python +ConnectionSiteList(cxn = None) +``` + +Bases: `Serialisable` + +### `cxn` + +```python +cxn = cxn +``` + +## `CustomGeometry2D` + +```python +CustomGeometry2D(avLst = None, gdLst = None, ahLst = None, cxnLst = None, rect = None, pathLst = None) +``` + +Bases: `Serialisable` + +### `ahLst` + +```python +ahLst = ahLst +``` + +### `avLst` + +```python +avLst = avLst +``` + +### `cxnLst` + +```python +cxnLst = cxnLst +``` + +### `gdLst` + +```python +gdLst = gdLst +``` + +### `pathLst` + +```python +pathLst = pathLst +``` + +### `rect` + +```python +rect = None +``` + +## `FontReference` + +```python +FontReference(idx = None) +``` + +Bases: `Serialisable` + +### `idx` + +```python +idx = idx +``` + +## `GeomGuide` + +```python +GeomGuide(name = None, fmla = None) +``` + +Bases: `Serialisable` + +### `fmla` + +```python +fmla = fmla +``` + +### `name` + +```python +name = name +``` + +## `GeomGuideList` + +```python +GeomGuideList(gd = None) +``` + +Bases: `Serialisable` + +### `gd` + +```python +gd = gd +``` + +## `GeomRect` + +```python +GeomRect(l = None, t = None, r = None, b = None) +``` + +Bases: `Serialisable` + +### `b` + +```python +b = b +``` + +### `l` + +```python +l = l +``` + +### `r` + +```python +r = r +``` + +### `t` + +```python +t = t +``` + +## `GroupTransform2D` + +```python +GroupTransform2D(rot = 0, flipH = None, flipV = None, off = None, ext = None, chOff = None, chExt = None) +``` + +Bases: `Serialisable` + +### `chExt` + +```python +chExt = chExt +``` + +### `chOff` + +```python +chOff = chOff +``` + +### `ext` + +```python +ext = ext +``` + +### `flipH` + +```python +flipH = flipH +``` + +### `flipV` + +```python +flipV = flipV +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `off` + +```python +off = off +``` + +### `rot` + +```python +rot = rot +``` + +### `tagname` + +```python +tagname = 'xfrm' +``` + +## `LightRig` + +```python +LightRig(rig = None, dir = None, rot = None) +``` + +Bases: `Serialisable` + +### `dir` + +```python +dir = dir +``` + +### `rig` + +```python +rig = rig +``` + +### `rot` + +```python +rot = rot +``` + +### `tagname` + +```python +tagname = 'lightRig' +``` + +## `Path2D` + +```python +Path2D(w = None, h = None, fill = None, stroke = None, extrusionOk = None) +``` + +Bases: `Serialisable` + +### `extrusionOk` + +```python +extrusionOk = extrusionOk +``` + +### `fill` + +```python +fill = fill +``` + +### `h` + +```python +h = h +``` + +### `stroke` + +```python +stroke = stroke +``` + +### `w` + +```python +w = w +``` + +## `Path2DList` + +```python +Path2DList(path = None) +``` + +Bases: `Serialisable` + +### `path` + +```python +path = path +``` + +## `Point2D` + +```python +Point2D(x = None, y = None) +``` + +Bases: `Serialisable` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `tagname` + +```python +tagname = 'off' +``` + +### `x` + +```python +x = x +``` + +### `y` + +```python +y = y +``` + +## `Point3D` + +```python +Point3D(x = None, y = None, z = None) +``` + +Bases: `Serialisable` + +### `tagname` + +```python +tagname = 'anchor' +``` + +### `x` + +```python +x = x +``` + +### `y` + +```python +y = y +``` + +### `z` + +```python +z = z +``` + +## `PositiveSize2D` + +```python +PositiveSize2D(cx = None, cy = None) +``` + +Bases: `Serialisable` + +### `cx` + +```python +cx = cx +``` + +### `cy` + +```python +cy = cy +``` + +### `height` + +```python +height = Alias('cy') +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +Dimensions in EMUs + +### `tagname` + +```python +tagname = 'ext' +``` + +### `width` + +```python +width = Alias('cx') +``` + +## `PresetGeometry2D` + +```python +PresetGeometry2D(prst = None, avLst = None) +``` + +Bases: `Serialisable` + +### `avLst` + +```python +avLst = avLst +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `prst` + +```python +prst = prst +``` + +## `Scene3D` + +```python +Scene3D(camera = None, lightRig = None, backdrop = None, extLst = None) +``` + +Bases: `Serialisable` + +### `backdrop` + +```python +backdrop = backdrop +``` + +### `camera` + +```python +camera = camera +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `lightRig` + +```python +lightRig = lightRig +``` + +## `Shape3D` + +```python +Shape3D(z = None, extrusionH = None, contourW = None, prstMaterial = None, bevelT = None, bevelB = None, extrusionClr = None, contourClr = None, extLst = None) +``` + +Bases: `Serialisable` + +### `bevelB` + +```python +bevelB = bevelB +``` + +### `bevelT` + +```python +bevelT = bevelT +``` + +### `contourClr` + +```python +contourClr = contourClr +``` + +### `contourW` + +```python +contourW = contourW +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `extrusionClr` + +```python +extrusionClr = extrusionClr +``` + +### `extrusionH` + +```python +extrusionH = extrusionH +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `prstMaterial` + +```python +prstMaterial = prstMaterial +``` + +### `z` + +```python +z = z +``` + +## `ShapeStyle` + +```python +ShapeStyle(lnRef = None, fillRef = None, effectRef = None, fontRef = None) +``` + +Bases: `Serialisable` + +### `effectRef` + +```python +effectRef = effectRef +``` + +### `fillRef` + +```python +fillRef = fillRef +``` + +### `fontRef` + +```python +fontRef = fontRef +``` + +### `lnRef` + +```python +lnRef = lnRef +``` + +## `SphereCoords` + +```python +SphereCoords(lat = None, lon = None, rev = None) +``` + +Bases: `Serialisable` + +### `lat` + +```python +lat = lat +``` + +### `lon` + +```python +lon = lon +``` + +### `rev` + +```python +rev = rev +``` + +### `tagname` + +```python +tagname = 'sphereCoords' +``` + +## `StyleMatrixReference` + +```python +StyleMatrixReference(idx = None) +``` + +Bases: `Serialisable` + +### `idx` + +```python +idx = idx +``` + +## `Transform2D` + +```python +Transform2D(rot = None, flipH = None, flipV = None, off = None, ext = None, chOff = None, chExt = None) +``` + +Bases: `Serialisable` + +### `chExt` + +```python +chExt = chExt +``` + +### `chOff` + +```python +chOff = chOff +``` + +### `ext` + +```python +ext = ext +``` + +### `flipH` + +```python +flipH = flipH +``` + +### `flipV` + +```python +flipV = flipV +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `off` + +```python +off = off +``` + +### `rot` + +```python +rot = rot +``` + +### `tagname` + +```python +tagname = 'xfrm' +``` + +## `Vector3D` + +```python +Vector3D(dx = None, dy = None, dz = None) +``` + +Bases: `Serialisable` + +### `dx` + +```python +dx = dx +``` + +### `dy` + +```python +dy = dy +``` + +### `dz` + +```python +dz = dz +``` + +### `tagname` + +```python +tagname = 'vector' +``` + + + + + +# `openpyxl.drawing.graphic` + +## `GraphicData` + +```python +GraphicData(uri = CHART_NS, chart = None) +``` + +Bases: `Serialisable` + +### `chart` + +```python +chart = chart +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `tagname` + +```python +tagname = 'graphicData' +``` + +### `uri` + +```python +uri = uri +``` + +## `GraphicFrame` + +```python +GraphicFrame(nvGraphicFramePr = None, xfrm = None, graphic = None, macro = None, fPublished = None) +``` + +Bases: `Serialisable` + +### `fPublished` + +```python +fPublished = fPublished +``` + +### `graphic` + +```python +graphic = graphic +``` + +### `macro` + +```python +macro = macro +``` + +### `nvGraphicFramePr` + +```python +nvGraphicFramePr = nvGraphicFramePr +``` + +### `tagname` + +```python +tagname = 'graphicFrame' +``` + +### `xfrm` + +```python +xfrm = xfrm +``` + +## `GraphicFrameLocking` + +```python +GraphicFrameLocking(noGrp = None, noDrilldown = None, noSelect = None, noChangeAspect = None, noMove = None, noResize = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = extLst +``` + +### `noChangeAspect` + +```python +noChangeAspect = noChangeAspect +``` + +### `noDrilldown` + +```python +noDrilldown = noDrilldown +``` + +### `noGrp` + +```python +noGrp = noGrp +``` + +### `noMove` + +```python +noMove = noMove +``` + +### `noResize` + +```python +noResize = noResize +``` + +### `noSelect` + +```python +noSelect = noSelect +``` + +## `GraphicObject` + +```python +GraphicObject(graphicData = None) +``` + +Bases: `Serialisable` + +### `graphicData` + +```python +graphicData = graphicData +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `tagname` + +```python +tagname = 'graphic' +``` + +## `GroupShape` + +```python +GroupShape(nvGrpSpPr = None, grpSpPr = None, pic = None) +``` + +Bases: `Serialisable` + +### `grpSpPr` + +```python +grpSpPr = grpSpPr +``` + +### `nonVisualProperties` + +```python +nonVisualProperties = Alias('nvGrpSpPr') +``` + +### `nvGrpSpPr` + +```python +nvGrpSpPr = nvGrpSpPr +``` + +### `pic` + +```python +pic = pic +``` + +### `visualProperties` + +```python +visualProperties = Alias('grpSpPr') +``` + +## `NonVisualGraphicFrame` + +```python +NonVisualGraphicFrame(cNvPr = None, cNvGraphicFramePr = None) +``` + +Bases: `Serialisable` + +### `cNvGraphicFramePr` + +```python +cNvGraphicFramePr = cNvGraphicFramePr +``` + +### `cNvPr` + +```python +cNvPr = cNvPr +``` + +### `tagname` + +```python +tagname = 'nvGraphicFramePr' +``` + +## `NonVisualGraphicFrameProperties` + +```python +NonVisualGraphicFrameProperties(graphicFrameLocks = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = extLst +``` + +### `graphicFrameLocks` + +```python +graphicFrameLocks = graphicFrameLocks +``` + +### `tagname` + +```python +tagname = 'cNvGraphicFramePr' +``` + + + + + +# `openpyxl.drawing.image` + +## `Image` + +```python +Image(img) +``` + +Image in a spreadsheet + +### `anchor` + +```python +anchor = 'A1' +``` + +### `format` + +```python +format = image.format.lower() +``` + +### `path` + +```python +path +``` + +### `ref` + +```python +ref = img +``` + + + + + +# `openpyxl.drawing.line` + +## `DashStop` + +```python +DashStop(d = 0, sp = 0) +``` + +Bases: `Serialisable` + +### `d` + +```python +d = d +``` + +### `length` + +```python +length = Alias('d') +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `sp` + +```python +sp = sp +``` + +### `space` + +```python +space = Alias('sp') +``` + +### `tagname` + +```python +tagname = 'ds' +``` + +## `DashStopList` + +```python +DashStopList(ds = None) +``` + +Bases: `Serialisable` + +### `ds` + +```python +ds = ds +``` + +## `LineEndProperties` + +```python +LineEndProperties(type = None, w = None, len = None) +``` + +Bases: `Serialisable` + +### `len` + +```python +len = len +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `tagname` + +```python +tagname = 'end' +``` + +### `type` + +```python +type = type +``` + +### `w` + +```python +w = w +``` + +## `LineProperties` + +```python +LineProperties(w = None, cap = None, cmpd = None, algn = None, noFill = None, solidFill = None, gradFill = None, pattFill = None, prstDash = None, custDash = None, round = None, bevel = None, miter = None, headEnd = None, tailEnd = None, extLst = None) +``` + +Bases: `Serialisable` + +### `algn` + +```python +algn = algn +``` + +### `bevel` + +```python +bevel = bevel +``` + +### `cap` + +```python +cap = cap +``` + +### `cmpd` + +```python +cmpd = cmpd +``` + +### `custDash` + +```python +custDash = custDash +``` + +### `dashStyle` + +```python +dashStyle = Alias('prstDash') +``` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `gradFill` + +```python +gradFill = gradFill +``` + +### `headEnd` + +```python +headEnd = headEnd +``` + +### `miter` + +```python +miter = miter +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `noFill` + +```python +noFill = noFill +``` + +### `pattFill` + +```python +pattFill = pattFill +``` + +### `prstDash` + +```python +prstDash = prstDash +``` + +### `round` + +```python +round = round +``` + +### `solidFill` + +```python +solidFill = solidFill +``` + +### `tagname` + +```python +tagname = 'ln' +``` + +### `tailEnd` + +```python +tailEnd = tailEnd +``` + +### `w` + +```python +w = w +``` + +### `width` + +```python +width = Alias('w') +``` + + + + + +# `openpyxl.drawing.picture` + +## `NonVisualPictureProperties` + +```python +NonVisualPictureProperties(preferRelativeResize = None, picLocks = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `picLocks` + +```python +picLocks = picLocks +``` + +### `preferRelativeResize` + +```python +preferRelativeResize = preferRelativeResize +``` + +### `tagname` + +```python +tagname = 'cNvPicPr' +``` + +## `PictureFrame` + +```python +PictureFrame(macro = None, fPublished = None, nvPicPr = None, blipFill = None, spPr = None, style = None) +``` + +Bases: `Serialisable` + +### `blipFill` + +```python +blipFill = blipFill +``` + +### `fPublished` + +```python +fPublished = fPublished +``` + +### `graphicalProperties` + +```python +graphicalProperties = Alias('spPr') +``` + +### `macro` + +```python +macro = macro +``` + +### `nvPicPr` + +```python +nvPicPr = nvPicPr +``` + +### `spPr` + +```python +spPr = spPr +``` + +### `style` + +```python +style = style +``` + +### `tagname` + +```python +tagname = 'pic' +``` + +## `PictureLocking` + +```python +PictureLocking(noCrop = None, noGrp = None, noSelect = None, noRot = None, noChangeAspect = None, noMove = None, noResize = None, noEditPoints = None, noAdjustHandles = None, noChangeArrowheads = None, noChangeShapeType = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `noAdjustHandles` + +```python +noAdjustHandles = noAdjustHandles +``` + +### `noChangeArrowheads` + +```python +noChangeArrowheads = noChangeArrowheads +``` + +### `noChangeAspect` + +```python +noChangeAspect = noChangeAspect +``` + +### `noChangeShapeType` + +```python +noChangeShapeType = noChangeShapeType +``` + +### `noCrop` + +```python +noCrop = noCrop +``` + +### `noEditPoints` + +```python +noEditPoints = noEditPoints +``` + +### `noGrp` + +```python +noGrp = noGrp +``` + +### `noMove` + +```python +noMove = noMove +``` + +### `noResize` + +```python +noResize = noResize +``` + +### `noRot` + +```python +noRot = noRot +``` + +### `noSelect` + +```python +noSelect = noSelect +``` + +### `tagname` + +```python +tagname = 'picLocks' +``` + +## `PictureNonVisual` + +```python +PictureNonVisual(cNvPr = None, cNvPicPr = None) +``` + +Bases: `Serialisable` + +### `cNvPicPr` + +```python +cNvPicPr = cNvPicPr +``` + +### `cNvPr` + +```python +cNvPr = cNvPr +``` + +### `tagname` + +```python +tagname = 'nvPicPr' +``` + + + + + +# `openpyxl.drawing.properties` + +## `GroupLocking` + +```python +GroupLocking(noGrp = None, noUngrp = None, noSelect = None, noRot = None, noChangeAspect = None, noChangeArrowheads = None, noMove = None, noResize = None, noEditPoints = None, noAdjustHandles = None, noChangeShapeType = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `noAdjustHandles` + +```python +noAdjustHandles = noAdjustHandles +``` + +### `noChangeArrowheads` + +```python +noChangeArrowheads = noChangeArrowheads +``` + +### `noChangeAspect` + +```python +noChangeAspect = noChangeAspect +``` + +### `noChangeShapeType` + +```python +noChangeShapeType = noChangeShapeType +``` + +### `noEditPoints` + +```python +noEditPoints = noEditPoints +``` + +### `noGrp` + +```python +noGrp = noGrp +``` + +### `noMove` + +```python +noMove = noMove +``` + +### `noResize` + +```python +noResize = noResize +``` + +### `noRot` + +```python +noRot = noRot +``` + +### `noSelect` + +```python +noSelect = noSelect +``` + +### `noUngrp` + +```python +noUngrp = noUngrp +``` + +### `tagname` + +```python +tagname = 'grpSpLocks' +``` + +## `GroupShapeProperties` + +```python +GroupShapeProperties(bwMode = None, xfrm = None, scene3d = None, extLst = None) +``` + +Bases: `Serialisable` + +### `bwMode` + +```python +bwMode = bwMode +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `scene3d` + +```python +scene3d = scene3d +``` + +### `tagname` + +```python +tagname = 'grpSpPr' +``` + +### `xfrm` + +```python +xfrm = xfrm +``` + +## `NonVisualDrawingProps` + +```python +NonVisualDrawingProps(id = None, name = None, descr = None, hidden = None, title = None, hlinkClick = None, hlinkHover = None, extLst = None) +``` + +Bases: `Serialisable` + +### `descr` + +```python +descr = descr +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `hidden` + +```python +hidden = hidden +``` + +### `hlinkClick` + +```python +hlinkClick = hlinkClick +``` + +### `hlinkHover` + +```python +hlinkHover = hlinkHover +``` + +### `id` + +```python +id = id +``` + +### `name` + +```python +name = name +``` + +### `tagname` + +```python +tagname = 'cNvPr' +``` + +### `title` + +```python +title = title +``` + +## `NonVisualDrawingShapeProps` + +```python +NonVisualDrawingShapeProps(spLocks = None, txBox = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `spLocks` + +```python +spLocks = spLocks +``` + +### `tagname` + +```python +tagname = 'cNvSpPr' +``` + +### `txBax` + +```python +txBax = Bool(allow_none=True) +``` + +### `txBox` + +```python +txBox = txBox +``` + +## `NonVisualGroupDrawingShapeProps` + +```python +NonVisualGroupDrawingShapeProps(grpSpLocks = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `grpSpLocks` + +```python +grpSpLocks = grpSpLocks +``` + +### `tagname` + +```python +tagname = 'cNvGrpSpPr' +``` + +## `NonVisualGroupShape` + +```python +NonVisualGroupShape(cNvPr = None, cNvGrpSpPr = None) +``` + +Bases: `Serialisable` + +### `cNvGrpSpPr` + +```python +cNvGrpSpPr = cNvGrpSpPr +``` + +### `cNvPr` + +```python +cNvPr = cNvPr +``` + +### `tagname` + +```python +tagname = 'nvGrpSpPr' +``` + + + + + +# `openpyxl.drawing.relation` + +## `ChartRelation` + +```python +ChartRelation(id) +``` + +Bases: `Serialisable` + +### `id` + +```python +id = id +``` + +### `namespace` + +```python +namespace = CHART_NS +``` + +### `tagname` + +```python +tagname = 'chart' +``` + + + + + +# `openpyxl.drawing.spreadsheet_drawing` + +## `AbsoluteAnchor` + +```python +AbsoluteAnchor(pos = None, ext = None, **kw) +``` + +Bases: `_AnchorBase` + +### `clientData` + +```python +clientData = _AnchorBase.clientData +``` + +### `contentPart` + +```python +contentPart = _AnchorBase.contentPart +``` + +### `cxnSp` + +```python +cxnSp = _AnchorBase.cxnSp +``` + +### `ext` + +```python +ext = ext +``` + +### `graphicFrame` + +```python +graphicFrame = _AnchorBase.graphicFrame +``` + +### `grpSp` + +```python +grpSp = _AnchorBase.grpSp +``` + +### `pic` + +```python +pic = _AnchorBase.pic +``` + +### `pos` + +```python +pos = pos +``` + +### `sp` + +```python +sp = _AnchorBase.sp +``` + +### `tagname` + +```python +tagname = 'absoluteAnchor' +``` + +## `AnchorClientData` + +```python +AnchorClientData(fLocksWithSheet = None, fPrintsWithSheet = None) +``` + +Bases: `Serialisable` + +### `fLocksWithSheet` + +```python +fLocksWithSheet = fLocksWithSheet +``` + +### `fPrintsWithSheet` + +```python +fPrintsWithSheet = fPrintsWithSheet +``` + +## `AnchorMarker` + +```python +AnchorMarker(col = 0, colOff = 0, row = 0, rowOff = 0) +``` + +Bases: `Serialisable` + +### `col` + +```python +col = col +``` + +### `colOff` + +```python +colOff = colOff +``` + +### `row` + +```python +row = row +``` + +### `rowOff` + +```python +rowOff = rowOff +``` + +### `tagname` + +```python +tagname = 'marker' +``` + +## `OneCellAnchor` + +```python +OneCellAnchor(_from = None, ext = None, **kw) +``` + +Bases: `_AnchorBase` + +### `clientData` + +```python +clientData = _AnchorBase.clientData +``` + +### `contentPart` + +```python +contentPart = _AnchorBase.contentPart +``` + +### `cxnSp` + +```python +cxnSp = _AnchorBase.cxnSp +``` + +### `ext` + +```python +ext = ext +``` + +### `graphicFrame` + +```python +graphicFrame = _AnchorBase.graphicFrame +``` + +### `grpSp` + +```python +grpSp = _AnchorBase.grpSp +``` + +### `pic` + +```python +pic = _AnchorBase.pic +``` + +### `sp` + +```python +sp = _AnchorBase.sp +``` + +### `tagname` + +```python +tagname = 'oneCellAnchor' +``` + +## `SpreadsheetDrawing` + +```python +SpreadsheetDrawing(twoCellAnchor = (), oneCellAnchor = (), absoluteAnchor = ()) +``` + +Bases: `Serialisable` + +### `PartName` + +```python +PartName = '/xl/drawings/drawing{0}.xml' +``` + +### `absoluteAnchor` + +```python +absoluteAnchor = absoluteAnchor +``` + +### `charts` + +```python +charts = [] +``` + +### `images` + +```python +images = [] +``` + +### `mime_type` + +```python +mime_type = 'application/vnd.openxmlformats-officedocument.drawing+xml' +``` + +### `oneCellAnchor` + +```python +oneCellAnchor = oneCellAnchor +``` + +### `path` + +```python +path +``` + +### `tagname` + +```python +tagname = 'wsDr' +``` + +### `twoCellAnchor` + +```python +twoCellAnchor = twoCellAnchor +``` + +## `TwoCellAnchor` + +```python +TwoCellAnchor(editAs = None, _from = None, to = None, **kw) +``` + +Bases: `_AnchorBase` + +### `clientData` + +```python +clientData = _AnchorBase.clientData +``` + +### `contentPart` + +```python +contentPart = _AnchorBase.contentPart +``` + +### `cxnSp` + +```python +cxnSp = _AnchorBase.cxnSp +``` + +### `editAs` + +```python +editAs = editAs +``` + +### `graphicFrame` + +```python +graphicFrame = _AnchorBase.graphicFrame +``` + +### `grpSp` + +```python +grpSp = _AnchorBase.grpSp +``` + +### `pic` + +```python +pic = _AnchorBase.pic +``` + +### `sp` + +```python +sp = _AnchorBase.sp +``` + +### `tagname` + +```python +tagname = 'twoCellAnchor' +``` + +### `to` + +```python +to = to +``` + + + + + +# `openpyxl.drawing.text` + +## `AutonumberBullet` + +```python +AutonumberBullet(type = None, startAt = None) +``` + +Bases: `Serialisable` + +### `startAt` + +```python +startAt = startAt +``` + +### `type` + +```python +type = type +``` + +## `CharacterProperties` + +```python +CharacterProperties(kumimoji = None, lang = None, altLang = None, sz = None, b = None, i = None, u = None, strike = None, kern = None, cap = None, spc = None, normalizeH = None, baseline = None, noProof = None, dirty = None, err = None, smtClean = None, smtId = None, bmk = None, ln = None, highlight = None, latin = None, ea = None, cs = None, sym = None, hlinkClick = None, hlinkMouseOver = None, rtl = None, extLst = None, noFill = None, solidFill = None, gradFill = None, blipFill = None, pattFill = None, grpFill = None, effectLst = None, effectDag = None, uLnTx = None, uLn = None, uFillTx = None, uFill = None) +``` + +Bases: `Serialisable` + +### `altLang` + +```python +altLang = altLang +``` + +### `b` + +```python +b = b +``` + +### `baseline` + +```python +baseline = baseline +``` + +### `blipFill` + +```python +blipFill = blipFill +``` + +### `bmk` + +```python +bmk = bmk +``` + +### `cap` + +```python +cap = cap +``` + +### `cs` + +```python +cs = cs +``` + +### `dirty` + +```python +dirty = dirty +``` + +### `ea` + +```python +ea = ea +``` + +### `effectDag` + +```python +effectDag = effectDag +``` + +### `effectLst` + +```python +effectLst = effectLst +``` + +### `err` + +```python +err = err +``` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `gradFill` + +```python +gradFill = gradFill +``` + +### `grpFill` + +```python +grpFill = grpFill +``` + +### `highlight` + +```python +highlight = highlight +``` + +### `hlinkClick` + +```python +hlinkClick = hlinkClick +``` + +### `hlinkMouseOver` + +```python +hlinkMouseOver = hlinkMouseOver +``` + +### `i` + +```python +i = i +``` + +### `kern` + +```python +kern = kern +``` + +### `kumimoji` + +```python +kumimoji = kumimoji +``` + +### `lang` + +```python +lang = lang +``` + +### `latin` + +```python +latin = latin +``` + +### `ln` + +```python +ln = ln +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `noFill` + +```python +noFill = noFill +``` + +### `noProof` + +```python +noProof = noProof +``` + +### `normalizeH` + +```python +normalizeH = normalizeH +``` + +### `pattFill` + +```python +pattFill = pattFill +``` + +### `rtl` + +```python +rtl = rtl +``` + +### `smtClean` + +```python +smtClean = smtClean +``` + +### `smtId` + +```python +smtId = smtId +``` + +### `solidFill` + +```python +solidFill = solidFill +``` + +### `spc` + +```python +spc = spc +``` + +### `strike` + +```python +strike = strike +``` + +### `sym` + +```python +sym = sym +``` + +### `sz` + +```python +sz = sz +``` + +### `tagname` + +```python +tagname = 'defRPr' +``` + +### `u` + +```python +u = u +``` + +### `uFill` + +```python +uFill = uFill +``` + +### `uFillTx` + +```python +uFillTx = uFillTx +``` + +### `uLn` + +```python +uLn = uLn +``` + +### `uLnTx` + +```python +uLnTx = uLnTx +``` + +## `EmbeddedWAVAudioFile` + +```python +EmbeddedWAVAudioFile(name = None) +``` + +Bases: `Serialisable` + +### `name` + +```python +name = name +``` + +## `Font` + +```python +Font(typeface = None, panose = None, pitchFamily = None, charset = None) +``` + +Bases: `Serialisable` + +### `charset` + +```python +charset = charset +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `panose` + +```python +panose = panose +``` + +### `pitchFamily` + +```python +pitchFamily = pitchFamily +``` + +### `tagname` + +```python +tagname = 'latin' +``` + +### `typeface` + +```python +typeface = typeface +``` + +## `GeomGuide` + +```python +GeomGuide(name = None, fmla = None) +``` + +Bases: `Serialisable` + +### `fmla` + +```python +fmla = fmla +``` + +### `name` + +```python +name = name +``` + +## `GeomGuideList` + +```python +GeomGuideList(gd = None) +``` + +Bases: `Serialisable` + +### `gd` + +```python +gd = gd +``` + +## `Hyperlink` + +```python +Hyperlink(invalidUrl = None, action = None, tgtFrame = None, tooltip = None, history = None, highlightClick = None, endSnd = None, snd = None, extLst = None, id = None) +``` + +Bases: `Serialisable` + +### `action` + +```python +action = action +``` + +### `endSnd` + +```python +endSnd = endSnd +``` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `highlightClick` + +```python +highlightClick = highlightClick +``` + +### `history` + +```python +history = history +``` + +### `id` + +```python +id = id +``` + +### `invalidUrl` + +```python +invalidUrl = invalidUrl +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `snd` + +```python +snd = snd +``` + +### `tagname` + +```python +tagname = 'hlinkClick' +``` + +### `tgtFrame` + +```python +tgtFrame = tgtFrame +``` + +### `tooltip` + +```python +tooltip = tooltip +``` + +## `LineBreak` + +```python +LineBreak(rPr = None) +``` + +Bases: `Serialisable` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `rPr` + +```python +rPr = rPr +``` + +### `tagname` + +```python +tagname = 'br' +``` + +## `ListStyle` + +```python +ListStyle(defPPr = None, lvl1pPr = None, lvl2pPr = None, lvl3pPr = None, lvl4pPr = None, lvl5pPr = None, lvl6pPr = None, lvl7pPr = None, lvl8pPr = None, lvl9pPr = None, extLst = None) +``` + +Bases: `Serialisable` + +### `defPPr` + +```python +defPPr = defPPr +``` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `lvl1pPr` + +```python +lvl1pPr = lvl1pPr +``` + +### `lvl2pPr` + +```python +lvl2pPr = lvl2pPr +``` + +### `lvl3pPr` + +```python +lvl3pPr = lvl3pPr +``` + +### `lvl4pPr` + +```python +lvl4pPr = lvl4pPr +``` + +### `lvl5pPr` + +```python +lvl5pPr = lvl5pPr +``` + +### `lvl6pPr` + +```python +lvl6pPr = lvl6pPr +``` + +### `lvl7pPr` + +```python +lvl7pPr = lvl7pPr +``` + +### `lvl8pPr` + +```python +lvl8pPr = lvl8pPr +``` + +### `lvl9pPr` + +```python +lvl9pPr = lvl9pPr +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `tagname` + +```python +tagname = 'lstStyle' +``` + +## `Paragraph` + +```python +Paragraph(pPr = None, endParaRPr = None, r = None, br = None, fld = None) +``` + +Bases: `Serialisable` + +### `br` + +```python +br = br +``` + +### `endParaRPr` + +```python +endParaRPr = endParaRPr +``` + +### `fld` + +```python +fld = fld +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `pPr` + +```python +pPr = pPr +``` + +### `properties` + +```python +properties = Alias('pPr') +``` + +### `r` + +```python +r = r +``` + +### `tagname` + +```python +tagname = 'p' +``` + +### `text` + +```python +text = Alias('r') +``` + +## `ParagraphProperties` + +```python +ParagraphProperties(marL = None, marR = None, lvl = None, indent = None, algn = None, defTabSz = None, rtl = None, eaLnBrk = None, fontAlgn = None, latinLnBrk = None, hangingPunct = None, lnSpc = None, spcBef = None, spcAft = None, tabLst = None, defRPr = None, extLst = None, buClrTx = None, buClr = None, buSzTx = None, buSzPct = None, buSzPts = None, buFontTx = None, buFont = None, buNone = None, buAutoNum = None, buChar = None, buBlip = None) +``` + +Bases: `Serialisable` + +### `algn` + +```python +algn = algn +``` + +### `buAutoNum` + +```python +buAutoNum = buAutoNum +``` + +### `buBlip` + +```python +buBlip = buBlip +``` + +### `buChar` + +```python +buChar = buChar +``` + +### `buClr` + +```python +buClr = buClr +``` + +### `buClrTx` + +```python +buClrTx = buClrTx +``` + +### `buFont` + +```python +buFont = buFont +``` + +### `buFontTx` + +```python +buFontTx = buFontTx +``` + +### `buNone` + +```python +buNone = buNone +``` + +### `buSzPct` + +```python +buSzPct = buSzPct +``` + +### `buSzPts` + +```python +buSzPts = buSzPts +``` + +### `buSzTx` + +```python +buSzTx = buSzTx +``` + +### `defRPr` + +```python +defRPr = defRPr +``` + +### `defTabSz` + +```python +defTabSz = defTabSz +``` + +### `eaLnBrk` + +```python +eaLnBrk = eaLnBrk +``` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `fontAlgn` + +```python +fontAlgn = fontAlgn +``` + +### `hangingPunct` + +```python +hangingPunct = hangingPunct +``` + +### `indent` + +```python +indent = indent +``` + +### `latinLnBrk` + +```python +latinLnBrk = latinLnBrk +``` + +### `lnSpc` + +```python +lnSpc = lnSpc +``` + +### `lvl` + +```python +lvl = lvl +``` + +### `marL` + +```python +marL = marL +``` + +### `marR` + +```python +marR = marR +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `rtl` + +```python +rtl = rtl +``` + +### `spcAft` + +```python +spcAft = spcAft +``` + +### `spcBef` + +```python +spcBef = spcBef +``` + +### `tabLst` + +```python +tabLst = tabLst +``` + +### `tagname` + +```python +tagname = 'pPr' +``` + +## `PresetTextShape` + +```python +PresetTextShape(prst = None, avLst = None) +``` + +Bases: `Serialisable` + +### `avLst` + +```python +avLst = avLst +``` + +### `prst` + +```python +prst = prst +``` + +## `RegularTextRun` + +```python +RegularTextRun(rPr = None, t = '') +``` + +Bases: `Serialisable` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `properties` + +```python +properties = Alias('rPr') +``` + +### `rPr` + +```python +rPr = rPr +``` + +### `t` + +```python +t = t +``` + +### `tagname` + +```python +tagname = 'r' +``` + +### `value` + +```python +value = Alias('t') +``` + +## `RichTextProperties` + +```python +RichTextProperties(rot = None, spcFirstLastPara = None, vertOverflow = None, horzOverflow = None, vert = None, wrap = None, lIns = None, tIns = None, rIns = None, bIns = None, numCol = None, spcCol = None, rtlCol = None, fromWordArt = None, anchor = None, anchorCtr = None, forceAA = None, upright = None, compatLnSpc = None, prstTxWarp = None, scene3d = None, extLst = None, noAutofit = None, normAutofit = None, spAutoFit = None, flatTx = None) +``` + +Bases: `Serialisable` + +### `anchor` + +```python +anchor = anchor +``` + +### `anchorCtr` + +```python +anchorCtr = anchorCtr +``` + +### `bIns` + +```python +bIns = bIns +``` + +### `compatLnSpc` + +```python +compatLnSpc = compatLnSpc +``` + +### `extLst` + +```python +extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) +``` + +### `flatTx` + +```python +flatTx = flatTx +``` + +### `forceAA` + +```python +forceAA = forceAA +``` + +### `fromWordArt` + +```python +fromWordArt = fromWordArt +``` + +### `horzOverflow` + +```python +horzOverflow = horzOverflow +``` + +### `lIns` + +```python +lIns = lIns +``` + +### `namespace` + +```python +namespace = DRAWING_NS +``` + +### `noAutofit` + +```python +noAutofit = noAutofit +``` + +### `normAutofit` + +```python +normAutofit = normAutofit +``` + +### `numCol` + +```python +numCol = numCol +``` + +### `prstTxWarp` + +```python +prstTxWarp = prstTxWarp +``` + +### `rIns` + +```python +rIns = rIns +``` + +### `rot` + +```python +rot = rot +``` + +### `rtlCol` + +```python +rtlCol = rtlCol +``` + +### `scene3d` + +```python +scene3d = scene3d +``` + +### `spAutoFit` + +```python +spAutoFit = spAutoFit +``` + +### `spcCol` + +```python +spcCol = spcCol +``` + +### `spcFirstLastPara` + +```python +spcFirstLastPara = spcFirstLastPara +``` + +### `tIns` + +```python +tIns = tIns +``` + +### `tagname` + +```python +tagname = 'bodyPr' +``` + +### `upright` + +```python +upright = upright +``` + +### `vert` + +```python +vert = vert +``` + +### `vertOverflow` + +```python +vertOverflow = vertOverflow +``` + +### `wrap` + +```python +wrap = wrap +``` + +## `Spacing` + +```python +Spacing(spcPct = None, spcPts = None) +``` + +Bases: `Serialisable` + +### `spcPct` + +```python +spcPct = spcPct +``` + +### `spcPts` + +```python +spcPts = spcPts +``` + +## `TabStop` + +```python +TabStop(pos = None, algn = None) +``` + +Bases: `Serialisable` + +### `algn` + +```python +algn = algn +``` + +### `pos` + +```python +pos = pos +``` + +## `TabStopList` + +```python +TabStopList(tab = None) +``` + +Bases: `Serialisable` + +### `tab` + +```python +tab = tab +``` + +## `TextField` + +```python +TextField(id = None, type = None, rPr = None, pPr = None, t = None) +``` + +Bases: `Serialisable` + +### `id` + +```python +id = id +``` + +### `pPr` + +```python +pPr = pPr +``` + +### `rPr` + +```python +rPr = rPr +``` + +### `t` + +```python +t = t +``` + +### `type` + +```python +type = type +``` + +## `TextNormalAutofit` + +```python +TextNormalAutofit(fontScale = None, lnSpcReduction = None) +``` + +Bases: `Serialisable` + +### `fontScale` + +```python +fontScale = fontScale +``` + +### `lnSpcReduction` + +```python +lnSpcReduction = lnSpcReduction +``` + + + + + +# `openpyxl.drawing.xdr` + +Spreadsheet Drawing has some copies of Drawing ML elements + +## `XDRPoint2D` + +Bases: `Point2D` + +### `namespace` + +```python +namespace = None +``` + +### `x` + +```python +x = Point2D.x +``` + +### `y` + +```python +y = Point2D.y +``` + +## `XDRPositiveSize2D` + +Bases: `PositiveSize2D` + +### `cx` + +```python +cx = PositiveSize2D.cx +``` + +### `cy` + +```python +cy = PositiveSize2D.cy +``` + +### `namespace` + +```python +namespace = None +``` + +## `XDRTransform2D` + +Bases: `Transform2D` + +### `chExt` + +```python +chExt = Transform2D.chExt +``` + +### `chOff` + +```python +chOff = Transform2D.chOff +``` + +### `ext` + +```python +ext = Transform2D.ext +``` + +### `flipH` + +```python +flipH = Transform2D.flipH +``` + +### `flipV` + +```python +flipV = Transform2D.flipV +``` + +### `namespace` + +```python +namespace = None +``` + +### `off` + +```python +off = Transform2D.off +``` + +### `rot` + +```python +rot = Transform2D.rot +``` + + + + + +# `openpyxl.errors` + +Typed exceptions for paper-xlsx safety refusals. + +## `AmbiguousTargetError` + +Bases: `PaperRefusal` + +The addressed target matches more than one candidate. + +## `BoundaryViolationError` + +Bases: `PaperRefusal` + +The operation would cross a declared boundary (range, sheet, or +package region) it is not allowed to cross. + +## `HandleRebindWarning` + +Bases: `UserWarning` + +A path-backed save committed correctly, but the caller's open file +handle could not be rebound to the replacement file. + +## `OracleTimeoutError` + +Bases: `PaperRefusal` + +The LibreOffice oracle did not finish within the allowed time. + +## `OracleUnavailableError` + +Bases: `PaperRefusal` + +No LibreOffice installation could be found to act as the oracle. + +## `PaperRefusal` + +```python +PaperRefusal(*args, kind = None, anchor = None, options = None) +``` + +Bases: `Exception` + +Base class for all safe refusals. + +Refusals are atomic: when one is raised, the workbook model, the dirty +ledger, and every file on disk are exactly as they were before the +refused operation began. + +Structured fields (populated progressively — message +text is always the source of truth): + +- ``kind``: stable machine-readable string ("ambiguous-label", ...) +- ``anchor``: sheet-qualified address or part name the refusal is + about, or None +- ``options``: suggested remedies / candidate addresses (list) + +### `anchor` + +```python +anchor = anchor +``` + +### `kind` + +```python +kind = kind +``` + +### `options` + +```python +options = list(options) if options else [] +``` + +## `ProtectedWriteWarning` + +Bases: `UserWarning` + +A write landed on a locked cell of a protected sheet. The write +proceeds — openpyxl-level protection is advisory, and this library +reports it rather than enforcing or bypassing it — but +the human who protected the sheet expected the cell to be read-only. +Set ``wb.strict_protection = True`` to turn these writes into typed +refusals. + +## `RelationshipPolicyError` + +Bases: `PaperRefusal` + +The operation would rewrite or renumber package relationships in a +way that could detach preserved content. + +## `TargetNotFoundError` + +Bases: `PaperRefusal` + +The addressed target does not exist in the workbook or package. + +## `UnsupportedStructureError` + +Bases: `PaperRefusal` + +The operation would require understanding or rewriting structure this +library cannot handle safely; performing it would risk silent damage. + + + + + +# `openpyxl.formatting.formatting` + +## `ConditionalFormatting` + +```python +ConditionalFormatting(sqref = (), pivot = None, cfRule = (), extLst = None) +``` + +Bases: `Serialisable` + +### `cells` + +```python +cells = Alias('sqref') +``` + +### `cfRule` + +```python +cfRule = cfRule +``` + +### `pivot` + +```python +pivot = pivot +``` + +### `rules` + +```python +rules = Alias('cfRule') +``` + +### `sqref` + +```python +sqref = sqref +``` + +### `tagname` + +```python +tagname = 'conditionalFormatting' +``` + +## `ConditionalFormattingList` + +```python +ConditionalFormattingList() +``` + +Conditional formatting rules. + +### `add` + +```python +add(range_string, cfRule) +``` + +Add a rule such as ColorScaleRule, FormulaRule or CellIsRule + +The priority will be added automatically. + +### `max_priority` + +```python +max_priority = 0 +``` + + + + + +# `openpyxl.formatting.rule` + +## `CellIsRule` + +```python +CellIsRule(operator = None, formula = None, stopIfTrue = None, font = None, border = None, fill = None) +``` + +Conditional formatting rule based on cell contents. + +## `ColorScale` + +```python +ColorScale(cfvo = None, color = None) +``` + +Bases: `RuleType` + +### `cfvo` + +```python +cfvo = cfvo +``` + +### `color` + +```python +color = color +``` + +### `tagname` + +```python +tagname = 'colorScale' +``` + +## `ColorScaleRule` + +```python +ColorScaleRule(start_type = None, start_value = None, start_color = None, mid_type = None, mid_value = None, mid_color = None, end_type = None, end_value = None, end_color = None) +``` + +Backwards compatibility + +## `DataBar` + +```python +DataBar(minLength = None, maxLength = None, showValue = None, cfvo = None, color = None) +``` + +Bases: `RuleType` + +### `cfvo` + +```python +cfvo = cfvo +``` + +### `color` + +```python +color = color +``` + +### `maxLength` + +```python +maxLength = maxLength +``` + +### `minLength` + +```python +minLength = minLength +``` + +### `showValue` + +```python +showValue = showValue +``` + +### `tagname` + +```python +tagname = 'dataBar' +``` + +## `DataBarRule` + +```python +DataBarRule(start_type = None, start_value = None, end_type = None, end_value = None, color = None, showValue = None, minLength = None, maxLength = None) +``` + +## `FormatObject` + +```python +FormatObject(type, val = None, gte = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `gte` + +```python +gte = gte +``` + +### `tagname` + +```python +tagname = 'cfvo' +``` + +### `type` + +```python +type = type +``` + +### `val` + +```python +val = val +``` + +## `FormulaRule` + +```python +FormulaRule(formula = None, stopIfTrue = None, font = None, border = None, fill = None) +``` + +Conditional formatting with custom differential style + +## `IconSet` + +```python +IconSet(iconSet = None, showValue = None, percent = None, reverse = None, cfvo = None) +``` + +Bases: `RuleType` + +### `cfvo` + +```python +cfvo = cfvo +``` + +### `iconSet` + +```python +iconSet = iconSet +``` + +### `percent` + +```python +percent = percent +``` + +### `reverse` + +```python +reverse = reverse +``` + +### `showValue` + +```python +showValue = showValue +``` + +### `tagname` + +```python +tagname = 'iconSet' +``` + +## `IconSetRule` + +```python +IconSetRule(icon_style = None, type = None, values = None, showValue = None, percent = None, reverse = None) +``` + +Convenience function for creating icon set rules + +## `Rule` + +```python +Rule(type, dxfId = None, priority = 0, stopIfTrue = None, aboveAverage = None, percent = None, bottom = None, operator = None, text = None, timePeriod = None, rank = None, stdDev = None, equalAverage = None, formula = (), colorScale = None, dataBar = None, iconSet = None, extLst = None, dxf = None) +``` + +Bases: `Serialisable` + +### `aboveAverage` + +```python +aboveAverage = aboveAverage +``` + +### `bottom` + +```python +bottom = bottom +``` + +### `colorScale` + +```python +colorScale = colorScale +``` + +### `dataBar` + +```python +dataBar = dataBar +``` + +### `dxf` + +```python +dxf = dxf +``` + +### `dxfId` + +```python +dxfId = dxfId +``` + +### `equalAverage` + +```python +equalAverage = equalAverage +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `formula` + +```python +formula = formula +``` + +### `iconSet` + +```python +iconSet = iconSet +``` + +### `operator` + +```python +operator = operator +``` + +### `percent` + +```python +percent = percent +``` + +### `priority` + +```python +priority = priority +``` + +### `rank` + +```python +rank = rank +``` + +### `stdDev` + +```python +stdDev = stdDev +``` + +### `stopIfTrue` + +```python +stopIfTrue = stopIfTrue +``` + +### `tagname` + +```python +tagname = 'cfRule' +``` + +### `text` + +```python +text = text +``` + +### `timePeriod` + +```python +timePeriod = timePeriod +``` + +### `type` + +```python +type = type +``` + +## `RuleType` + +Bases: `Serialisable` + +### `cfvo` + +```python +cfvo = Sequence(expected_type=FormatObject) +``` + +## `ValueDescriptor` + +Bases: `Float` + +Expected type depends upon type attribute of parent :-( + +Most values should be numeric BUT they can also be cell references + + + + + +# `openpyxl.formula.tokenizer` + +This module contains a tokenizer for Excel formulae. + +## `EXCEL_ERROR_CODES` + +```python +EXCEL_ERROR_CODES = ('#NULL!', '#DIV/0!', '#VALUE!', '#REF!', '#NAME?', '#NUM!', '#N/A', '#SPILL!', '#CALC!', '#FIELD!', '#BLOCKED!', '#UNKNOWN!', '#CONNECT!', '#BUSY!', '#PYTHON!', '#GETTING_DATA') +``` + +## `Token` + +```python +Token(value, type_, subtype = '') +``` + +A token in an Excel formula. + +Tokens have three attributes: + +* `value`: The string value parsed that led to this token +* `type`: A string identifying the type of token +* `subtype`: A string identifying subtype of the token (optional, and + defaults to "") + +### `ARG` + +```python +ARG = 'ARG' +``` + +### `ARRAY` + +```python +ARRAY = 'ARRAY' +``` + +### `CLOSE` + +```python +CLOSE = 'CLOSE' +``` + +### `ERROR` + +```python +ERROR = 'ERROR' +``` + +### `FUNC` + +```python +FUNC = 'FUNC' +``` + +### `LITERAL` + +```python +LITERAL = 'LITERAL' +``` + +### `LOGICAL` + +```python +LOGICAL = 'LOGICAL' +``` + +### `NUMBER` + +```python +NUMBER = 'NUMBER' +``` + +### `OPEN` + +```python +OPEN = 'OPEN' +``` + +### `OPERAND` + +```python +OPERAND = 'OPERAND' +``` + +### `OP_IN` + +```python +OP_IN = 'OPERATOR-INFIX' +``` + +### `OP_POST` + +```python +OP_POST = 'OPERATOR-POSTFIX' +``` + +### `OP_PRE` + +```python +OP_PRE = 'OPERATOR-PREFIX' +``` + +### `PAREN` + +```python +PAREN = 'PAREN' +``` + +### `RANGE` + +```python +RANGE = 'RANGE' +``` + +### `ROW` + +```python +ROW = 'ROW' +``` + +### `SEP` + +```python +SEP = 'SEP' +``` + +### `TEXT` + +```python +TEXT = 'TEXT' +``` + +### `WSPACE` + +```python +WSPACE = 'WHITE-SPACE' +``` + +### `get_closer` + +```python +get_closer() +``` + +Return a closing token that matches this token's type. + +### `make_operand` + +```python +make_operand(value) +``` + +Create an operand token. + +### `make_separator` + +```python +make_separator(value) +``` + +Create a separator token + +### `make_subexp` + +```python +make_subexp(value, func = False) +``` + +Create a subexpression token. + +`value`: The value of the token +`func`: If True, force the token to be of type FUNC + +### `subtype` + +```python +subtype = subtype +``` + +### `type` + +```python +type = type_ +``` + +### `value` + +```python +value = value +``` + +## `Tokenizer` + +```python +Tokenizer(formula) +``` + +A tokenizer for Excel worksheet formulae. + +Converts a str string representing an Excel formula (in A1 notation) +into a sequence of `Token` objects. + +`formula`: The str string to tokenize + +Tokenizer defines a method `._parse()` to parse the formula into tokens, +which can then be accessed through the `.items` attribute. + +### `ERROR_CODES` + +```python +ERROR_CODES = EXCEL_ERROR_CODES +``` + +### `SN_RE` + +```python +SN_RE = re.compile('^[1-9](\\.[0-9]+)?[Ee]$') +``` + +### `STRING_REGEXES` + +```python +STRING_REGEXES = {'"': re.compile('"(?:[^"]*"")*[^"]*"(?!")'), "'": re.compile("'(?:[^']*'')*[^']*'(?!')")} +``` + +### `TOKEN_ENDERS` + +```python +TOKEN_ENDERS = ',;}) +-*/^&=><%' +``` + +### `WSPACE_RE` + +```python +WSPACE_RE = re.compile('[ \\n]+') +``` + +### `assert_empty_token` + +```python +assert_empty_token(can_follow = ()) +``` + +Ensure that there's no token currently being parsed. + +Or if there is a token being parsed, it must end with a character in +can_follow. + +If there are unconsumed token contents, it means we hit an unexpected +token transition. In this case, we raise a TokenizerError + +### `check_scientific_notation` + +```python +check_scientific_notation() +``` + +Consumes a + or - character if part of a number in sci. notation. + +Returns True if the character was consumed and self.offset was +updated, False otherwise. + +### `formula` + +```python +formula = formula +``` + +### `items` + +```python +items = [] +``` + +### `offset` + +```python +offset = 0 +``` + +### `render` + +```python +render() +``` + +Convert the parsed tokens back to a string. + +### `save_token` + +```python +save_token() +``` + +If there's a token being parsed, add it to the item list. + +### `token` + +```python +token = [] +``` + +### `token_stack` + +```python +token_stack = [] +``` + +## `TokenizerError` + +Bases: `Exception` + +Base class for all Tokenizer errors. + + + + + +# `openpyxl.formula.translate` + +This module contains code to translate formulae across cells in a worksheet. + +## `Translator` + +```python +Translator(formula, origin) +``` + +Modifies a formula so that it can be translated from one cell to another. + +`formula`: The str string to translate. Must include the leading '=' + character. +`origin`: The cell address (in A1 notation) where this formula was + defined (excluding the worksheet name). + +### `CELL_REF_RE` + +```python +CELL_REF_RE = re.compile('(\\$?[A-Za-z]{1,3})(\\$?[1-9][0-9]{0,6})$') +``` + +### `COL_RANGE_RE` + +```python +COL_RANGE_RE = re.compile('(\\$?[A-Za-z]{1,3}):(\\$?[A-Za-z]{1,3})$') +``` + +### `ROW_RANGE_RE` + +```python +ROW_RANGE_RE = re.compile('(\\$?[1-9][0-9]{0,6}):(\\$?[1-9][0-9]{0,6})$') +``` + +### `get_tokens` + +```python +get_tokens() +``` + +Returns a list with the tokens comprising the formula. + +### `strip_ws_name` + +```python +strip_ws_name(range_str) +``` + +Splits out the worksheet reference, if any, from a range reference. + +### `tokenizer` + +```python +tokenizer = Tokenizer(formula) +``` + +### `translate_col` + +```python +translate_col(col_str, cdelta) +``` + +Translate a range col-snippet by the given number of columns + +### `translate_formula` + +```python +translate_formula(dest = None, row_delta = 0, col_delta = 0) +``` + +Convert the formula into A1 notation, or as row and column coordinates + +The formula is converted into A1 assuming it is assigned to the cell +whose address is `dest` (no worksheet name). + +### `translate_range` + +```python +translate_range(range_str, rdelta, cdelta) +``` + +Translate an A1-style range reference to the destination cell. + +`rdelta`: the row offset to add to the range +`cdelta`: the column offset to add to the range +`range_str`: an A1-style reference to a range. Potentially includes + the worksheet reference. Could also be a named range. + +### `translate_row` + +```python +translate_row(row_str, rdelta) +``` + +Translate a range row-snippet by the given number of rows. + +## `TranslatorError` + +Bases: `Exception` + +Raised when a formula can't be translated across cells. + +This error arises when a formula's references would be translated outside +the worksheet's bounds on the top or left. Excel represents these +situations with a #REF! literal error. E.g., if the formula at B2 is +'=A1', attempting to translate the formula to B1 raises TranslatorError, +since there's no cell above A1. Similarly, translating the same formula +from B2 to A2 raises TranslatorError, since there's no cell to the left of +A1. diff --git a/core/services/studio/builtinskills/tree/xlsx/references/api/index.md b/addons/sandbox/skills/xlsx/references/api-003.md similarity index 66% rename from core/services/studio/builtinskills/tree/xlsx/references/api/index.md rename to addons/sandbox/skills/xlsx/references/api-003.md index 1e9d75ff5..8b6919137 100644 --- a/core/services/studio/builtinskills/tree/xlsx/references/api/index.md +++ b/addons/sandbox/skills/xlsx/references/api-003.md @@ -1,3 +1,5 @@ + + # paper-xlsx API reference @@ -10,212 +12,212 @@ This index names every symbol documented here. Open the one page you need rather | Page | Surface | | --- | --- | -| [`openpyxl.cell.cell`](cell.cell.md) | 20 members | -| [`openpyxl.cell.read_only`](cell.read_only.md) | 3 members | -| [`openpyxl.cell.rich_text`](cell.rich_text.md) | 2 members | -| [`openpyxl.cell.text`](cell.text.md) | 5 members | -| [`openpyxl.chart.area_chart`](chart.area_chart.md) | 3 members | -| [`openpyxl.chart.axis`](chart.axis.md) | 8 members | -| [`openpyxl.chart.bar_chart`](chart.bar_chart.md) | 2 members | -| [`openpyxl.chart.bubble_chart`](chart.bubble_chart.md) | 1 member | -| [`openpyxl.chart.chartspace`](chart.chartspace.md) | 4 members | -| [`openpyxl.chart.data_source`](chart.data_source.md) | 13 members | -| [`openpyxl.chart.descriptors`](chart.descriptors.md) | 3 members | -| [`openpyxl.chart.error_bar`](chart.error_bar.md) | 1 member | -| [`openpyxl.chart.label`](chart.label.md) | 2 members | -| [`openpyxl.chart.layout`](chart.layout.md) | 2 members | -| [`openpyxl.chart.legend`](chart.legend.md) | 2 members | -| [`openpyxl.chart.line_chart`](chart.line_chart.md) | 2 members | -| [`openpyxl.chart.marker`](chart.marker.md) | 2 members | -| [`openpyxl.chart.picture`](chart.picture.md) | 1 member | -| [`openpyxl.chart.pie_chart`](chart.pie_chart.md) | 5 members | -| [`openpyxl.chart.pivot`](chart.pivot.md) | 2 members | -| [`openpyxl.chart.plotarea`](chart.plotarea.md) | 2 members | -| [`openpyxl.chart.print_settings`](chart.print_settings.md) | 2 members | -| [`openpyxl.chart.radar_chart`](chart.radar_chart.md) | 1 member | -| [`openpyxl.chart.reader`](chart.reader.md) | 1 member | -| [`openpyxl.chart.reference`](chart.reference.md) | 2 members | -| [`openpyxl.chart.scatter_chart`](chart.scatter_chart.md) | 1 member | -| [`openpyxl.chart.series`](chart.series.md) | 4 members | -| [`openpyxl.chart.series_factory`](chart.series_factory.md) | 1 member | -| [`openpyxl.chart.shapes`](chart.shapes.md) | 1 member | -| [`openpyxl.chart.stock_chart`](chart.stock_chart.md) | 1 member | -| [`openpyxl.chart.surface_chart`](chart.surface_chart.md) | 4 members | -| [`openpyxl.chart.text`](chart.text.md) | 2 members | -| [`openpyxl.chart.title`](chart.title.md) | 3 members | -| [`openpyxl.chart.trendline`](chart.trendline.md) | 2 members | -| [`openpyxl.chart.updown_bars`](chart.updown_bars.md) | 1 member | -| [`openpyxl.chartsheet.chartsheet`](chartsheet.chartsheet.md) | 1 member | -| [`openpyxl.chartsheet.custom`](chartsheet.custom.md) | 2 members | -| [`openpyxl.chartsheet.properties`](chartsheet.properties.md) | 1 member | -| [`openpyxl.chartsheet.protection`](chartsheet.protection.md) | 1 member | -| [`openpyxl.chartsheet.publish`](chartsheet.publish.md) | 2 members | -| [`openpyxl.chartsheet.relation`](chartsheet.relation.md) | 2 members | -| [`openpyxl.chartsheet.views`](chartsheet.views.md) | 2 members | -| [`openpyxl.comments.author`](comments.author.md) | 1 member | -| [`openpyxl.comments.comment_sheet`](comments.comment_sheet.md) | 3 members | -| [`openpyxl.comments.comments`](comments.comments.md) | 1 member | -| [`openpyxl.comments.shape_writer`](comments.shape_writer.md) | 4 members | -| [`openpyxl.compat`](compat.md) | 3 members | -| [`openpyxl.compat.numbers`](compat.numbers.md) | 2 members | -| [`openpyxl.compat.product`](compat.product.md) | 1 member | -| [`openpyxl.compat.singleton`](compat.singleton.md) | 2 members | -| [`openpyxl.compat.strings`](compat.strings.md) | 2 members | -| [`openpyxl.descriptors`](descriptors.md) | 3 members | -| [`openpyxl.descriptors.base`](descriptors.base.md) | 21 members | -| [`openpyxl.descriptors.container`](descriptors.container.md) | 1 member | -| [`openpyxl.descriptors.excel`](descriptors.excel.md) | 11 members | -| [`openpyxl.descriptors.namespace`](descriptors.namespace.md) | 1 member | -| [`openpyxl.descriptors.nested`](descriptors.nested.md) | 11 members | -| [`openpyxl.descriptors.sequence`](descriptors.sequence.md) | 6 members | -| [`openpyxl.descriptors.serialisable`](descriptors.serialisable.md) | 3 members | -| [`openpyxl.descriptors.slots`](descriptors.slots.md) | 1 member | -| [`openpyxl.drawing.colors`](drawing.colors.md) | 10 members | -| [`openpyxl.drawing.connector`](drawing.connector.md) | 7 members | -| [`openpyxl.drawing.drawing`](drawing.drawing.md) | 1 member | -| [`openpyxl.drawing.effect`](drawing.effect.md) | 26 members | -| [`openpyxl.drawing.fill`](drawing.fill.md) | 11 members | -| [`openpyxl.drawing.geometry`](drawing.geometry.md) | 27 members | -| [`openpyxl.drawing.graphic`](drawing.graphic.md) | 7 members | -| [`openpyxl.drawing.image`](drawing.image.md) | 1 member | -| [`openpyxl.drawing.line`](drawing.line.md) | 4 members | -| [`openpyxl.drawing.picture`](drawing.picture.md) | 4 members | -| [`openpyxl.drawing.properties`](drawing.properties.md) | 6 members | -| [`openpyxl.drawing.relation`](drawing.relation.md) | 1 member | -| [`openpyxl.drawing.spreadsheet_drawing`](drawing.spreadsheet_drawing.md) | 6 members | -| [`openpyxl.drawing.text`](drawing.text.md) | 19 members | -| [`openpyxl.drawing.xdr`](drawing.xdr.md) | 3 members | -| [`openpyxl.errors`](errors.md) | 10 members | -| [`openpyxl.formatting.formatting`](formatting.formatting.md) | 2 members | -| [`openpyxl.formatting.rule`](formatting.rule.md) | 12 members | -| [`openpyxl.formula.tokenizer`](formula.tokenizer.md) | 4 members | -| [`openpyxl.formula.translate`](formula.translate.md) | 2 members | -| [`openpyxl.oracle`](oracle.md) | 14 members | -| [`openpyxl.package`](package.md) | 7 members | -| [`openpyxl.package.cells`](package.cells.md) | 2 members | -| [`openpyxl.package.diff`](package.diff.md) | 5 members | -| [`openpyxl.packaging.core`](packaging.core.md) | 3 members | -| [`openpyxl.packaging.custom`](packaging.custom.md) | 10 members | -| [`openpyxl.packaging.extended`](packaging.extended.md) | 4 members | -| [`openpyxl.packaging.interface`](packaging.interface.md) | 1 member | -| [`openpyxl.packaging.manifest`](packaging.manifest.md) | 6 members | -| [`openpyxl.packaging.relationship`](packaging.relationship.md) | 5 members | -| [`openpyxl.packaging.workbook`](packaging.workbook.md) | 4 members | -| [`openpyxl.pivot.cache`](pivot.cache.md) | 27 members | -| [`openpyxl.pivot.fields`](pivot.fields.md) | 9 members | -| [`openpyxl.pivot.record`](pivot.record.md) | 2 members | -| [`openpyxl.pivot.table`](pivot.table.md) | 24 members | -| [`openpyxl.preserve`](preserve.md) | 5 members | -| [`openpyxl.preserve.chartpatch`](preserve.chartpatch.md) | 10 members | -| [`openpyxl.preserve.comments`](preserve.comments.md) | 6 members | -| [`openpyxl.preserve.crosscheck`](preserve.crosscheck.md) | 2 members | -| [`openpyxl.preserve.crosspart`](preserve.crosspart.md) | 18 members | -| [`openpyxl.preserve.diffreport`](preserve.diffreport.md) | 2 members | -| [`openpyxl.preserve.drawings`](preserve.drawings.md) | 10 members | -| [`openpyxl.preserve.emit`](preserve.emit.md) | 7 members | -| [`openpyxl.preserve.hygiene`](preserve.hygiene.md) | 3 members | -| [`openpyxl.preserve.images`](preserve.images.md) | 2 members | -| [`openpyxl.preserve.inventory`](preserve.inventory.md) | 2 members | -| [`openpyxl.preserve.ledger`](preserve.ledger.md) | 19 members | -| [`openpyxl.preserve.lexical`](preserve.lexical.md) | 1 member | -| [`openpyxl.preserve.lifecycle`](preserve.lifecycle.md) | 1 member | -| [`openpyxl.preserve.perception`](preserve.perception.md) | 3 members | -| [`openpyxl.preserve.pivots`](preserve.pivots.md) | 6 members | -| [`openpyxl.preserve.receipts`](preserve.receipts.md) | 2 members | -| [`openpyxl.preserve.references`](preserve.references.md) | 6 members | -| [`openpyxl.preserve.regions`](preserve.regions.md) | 14 members | -| [`openpyxl.preserve.rewrite`](preserve.rewrite.md) | 14 members | -| [`openpyxl.preserve.saver`](preserve.saver.md) | 2 members | -| [`openpyxl.preserve.sourceio`](preserve.sourceio.md) | 1 member | -| [`openpyxl.preserve.splice`](preserve.splice.md) | 3 members | -| [`openpyxl.preserve.structural`](preserve.structural.md) | 13 members | -| [`openpyxl.preserve.styletrans`](preserve.styletrans.md) | 1 member | -| [`openpyxl.preserve.styleverbs`](preserve.styleverbs.md) | 1 member | -| [`openpyxl.preserve.tables`](preserve.tables.md) | 6 members | -| [`openpyxl.preserve.validation`](preserve.validation.md) | 1 member | -| [`openpyxl.preserve.x14`](preserve.x14.md) | 3 members | -| [`openpyxl.preserve.xmlscan`](preserve.xmlscan.md) | 6 members | -| [`openpyxl.preserve.zipguard`](preserve.zipguard.md) | 3 members | -| [`openpyxl.preserve.zipio`](preserve.zipio.md) | 13 members | -| [`openpyxl.reader.drawings`](reader.drawings.md) | 1 member | -| [`openpyxl.reader.excel`](reader.excel.md) | 6 members | -| [`openpyxl.reader.strings`](reader.strings.md) | 2 members | -| [`openpyxl.reader.workbook`](reader.workbook.md) | 1 member | -| [`openpyxl.styles.alignment`](styles.alignment.md) | 3 members | -| [`openpyxl.styles.borders`](styles.borders.md) | 17 members | -| [`openpyxl.styles.builtins`](styles.builtins.md) | 51 members | -| [`openpyxl.styles.cell_style`](styles.cell_style.md) | 4 members | -| [`openpyxl.styles.colors`](styles.colors.md) | 10 members | -| [`openpyxl.styles.differential`](styles.differential.md) | 2 members | -| [`openpyxl.styles.fills`](styles.fills.md) | 27 members | -| [`openpyxl.styles.fonts`](styles.fonts.md) | 2 members | -| [`openpyxl.styles.named_styles`](styles.named_styles.md) | 2 members | -| [`openpyxl.styles.numbers`](styles.numbers.md) | 51 members | -| [`openpyxl.styles.protection`](styles.protection.md) | 1 member | -| [`openpyxl.styles.proxy`](styles.proxy.md) | 1 member | -| [`openpyxl.styles.styleable`](styles.styleable.md) | 5 members | -| [`openpyxl.styles.stylesheet`](styles.stylesheet.md) | 3 members | -| [`openpyxl.styles.table`](styles.table.md) | 3 members | -| [`openpyxl.utils.bound_dictionary`](utils.bound_dictionary.md) | 1 member | -| [`openpyxl.utils.cell`](utils.cell.md) | 18 members | -| [`openpyxl.utils.dataframe`](utils.dataframe.md) | 2 members | -| [`openpyxl.utils.datetime`](utils.datetime.md) | 15 members | -| [`openpyxl.utils.escape`](utils.escape.md) | 2 members | -| [`openpyxl.utils.exceptions`](utils.exceptions.md) | 7 members | -| [`openpyxl.utils.formulas`](utils.formulas.md) | 2 members | -| [`openpyxl.utils.indexed_list`](utils.indexed_list.md) | 1 member | -| [`openpyxl.utils.inference`](utils.inference.md) | 6 members | -| [`openpyxl.utils.protection`](utils.protection.md) | 1 member | -| [`openpyxl.utils.units`](utils.units.md) | 21 members | -| [`openpyxl.workbook.child`](workbook.child.md) | 2 members | -| [`openpyxl.workbook.defined_name`](workbook.defined_name.md) | 5 members | -| [`openpyxl.workbook.external_link.external`](workbook.external_link.external.md) | 9 members | -| [`openpyxl.workbook.external_reference`](workbook.external_reference.md) | 1 member | -| [`openpyxl.workbook.function_group`](workbook.function_group.md) | 2 members | -| [`openpyxl.workbook.properties`](workbook.properties.md) | 3 members | -| [`openpyxl.workbook.protection`](workbook.protection.md) | 3 members | -| [`openpyxl.workbook.smart_tags`](workbook.smart_tags.md) | 3 members | -| [`openpyxl.workbook.views`](workbook.views.md) | 2 members | -| [`openpyxl.workbook.web`](workbook.web.md) | 3 members | -| [`openpyxl.workbook.workbook`](workbook.workbook.md) | 3 members | -| [`openpyxl.worksheet.cell_range`](worksheet.cell_range.md) | 2 members | -| [`openpyxl.worksheet.cell_watch`](worksheet.cell_watch.md) | 2 members | -| [`openpyxl.worksheet.controls`](worksheet.controls.md) | 3 members | -| [`openpyxl.worksheet.copier`](worksheet.copier.md) | 1 member | -| [`openpyxl.worksheet.custom`](worksheet.custom.md) | 2 members | -| [`openpyxl.worksheet.datavalidation`](worksheet.datavalidation.md) | 4 members | -| [`openpyxl.worksheet.dimensions`](worksheet.dimensions.md) | 6 members | -| [`openpyxl.worksheet.drawing`](worksheet.drawing.md) | 1 member | -| [`openpyxl.worksheet.errors`](worksheet.errors.md) | 4 members | -| [`openpyxl.worksheet.filters`](worksheet.filters.md) | 16 members | -| [`openpyxl.worksheet.formula`](worksheet.formula.md) | 2 members | -| [`openpyxl.worksheet.header_footer`](worksheet.header_footer.md) | 6 members | -| [`openpyxl.worksheet.hyperlink`](worksheet.hyperlink.md) | 2 members | -| [`openpyxl.worksheet.merge`](worksheet.merge.md) | 3 members | -| [`openpyxl.worksheet.ole`](worksheet.ole.md) | 4 members | -| [`openpyxl.worksheet.page`](worksheet.page.md) | 3 members | -| [`openpyxl.worksheet.pagebreak`](worksheet.pagebreak.md) | 4 members | -| [`openpyxl.worksheet.picture`](worksheet.picture.md) | 1 member | -| [`openpyxl.worksheet.print_settings`](worksheet.print_settings.md) | 10 members | -| [`openpyxl.worksheet.properties`](worksheet.properties.md) | 3 members | -| [`openpyxl.worksheet.protection`](worksheet.protection.md) | 1 member | -| [`openpyxl.worksheet.related`](worksheet.related.md) | 1 member | -| [`openpyxl.worksheet.scenario`](worksheet.scenario.md) | 3 members | -| [`openpyxl.worksheet.smart_tag`](worksheet.smart_tag.md) | 4 members | -| [`openpyxl.worksheet.table`](worksheet.table.md) | 10 members | -| [`openpyxl.worksheet.views`](worksheet.views.md) | 4 members | -| [`openpyxl.worksheet.worksheet`](worksheet.worksheet.md) | 1 member | -| [`openpyxl.writer.excel`](writer.excel.md) | 4 members | -| [`openpyxl.writer.theme`](writer.theme.md) | 2 members | -| [`openpyxl.xml`](xml.md) | 6 members | -| [`openpyxl.xml.constants`](xml.constants.md) | 76 members | -| [`openpyxl.xml.functions`](xml.functions.md) | 7 members | +| [`openpyxl.cell.cell`](api-001.md#source-5cb78d3146816160) | 20 members | +| [`openpyxl.cell.read_only`](api-001.md#source-8672d1a977213aa9) | 3 members | +| [`openpyxl.cell.rich_text`](api-001.md#source-8885d3657daf45cb) | 2 members | +| [`openpyxl.cell.text`](api-001.md#source-a779fd29ce9aa2c2) | 5 members | +| [`openpyxl.chart.area_chart`](api-001.md#source-258e32d6bebfd951) | 3 members | +| [`openpyxl.chart.axis`](api-001.md#source-6120dcba1c2aef75) | 8 members | +| [`openpyxl.chart.bar_chart`](api-001.md#source-3008a83348d369ae) | 2 members | +| [`openpyxl.chart.bubble_chart`](api-001.md#source-e90f987e11ed59f5) | 1 member | +| [`openpyxl.chart.chartspace`](api-001.md#source-d9f02a516d656167) | 4 members | +| [`openpyxl.chart.data_source`](api-001.md#source-1afb91ee70b2a5ae) | 13 members | +| [`openpyxl.chart.descriptors`](api-001.md#source-7cebe4028eee1a8d) | 3 members | +| [`openpyxl.chart.error_bar`](api-001.md#source-e4f31ac82f0d9f4d) | 1 member | +| [`openpyxl.chart.label`](api-001.md#source-a7431a66e170e5c5) | 2 members | +| [`openpyxl.chart.layout`](api-001.md#source-afbaa4a782db3ae8) | 2 members | +| [`openpyxl.chart.legend`](api-001.md#source-552e30d0e0ba7bde) | 2 members | +| [`openpyxl.chart.line_chart`](api-001.md#source-8a1385d0c9a021de) | 2 members | +| [`openpyxl.chart.marker`](api-001.md#source-931b526d328b84ea) | 2 members | +| [`openpyxl.chart.picture`](api-001.md#source-c75f56daca885b18) | 1 member | +| [`openpyxl.chart.pie_chart`](api-001.md#source-298e910e7058aa9e) | 5 members | +| [`openpyxl.chart.pivot`](api-001.md#source-067cc7cab0530213) | 2 members | +| [`openpyxl.chart.plotarea`](api-001.md#source-f2f25f2101bd0fe1) | 2 members | +| [`openpyxl.chart.print_settings`](api-001.md#source-3fd8604a72e0eebc) | 2 members | +| [`openpyxl.chart.radar_chart`](api-001.md#source-d86b608241e10e4f) | 1 member | +| [`openpyxl.chart.reader`](api-001.md#source-6b257aa8936290a0) | 1 member | +| [`openpyxl.chart.reference`](api-001.md#source-8f14cf9777fbc564) | 2 members | +| [`openpyxl.chart.scatter_chart`](api-001.md#source-99ffa8ed2817df0b) | 1 member | +| [`openpyxl.chart.series`](api-001.md#source-44896c9f83c6778b) | 4 members | +| [`openpyxl.chart.series_factory`](api-001.md#source-82efccc6aff94880) | 1 member | +| [`openpyxl.chart.shapes`](api-001.md#source-e4ddc67dd2463a1a) | 1 member | +| [`openpyxl.chart.stock_chart`](api-001.md#source-ed46fb9c55ec3014) | 1 member | +| [`openpyxl.chart.surface_chart`](api-001.md#source-16faa91087af85a4) | 4 members | +| [`openpyxl.chart.text`](api-001.md#source-e5567e80a68cc4b6) | 2 members | +| [`openpyxl.chart.title`](api-001.md#source-2f024211be301528) | 3 members | +| [`openpyxl.chart.trendline`](api-001.md#source-c9a1721db446df72) | 2 members | +| [`openpyxl.chart.updown_bars`](api-001.md#source-745736fd3b74266b) | 1 member | +| [`openpyxl.chartsheet.chartsheet`](api-001.md#source-d166272b85e48625) | 1 member | +| [`openpyxl.chartsheet.custom`](api-001.md#source-c7c8f9802d73c605) | 2 members | +| [`openpyxl.chartsheet.properties`](api-001.md#source-d94623c54a296347) | 1 member | +| [`openpyxl.chartsheet.protection`](api-001.md#source-7df72048def6b206) | 1 member | +| [`openpyxl.chartsheet.publish`](api-001.md#source-db86a2352c183ff7) | 2 members | +| [`openpyxl.chartsheet.relation`](api-001.md#source-9fc61eda6e40b865) | 2 members | +| [`openpyxl.chartsheet.views`](api-001.md#source-8411b79d8bf6d48e) | 2 members | +| [`openpyxl.comments.author`](api-001.md#source-55e470e6672d4012) | 1 member | +| [`openpyxl.comments.comment_sheet`](api-001.md#source-4e331b0792b7a6a1) | 3 members | +| [`openpyxl.comments.comments`](api-001.md#source-abd1516358f3b68d) | 1 member | +| [`openpyxl.comments.shape_writer`](api-001.md#source-7f33ba3daeaa7ffa) | 4 members | +| [`openpyxl.compat`](api-001.md#source-e2a0f35cc04861d5) | 3 members | +| [`openpyxl.compat.numbers`](api-001.md#source-65bf160b638843a4) | 2 members | +| [`openpyxl.compat.product`](api-001.md#source-a70dc28c373c348c) | 1 member | +| [`openpyxl.compat.singleton`](api-001.md#source-98c364980b9699aa) | 2 members | +| [`openpyxl.compat.strings`](api-001.md#source-ed8afbf50adc09c5) | 2 members | +| [`openpyxl.descriptors`](api-002.md#source-2462bbee4eaa3929) | 3 members | +| [`openpyxl.descriptors.base`](api-001.md#source-6b43c571a6ea05c6) | 21 members | +| [`openpyxl.descriptors.container`](api-001.md#source-308b30827e39f61d) | 1 member | +| [`openpyxl.descriptors.excel`](api-001.md#source-dbeb02836be68928) | 11 members | +| [`openpyxl.descriptors.namespace`](api-002.md#source-2df4afd60937074d) | 1 member | +| [`openpyxl.descriptors.nested`](api-002.md#source-b470a3ab0e1c8802) | 11 members | +| [`openpyxl.descriptors.sequence`](api-002.md#source-48d6ac374d5bce2e) | 6 members | +| [`openpyxl.descriptors.serialisable`](api-002.md#source-081de7b596bccb94) | 3 members | +| [`openpyxl.descriptors.slots`](api-002.md#source-fbf231fb4775d66d) | 1 member | +| [`openpyxl.drawing.colors`](api-002.md#source-f785c9647f984908) | 10 members | +| [`openpyxl.drawing.connector`](api-002.md#source-79bb4535bff3ce6b) | 7 members | +| [`openpyxl.drawing.drawing`](api-002.md#source-55305c20677d5aa3) | 1 member | +| [`openpyxl.drawing.effect`](api-002.md#source-008a81aef6823763) | 26 members | +| [`openpyxl.drawing.fill`](api-002.md#source-cdab8e675dda3205) | 11 members | +| [`openpyxl.drawing.geometry`](api-002.md#source-ed8e8f4384197998) | 27 members | +| [`openpyxl.drawing.graphic`](api-002.md#source-52294417c587c6ba) | 7 members | +| [`openpyxl.drawing.image`](api-002.md#source-d3e546d89a6c739c) | 1 member | +| [`openpyxl.drawing.line`](api-002.md#source-a082e4bada372f61) | 4 members | +| [`openpyxl.drawing.picture`](api-002.md#source-c8c3a03c8b5baf26) | 4 members | +| [`openpyxl.drawing.properties`](api-002.md#source-4a89e525002548f9) | 6 members | +| [`openpyxl.drawing.relation`](api-002.md#source-0a6acbf4f723b775) | 1 member | +| [`openpyxl.drawing.spreadsheet_drawing`](api-002.md#source-3503ff43445c9604) | 6 members | +| [`openpyxl.drawing.text`](api-002.md#source-929c5f519b85d44e) | 19 members | +| [`openpyxl.drawing.xdr`](api-002.md#source-f11e9dd9c08d203f) | 3 members | +| [`openpyxl.errors`](api-002.md#source-412a4d7e688bc7d9) | 10 members | +| [`openpyxl.formatting.formatting`](api-002.md#source-a03877bd6f3ec745) | 2 members | +| [`openpyxl.formatting.rule`](api-002.md#source-0912702f237be935) | 12 members | +| [`openpyxl.formula.tokenizer`](api-002.md#source-47c58ef1a2cd9787) | 4 members | +| [`openpyxl.formula.translate`](api-002.md#source-d375fa42a478a201) | 2 members | +| [`openpyxl.oracle`](api-003.md#source-ebde9fced8d61f90) | 14 members | +| [`openpyxl.package`](api-003.md#source-200a6283165cf51d) | 7 members | +| [`openpyxl.package.cells`](api-003.md#source-ddf84a6b15b5516a) | 2 members | +| [`openpyxl.package.diff`](api-003.md#source-7a8d187cd50ffd35) | 5 members | +| [`openpyxl.packaging.core`](api-003.md#source-e4be8124af7b1145) | 3 members | +| [`openpyxl.packaging.custom`](api-003.md#source-1c9347e95cfa1b38) | 10 members | +| [`openpyxl.packaging.extended`](api-003.md#source-2ab99e664c59be34) | 4 members | +| [`openpyxl.packaging.interface`](api-003.md#source-7c2d5135e8714d7f) | 1 member | +| [`openpyxl.packaging.manifest`](api-003.md#source-7be05c5195852bae) | 6 members | +| [`openpyxl.packaging.relationship`](api-003.md#source-742f592e72c0a181) | 5 members | +| [`openpyxl.packaging.workbook`](api-003.md#source-013a0f423868189c) | 4 members | +| [`openpyxl.pivot.cache`](api-004.md#source-941ae8248b588306) | 27 members | +| [`openpyxl.pivot.fields`](api-004.md#source-3cf0f0af742e40e4) | 9 members | +| [`openpyxl.pivot.record`](api-004.md#source-c029de0a44922d18) | 2 members | +| [`openpyxl.pivot.table`](api-004.md#source-20844e186f19a8eb) | 24 members | +| [`openpyxl.preserve`](api-004.md#source-a322204280c7237d) | 5 members | +| [`openpyxl.preserve.chartpatch`](api-004.md#source-d9953f8ae9473b20) | 10 members | +| [`openpyxl.preserve.comments`](api-004.md#source-d967888f51029fae) | 6 members | +| [`openpyxl.preserve.crosscheck`](api-004.md#source-0cbd9d1b33825bab) | 2 members | +| [`openpyxl.preserve.crosspart`](api-004.md#source-3e11e9868cabfe3a) | 18 members | +| [`openpyxl.preserve.diffreport`](api-004.md#source-f7cd2750fd55a935) | 2 members | +| [`openpyxl.preserve.drawings`](api-004.md#source-b5b52da8244416c1) | 10 members | +| [`openpyxl.preserve.emit`](api-004.md#source-9a0ac37d05cee3b3) | 7 members | +| [`openpyxl.preserve.hygiene`](api-004.md#source-ed053253dd2df0ca) | 3 members | +| [`openpyxl.preserve.images`](api-004.md#source-8f78b00e05b56f86) | 2 members | +| [`openpyxl.preserve.inventory`](api-004.md#source-870c85169521c44b) | 2 members | +| [`openpyxl.preserve.ledger`](api-004.md#source-09d4a5de9fa61d51) | 19 members | +| [`openpyxl.preserve.lexical`](api-004.md#source-3e5bc57ca6b8e74d) | 1 member | +| [`openpyxl.preserve.lifecycle`](api-004.md#source-e246639f0d4e37ce) | 1 member | +| [`openpyxl.preserve.perception`](api-004.md#source-0e0dcdb8b73e2d74) | 3 members | +| [`openpyxl.preserve.pivots`](api-004.md#source-8a00241b322c2838) | 6 members | +| [`openpyxl.preserve.receipts`](api-004.md#source-5455ecb3da11461a) | 2 members | +| [`openpyxl.preserve.references`](api-004.md#source-7998be0ec1a9ddd2) | 6 members | +| [`openpyxl.preserve.regions`](api-004.md#source-b39469458b878e54) | 14 members | +| [`openpyxl.preserve.rewrite`](api-004.md#source-cd8a1000b07edf45) | 14 members | +| [`openpyxl.preserve.saver`](api-004.md#source-28c2379f22b2a183) | 2 members | +| [`openpyxl.preserve.sourceio`](api-004.md#source-032c362b6f1bfd59) | 1 member | +| [`openpyxl.preserve.splice`](api-004.md#source-b3a3fcc019839696) | 3 members | +| [`openpyxl.preserve.structural`](api-004.md#source-528bc730406df5a1) | 13 members | +| [`openpyxl.preserve.styletrans`](api-004.md#source-3ab6a969b80c3002) | 1 member | +| [`openpyxl.preserve.styleverbs`](api-004.md#source-d70eac76dcc56f47) | 1 member | +| [`openpyxl.preserve.tables`](api-004.md#source-9ee989781cba945e) | 6 members | +| [`openpyxl.preserve.validation`](api-004.md#source-f16fdb7768b8f254) | 1 member | +| [`openpyxl.preserve.x14`](api-004.md#source-d40b85555ab1dd2d) | 3 members | +| [`openpyxl.preserve.xmlscan`](api-004.md#source-62a14a621d09f34c) | 6 members | +| [`openpyxl.preserve.zipguard`](api-004.md#source-60d38bd4d72ced0e) | 3 members | +| [`openpyxl.preserve.zipio`](api-004.md#source-603c612a89a8f6ad) | 13 members | +| [`openpyxl.reader.drawings`](api-004.md#source-ce2037d44bda1ee5) | 1 member | +| [`openpyxl.reader.excel`](api-004.md#source-4a78d3edb09b7a63) | 6 members | +| [`openpyxl.reader.strings`](api-004.md#source-8a0e56e8dd7b39db) | 2 members | +| [`openpyxl.reader.workbook`](api-004.md#source-ef36c94784741be0) | 1 member | +| [`openpyxl.styles.alignment`](api-005.md#source-bb419157f845abfd) | 3 members | +| [`openpyxl.styles.borders`](api-005.md#source-32708b35df8895e8) | 17 members | +| [`openpyxl.styles.builtins`](api-005.md#source-01b61061a0865c64) | 51 members | +| [`openpyxl.styles.cell_style`](api-005.md#source-cb779624a4ba2035) | 4 members | +| [`openpyxl.styles.colors`](api-005.md#source-ecf582ec6b216c54) | 10 members | +| [`openpyxl.styles.differential`](api-005.md#source-d0a0b9a81c7f920a) | 2 members | +| [`openpyxl.styles.fills`](api-005.md#source-b269beb7a0cbde62) | 27 members | +| [`openpyxl.styles.fonts`](api-005.md#source-0df56276100d3084) | 2 members | +| [`openpyxl.styles.named_styles`](api-005.md#source-1530f4a92cb48fe3) | 2 members | +| [`openpyxl.styles.numbers`](api-005.md#source-4d922d768f98118f) | 51 members | +| [`openpyxl.styles.protection`](api-005.md#source-32563683afceebdf) | 1 member | +| [`openpyxl.styles.proxy`](api-005.md#source-615c138ff9f6c642) | 1 member | +| [`openpyxl.styles.styleable`](api-005.md#source-097d17698a55bcb9) | 5 members | +| [`openpyxl.styles.stylesheet`](api-005.md#source-0b1265ac9a41ca09) | 3 members | +| [`openpyxl.styles.table`](api-005.md#source-8f19b77089b2b6b7) | 3 members | +| [`openpyxl.utils.bound_dictionary`](api-005.md#source-95b075ccece20337) | 1 member | +| [`openpyxl.utils.cell`](api-005.md#source-ea51eb6f6d93fbdb) | 18 members | +| [`openpyxl.utils.dataframe`](api-005.md#source-6350c9094247d10b) | 2 members | +| [`openpyxl.utils.datetime`](api-005.md#source-547de2ac2229bb22) | 15 members | +| [`openpyxl.utils.escape`](api-005.md#source-7994116a0686fcac) | 2 members | +| [`openpyxl.utils.exceptions`](api-005.md#source-01383234eb75a671) | 7 members | +| [`openpyxl.utils.formulas`](api-005.md#source-f22095774595c7ac) | 2 members | +| [`openpyxl.utils.indexed_list`](api-005.md#source-564e6c5bc656348c) | 1 member | +| [`openpyxl.utils.inference`](api-005.md#source-7f6e6339eb8ae312) | 6 members | +| [`openpyxl.utils.protection`](api-005.md#source-03f7831570444295) | 1 member | +| [`openpyxl.utils.units`](api-005.md#source-af4027f0eed404ff) | 21 members | +| [`openpyxl.workbook.child`](api-005.md#source-2cab1d49f7874ba4) | 2 members | +| [`openpyxl.workbook.defined_name`](api-005.md#source-cdc8cf267a11c926) | 5 members | +| [`openpyxl.workbook.external_link.external`](api-005.md#source-4ed40eb17098b439) | 9 members | +| [`openpyxl.workbook.external_reference`](api-005.md#source-30b4bbc946d274e4) | 1 member | +| [`openpyxl.workbook.function_group`](api-005.md#source-7dd441243b8117b2) | 2 members | +| [`openpyxl.workbook.properties`](api-005.md#source-f4537b8fcc3a61f4) | 3 members | +| [`openpyxl.workbook.protection`](api-005.md#source-0be0a32ded03ff34) | 3 members | +| [`openpyxl.workbook.smart_tags`](api-005.md#source-63df5fe8310d5f5e) | 3 members | +| [`openpyxl.workbook.views`](api-005.md#source-7454aa0ef9cbfb90) | 2 members | +| [`openpyxl.workbook.web`](api-005.md#source-4ccc69c70b6fee89) | 3 members | +| [`openpyxl.workbook.workbook`](api-005.md#source-30e69ade650d2348) | 3 members | +| [`openpyxl.worksheet.cell_range`](api-005.md#source-80c28a6be1246deb) | 2 members | +| [`openpyxl.worksheet.cell_watch`](api-005.md#source-8ea50312d76405e1) | 2 members | +| [`openpyxl.worksheet.controls`](api-005.md#source-e27859326a006ba1) | 3 members | +| [`openpyxl.worksheet.copier`](api-005.md#source-f67cfb58d7dc95a7) | 1 member | +| [`openpyxl.worksheet.custom`](api-005.md#source-79843bc233bce421) | 2 members | +| [`openpyxl.worksheet.datavalidation`](api-006.md#source-60fe02a730221325) | 4 members | +| [`openpyxl.worksheet.dimensions`](api-006.md#source-cb74d46f5d0698ac) | 6 members | +| [`openpyxl.worksheet.drawing`](api-006.md#source-901659f1034a5916) | 1 member | +| [`openpyxl.worksheet.errors`](api-006.md#source-3f89a953c9c69936) | 4 members | +| [`openpyxl.worksheet.filters`](api-006.md#source-8a8d5d6f529cee72) | 16 members | +| [`openpyxl.worksheet.formula`](api-006.md#source-b99f53736b7d7fa8) | 2 members | +| [`openpyxl.worksheet.header_footer`](api-006.md#source-2a28ccae5527dd47) | 6 members | +| [`openpyxl.worksheet.hyperlink`](api-006.md#source-c737669f74634355) | 2 members | +| [`openpyxl.worksheet.merge`](api-006.md#source-422e6fdff00c6a5a) | 3 members | +| [`openpyxl.worksheet.ole`](api-006.md#source-7e9688432c1ced6d) | 4 members | +| [`openpyxl.worksheet.page`](api-006.md#source-27b45173e10c321f) | 3 members | +| [`openpyxl.worksheet.pagebreak`](api-006.md#source-5dc3bf5a0c561965) | 4 members | +| [`openpyxl.worksheet.picture`](api-006.md#source-59436f848d5c5750) | 1 member | +| [`openpyxl.worksheet.print_settings`](api-006.md#source-6bd75d181077a6b4) | 10 members | +| [`openpyxl.worksheet.properties`](api-006.md#source-ddc15793fa43dafb) | 3 members | +| [`openpyxl.worksheet.protection`](api-006.md#source-116766f8fc6ec106) | 1 member | +| [`openpyxl.worksheet.related`](api-006.md#source-44591a2d435623a4) | 1 member | +| [`openpyxl.worksheet.scenario`](api-006.md#source-5f856bee1ca68795) | 3 members | +| [`openpyxl.worksheet.smart_tag`](api-006.md#source-106360ebbec4849b) | 4 members | +| [`openpyxl.worksheet.table`](api-006.md#source-91b33fcee316b3c2) | 10 members | +| [`openpyxl.worksheet.views`](api-006.md#source-33cbf051ab4acbe8) | 4 members | +| [`openpyxl.worksheet.worksheet`](api-006.md#source-e523255d86018c5c) | 1 member | +| [`openpyxl.writer.excel`](api-006.md#source-b93344bcc8140f4a) | 4 members | +| [`openpyxl.writer.theme`](api-006.md#source-504b64732d5fdb9c) | 2 members | +| [`openpyxl.xml`](api-006.md#source-f0625460739d514a) | 6 members | +| [`openpyxl.xml.constants`](api-006.md#source-b82975613b24944b) | 76 members | +| [`openpyxl.xml.functions`](api-006.md#source-79cb9f8ea9d3a94d) | 7 members | ## `openpyxl.cell.cell` Manage individual cells in a spreadsheet. -Full contract: [cell.cell.md](cell.cell.md) +Full contract: [cell.cell.md](api-001.md#source-5cb78d3146816160) - `Cell` — Describes cell associated properties. - `ERROR_CODES = ('#NULL!', '#DIV/0!', '#VALUE!', '#REF!', '#NAME?', '#NUM!', '#N/A')` @@ -240,7 +242,7 @@ Full contract: [cell.cell.md](cell.cell.md) ## `openpyxl.cell.read_only` -Full contract: [cell.read_only.md](cell.read_only.md) +Full contract: [cell.read_only.md](api-001.md#source-8672d1a977213aa9) - `EMPTY_CELL = EmptyCell()` - `EmptyCell` @@ -250,7 +252,7 @@ Full contract: [cell.read_only.md](cell.read_only.md) RichText definition -Full contract: [cell.rich_text.md](cell.rich_text.md) +Full contract: [cell.rich_text.md](api-001.md#source-8885d3657daf45cb) - `CellRichText` — Represents a rich text string. - `TextBlock` — Represents text string in a specific format @@ -259,7 +261,7 @@ Full contract: [cell.rich_text.md](cell.rich_text.md) Richtext definition -Full contract: [cell.text.md](cell.text.md) +Full contract: [cell.text.md](api-001.md#source-a779fd29ce9aa2c2) - `InlineFont` — Font for inline text because, yes what you need are different objects with the same elements but different constraints. - `PhoneticProperties` @@ -269,7 +271,7 @@ Full contract: [cell.text.md](cell.text.md) ## `openpyxl.chart.area_chart` -Full contract: [chart.area_chart.md](chart.area_chart.md) +Full contract: [chart.area_chart.md](api-001.md#source-258e32d6bebfd951) - `AreaChart` - `AreaChart3D` @@ -277,7 +279,7 @@ Full contract: [chart.area_chart.md](chart.area_chart.md) ## `openpyxl.chart.axis` -Full contract: [chart.axis.md](chart.axis.md) +Full contract: [chart.axis.md](api-001.md#source-6120dcba1c2aef75) - `ChartLines` - `DateAxis` @@ -290,14 +292,14 @@ Full contract: [chart.axis.md](chart.axis.md) ## `openpyxl.chart.bar_chart` -Full contract: [chart.bar_chart.md](chart.bar_chart.md) +Full contract: [chart.bar_chart.md](api-001.md#source-3008a83348d369ae) - `BarChart` - `BarChart3D` ## `openpyxl.chart.bubble_chart` -Full contract: [chart.bubble_chart.md](chart.bubble_chart.md) +Full contract: [chart.bubble_chart.md](api-001.md#source-e90f987e11ed59f5) - `BubbleChart` @@ -305,7 +307,7 @@ Full contract: [chart.bubble_chart.md](chart.bubble_chart.md) Enclosing chart object. The various chart types are actually child objects. -Full contract: [chart.chartspace.md](chart.chartspace.md) +Full contract: [chart.chartspace.md](api-001.md#source-d9f02a516d656167) - `ChartContainer` - `ChartSpace` @@ -316,7 +318,7 @@ Full contract: [chart.chartspace.md](chart.chartspace.md) Collection of utility primitives for charts. -Full contract: [chart.data_source.md](chart.data_source.md) +Full contract: [chart.data_source.md](api-001.md#source-1afb91ee70b2a5ae) - `AxDataSource` - `Level` @@ -334,7 +336,7 @@ Full contract: [chart.data_source.md](chart.data_source.md) ## `openpyxl.chart.descriptors` -Full contract: [chart.descriptors.md](chart.descriptors.md) +Full contract: [chart.descriptors.md](api-001.md#source-7cebe4028eee1a8d) - `NestedGapAmount` - `NestedOverlap` @@ -342,54 +344,54 @@ Full contract: [chart.descriptors.md](chart.descriptors.md) ## `openpyxl.chart.error_bar` -Full contract: [chart.error_bar.md](chart.error_bar.md) +Full contract: [chart.error_bar.md](api-001.md#source-e4f31ac82f0d9f4d) - `ErrorBars` ## `openpyxl.chart.label` -Full contract: [chart.label.md](chart.label.md) +Full contract: [chart.label.md](api-001.md#source-a7431a66e170e5c5) - `DataLabel` - `DataLabelList` ## `openpyxl.chart.layout` -Full contract: [chart.layout.md](chart.layout.md) +Full contract: [chart.layout.md](api-001.md#source-afbaa4a782db3ae8) - `Layout` - `ManualLayout` ## `openpyxl.chart.legend` -Full contract: [chart.legend.md](chart.legend.md) +Full contract: [chart.legend.md](api-001.md#source-552e30d0e0ba7bde) - `Legend` - `LegendEntry` ## `openpyxl.chart.line_chart` -Full contract: [chart.line_chart.md](chart.line_chart.md) +Full contract: [chart.line_chart.md](api-001.md#source-8a1385d0c9a021de) - `LineChart` - `LineChart3D` ## `openpyxl.chart.marker` -Full contract: [chart.marker.md](chart.marker.md) +Full contract: [chart.marker.md](api-001.md#source-931b526d328b84ea) - `DataPoint` - `Marker` ## `openpyxl.chart.picture` -Full contract: [chart.picture.md](chart.picture.md) +Full contract: [chart.picture.md](api-001.md#source-c75f56daca885b18) - `PictureOptions` ## `openpyxl.chart.pie_chart` -Full contract: [chart.pie_chart.md](chart.pie_chart.md) +Full contract: [chart.pie_chart.md](api-001.md#source-298e910e7058aa9e) - `CustomSplit` - `DoughnutChart` @@ -399,28 +401,28 @@ Full contract: [chart.pie_chart.md](chart.pie_chart.md) ## `openpyxl.chart.pivot` -Full contract: [chart.pivot.md](chart.pivot.md) +Full contract: [chart.pivot.md](api-001.md#source-067cc7cab0530213) - `PivotFormat` - `PivotSource` ## `openpyxl.chart.plotarea` -Full contract: [chart.plotarea.md](chart.plotarea.md) +Full contract: [chart.plotarea.md](api-001.md#source-f2f25f2101bd0fe1) - `DataTable` - `PlotArea` ## `openpyxl.chart.print_settings` -Full contract: [chart.print_settings.md](chart.print_settings.md) +Full contract: [chart.print_settings.md](api-001.md#source-3fd8604a72e0eebc) - `PageMargins` — Identical to openpyxl.worksheet.page.Pagemargins but element names are different :-/ - `PrintSettings` ## `openpyxl.chart.radar_chart` -Full contract: [chart.radar_chart.md](chart.radar_chart.md) +Full contract: [chart.radar_chart.md](api-001.md#source-d86b608241e10e4f) - `RadarChart` @@ -428,26 +430,26 @@ Full contract: [chart.radar_chart.md](chart.radar_chart.md) Read a chart -Full contract: [chart.reader.md](chart.reader.md) +Full contract: [chart.reader.md](api-001.md#source-6b257aa8936290a0) - `read_chart(chartspace)` ## `openpyxl.chart.reference` -Full contract: [chart.reference.md](chart.reference.md) +Full contract: [chart.reference.md](api-001.md#source-8f14cf9777fbc564) - `DummyWorksheet` - `Reference` — Normalise cell range references ## `openpyxl.chart.scatter_chart` -Full contract: [chart.scatter_chart.md](chart.scatter_chart.md) +Full contract: [chart.scatter_chart.md](api-001.md#source-99ffa8ed2817df0b) - `ScatterChart` ## `openpyxl.chart.series` -Full contract: [chart.series.md](chart.series.md) +Full contract: [chart.series.md](api-001.md#source-44896c9f83c6778b) - `Series` — Generic series object. Should not be instantiated directly. - `SeriesLabel` @@ -456,25 +458,25 @@ Full contract: [chart.series.md](chart.series.md) ## `openpyxl.chart.series_factory` -Full contract: [chart.series_factory.md](chart.series_factory.md) +Full contract: [chart.series_factory.md](api-001.md#source-82efccc6aff94880) - `SeriesFactory(values, xvalues=None, zvalues=None, title=None, title_from_data=False)` — Convenience Factory for creating chart data series. ## `openpyxl.chart.shapes` -Full contract: [chart.shapes.md](chart.shapes.md) +Full contract: [chart.shapes.md](api-001.md#source-e4ddc67dd2463a1a) - `GraphicalProperties` — Somewhat vaguely 21.2.2.197 says this: ## `openpyxl.chart.stock_chart` -Full contract: [chart.stock_chart.md](chart.stock_chart.md) +Full contract: [chart.stock_chart.md](api-001.md#source-ed46fb9c55ec3014) - `StockChart` ## `openpyxl.chart.surface_chart` -Full contract: [chart.surface_chart.md](chart.surface_chart.md) +Full contract: [chart.surface_chart.md](api-001.md#source-16faa91087af85a4) - `BandFormat` - `BandFormatList` @@ -483,14 +485,14 @@ Full contract: [chart.surface_chart.md](chart.surface_chart.md) ## `openpyxl.chart.text` -Full contract: [chart.text.md](chart.text.md) +Full contract: [chart.text.md](api-001.md#source-e5567e80a68cc4b6) - `RichText` — From the specification: 21.2.2.216 - `Text` — The value can be either a cell reference or a text element ## `openpyxl.chart.title` -Full contract: [chart.title.md](chart.title.md) +Full contract: [chart.title.md](api-001.md#source-2f024211be301528) - `Title` - `TitleDescriptor` @@ -498,72 +500,72 @@ Full contract: [chart.title.md](chart.title.md) ## `openpyxl.chart.trendline` -Full contract: [chart.trendline.md](chart.trendline.md) +Full contract: [chart.trendline.md](api-001.md#source-c9a1721db446df72) - `Trendline` - `TrendlineLabel` ## `openpyxl.chart.updown_bars` -Full contract: [chart.updown_bars.md](chart.updown_bars.md) +Full contract: [chart.updown_bars.md](api-001.md#source-745736fd3b74266b) - `UpDownBars` ## `openpyxl.chartsheet.chartsheet` -Full contract: [chartsheet.chartsheet.md](chartsheet.chartsheet.md) +Full contract: [chartsheet.chartsheet.md](api-001.md#source-d166272b85e48625) - `Chartsheet` ## `openpyxl.chartsheet.custom` -Full contract: [chartsheet.custom.md](chartsheet.custom.md) +Full contract: [chartsheet.custom.md](api-001.md#source-c7c8f9802d73c605) - `CustomChartsheetView` - `CustomChartsheetViews` ## `openpyxl.chartsheet.properties` -Full contract: [chartsheet.properties.md](chartsheet.properties.md) +Full contract: [chartsheet.properties.md](api-001.md#source-d94623c54a296347) - `ChartsheetProperties` ## `openpyxl.chartsheet.protection` -Full contract: [chartsheet.protection.md](chartsheet.protection.md) +Full contract: [chartsheet.protection.md](api-001.md#source-7df72048def6b206) - `ChartsheetProtection` ## `openpyxl.chartsheet.publish` -Full contract: [chartsheet.publish.md](chartsheet.publish.md) +Full contract: [chartsheet.publish.md](api-001.md#source-db86a2352c183ff7) - `WebPublishItem` - `WebPublishItems` ## `openpyxl.chartsheet.relation` -Full contract: [chartsheet.relation.md](chartsheet.relation.md) +Full contract: [chartsheet.relation.md](api-001.md#source-9fc61eda6e40b865) - `DrawingHF` - `SheetBackgroundPicture` ## `openpyxl.chartsheet.views` -Full contract: [chartsheet.views.md](chartsheet.views.md) +Full contract: [chartsheet.views.md](api-001.md#source-8411b79d8bf6d48e) - `ChartsheetView` - `ChartsheetViewList` ## `openpyxl.comments.author` -Full contract: [comments.author.md](comments.author.md) +Full contract: [comments.author.md](api-001.md#source-55e470e6672d4012) - `AuthorList` ## `openpyxl.comments.comment_sheet` -Full contract: [comments.comment_sheet.md](comments.comment_sheet.md) +Full contract: [comments.comment_sheet.md](api-001.md#source-4e331b0792b7a6a1) - `CommentRecord` - `CommentSheet` @@ -571,13 +573,13 @@ Full contract: [comments.comment_sheet.md](comments.comment_sheet.md) ## `openpyxl.comments.comments` -Full contract: [comments.comments.md](comments.comments.md) +Full contract: [comments.comments.md](api-001.md#source-abd1516358f3b68d) - `Comment` ## `openpyxl.comments.shape_writer` -Full contract: [comments.shape_writer.md](comments.shape_writer.md) +Full contract: [comments.shape_writer.md](api-001.md#source-7f33ba3daeaa7ffa) - `ShapeWriter` — Create VML for comments - `excelns = 'urn:schemas-microsoft-com:office:excel'` @@ -586,7 +588,7 @@ Full contract: [comments.shape_writer.md](comments.shape_writer.md) ## `openpyxl.compat` -Full contract: [compat.md](compat.md) +Full contract: [compat.md](api-001.md#source-e2a0f35cc04861d5) - `DummyCode` - `deprecated(reason)` @@ -594,7 +596,7 @@ Full contract: [compat.md](compat.md) ## `openpyxl.compat.numbers` -Full contract: [compat.numbers.md](compat.numbers.md) +Full contract: [compat.numbers.md](api-001.md#source-65bf160b638843a4) - `NUMERIC_TYPES = (int, float, Decimal)` - `NUMPY = True` @@ -603,27 +605,27 @@ Full contract: [compat.numbers.md](compat.numbers.md) math.prod equivalent for < Python 3.8 -Full contract: [compat.product.md](compat.product.md) +Full contract: [compat.product.md](api-001.md#source-a70dc28c373c348c) - `product(sequence)` ## `openpyxl.compat.singleton` -Full contract: [compat.singleton.md](compat.singleton.md) +Full contract: [compat.singleton.md](api-001.md#source-98c364980b9699aa) - `Cached` — Caching metaclass - `Singleton` — Singleton metaclass ## `openpyxl.compat.strings` -Full contract: [compat.strings.md](compat.strings.md) +Full contract: [compat.strings.md](api-001.md#source-ed8afbf50adc09c5) - `VER = sys.version_info` - `safe_string(value)` — Safely and consistently format numeric values ## `openpyxl.descriptors` -Full contract: [descriptors.md](descriptors.md) +Full contract: [descriptors.md](api-002.md#source-2462bbee4eaa3929) - `MetaSerialisable` - `MetaStrict` @@ -633,7 +635,7 @@ Full contract: [descriptors.md](descriptors.md) Based on Python Cookbook 3rd Edition, 8.13 -Full contract: [descriptors.base.md](descriptors.base.md) +Full contract: [descriptors.base.md](api-001.md#source-6b43c571a6ea05c6) - `ASCII` - `Alias` — Aliases can be used when either the desired attribute name is not allowed @@ -661,7 +663,7 @@ Full contract: [descriptors.base.md](descriptors.base.md) Utility list for top level containers that contain one type of element -Full contract: [descriptors.container.md](descriptors.container.md) +Full contract: [descriptors.container.md](api-001.md#source-308b30827e39f61d) - `ElementList` @@ -669,7 +671,7 @@ Full contract: [descriptors.container.md](descriptors.container.md) Excel specific descriptors -Full contract: [descriptors.excel.md](descriptors.excel.md) +Full contract: [descriptors.excel.md](api-001.md#source-dbeb02836be68928) - `Base64Binary` - `CellRange` @@ -685,7 +687,7 @@ Full contract: [descriptors.excel.md](descriptors.excel.md) ## `openpyxl.descriptors.namespace` -Full contract: [descriptors.namespace.md](descriptors.namespace.md) +Full contract: [descriptors.namespace.md](api-002.md#source-2df4afd60937074d) - `namespaced(obj, tagname, namespace=None)` — Utility to create a namespaced tag for an object @@ -693,7 +695,7 @@ Full contract: [descriptors.namespace.md](descriptors.namespace.md) Generic serialisable classes -Full contract: [descriptors.nested.md](descriptors.nested.md) +Full contract: [descriptors.nested.md](api-002.md#source-b470a3ab0e1c8802) - `EmptyTag` — Boolean if a tag exists or not. - `Nested` @@ -709,7 +711,7 @@ Full contract: [descriptors.nested.md](descriptors.nested.md) ## `openpyxl.descriptors.sequence` -Full contract: [descriptors.sequence.md](descriptors.sequence.md) +Full contract: [descriptors.sequence.md](api-002.md#source-48d6ac374d5bce2e) - `MultiSequence` — Sequences can contain objects with different tags - `MultiSequencePart` — Allow a multisequence to be built up from parts @@ -720,7 +722,7 @@ Full contract: [descriptors.sequence.md](descriptors.sequence.md) ## `openpyxl.descriptors.serialisable` -Full contract: [descriptors.serialisable.md](descriptors.serialisable.md) +Full contract: [descriptors.serialisable.md](api-002.md#source-081de7b596bccb94) - `KEYWORDS = frozenset(kwlist)` - `Serialisable` — Objects can serialise to XML their attributes and child objects. @@ -728,13 +730,13 @@ Full contract: [descriptors.serialisable.md](descriptors.serialisable.md) ## `openpyxl.descriptors.slots` -Full contract: [descriptors.slots.md](descriptors.slots.md) +Full contract: [descriptors.slots.md](api-002.md#source-fbf231fb4775d66d) - `AutoSlotProperties` ## `openpyxl.drawing.colors` -Full contract: [drawing.colors.md](drawing.colors.md) +Full contract: [drawing.colors.md](api-002.md#source-f785c9647f984908) - `ColorChoice` - `ColorChoiceDescriptor` — Objects can choose from 7 different kinds of color system. @@ -749,7 +751,7 @@ Full contract: [drawing.colors.md](drawing.colors.md) ## `openpyxl.drawing.connector` -Full contract: [drawing.connector.md](drawing.connector.md) +Full contract: [drawing.connector.md](api-002.md#source-79bb4535bff3ce6b) - `Connection` - `ConnectorLocking` @@ -761,13 +763,13 @@ Full contract: [drawing.connector.md](drawing.connector.md) ## `openpyxl.drawing.drawing` -Full contract: [drawing.drawing.md](drawing.drawing.md) +Full contract: [drawing.drawing.md](api-002.md#source-55305c20677d5aa3) - `Drawing` — a drawing object - eg container for shapes or charts ## `openpyxl.drawing.effect` -Full contract: [drawing.effect.md](drawing.effect.md) +Full contract: [drawing.effect.md](api-002.md#source-008a81aef6823763) - `AlphaBiLevelEffect` - `AlphaCeilingEffect` @@ -798,7 +800,7 @@ Full contract: [drawing.effect.md](drawing.effect.md) ## `openpyxl.drawing.fill` -Full contract: [drawing.fill.md](drawing.fill.md) +Full contract: [drawing.fill.md](api-002.md#source-cdab8e675dda3205) - `Blip` - `BlipFillProperties` @@ -814,7 +816,7 @@ Full contract: [drawing.fill.md](drawing.fill.md) ## `openpyxl.drawing.geometry` -Full contract: [drawing.geometry.md](drawing.geometry.md) +Full contract: [drawing.geometry.md](api-002.md#source-ed8e8f4384197998) - `AdjPoint2D` - `AdjustHandleList` @@ -846,7 +848,7 @@ Full contract: [drawing.geometry.md](drawing.geometry.md) ## `openpyxl.drawing.graphic` -Full contract: [drawing.graphic.md](drawing.graphic.md) +Full contract: [drawing.graphic.md](api-002.md#source-52294417c587c6ba) - `GraphicData` - `GraphicFrame` @@ -858,13 +860,13 @@ Full contract: [drawing.graphic.md](drawing.graphic.md) ## `openpyxl.drawing.image` -Full contract: [drawing.image.md](drawing.image.md) +Full contract: [drawing.image.md](api-002.md#source-d3e546d89a6c739c) - `Image` — Image in a spreadsheet ## `openpyxl.drawing.line` -Full contract: [drawing.line.md](drawing.line.md) +Full contract: [drawing.line.md](api-002.md#source-a082e4bada372f61) - `DashStop` - `DashStopList` @@ -873,7 +875,7 @@ Full contract: [drawing.line.md](drawing.line.md) ## `openpyxl.drawing.picture` -Full contract: [drawing.picture.md](drawing.picture.md) +Full contract: [drawing.picture.md](api-002.md#source-c8c3a03c8b5baf26) - `NonVisualPictureProperties` - `PictureFrame` @@ -882,7 +884,7 @@ Full contract: [drawing.picture.md](drawing.picture.md) ## `openpyxl.drawing.properties` -Full contract: [drawing.properties.md](drawing.properties.md) +Full contract: [drawing.properties.md](api-002.md#source-4a89e525002548f9) - `GroupLocking` - `GroupShapeProperties` @@ -893,13 +895,13 @@ Full contract: [drawing.properties.md](drawing.properties.md) ## `openpyxl.drawing.relation` -Full contract: [drawing.relation.md](drawing.relation.md) +Full contract: [drawing.relation.md](api-002.md#source-0a6acbf4f723b775) - `ChartRelation` ## `openpyxl.drawing.spreadsheet_drawing` -Full contract: [drawing.spreadsheet_drawing.md](drawing.spreadsheet_drawing.md) +Full contract: [drawing.spreadsheet_drawing.md](api-002.md#source-3503ff43445c9604) - `AbsoluteAnchor` - `AnchorClientData` @@ -910,7 +912,7 @@ Full contract: [drawing.spreadsheet_drawing.md](drawing.spreadsheet_drawing.md) ## `openpyxl.drawing.text` -Full contract: [drawing.text.md](drawing.text.md) +Full contract: [drawing.text.md](api-002.md#source-929c5f519b85d44e) - `AutonumberBullet` - `CharacterProperties` @@ -936,7 +938,7 @@ Full contract: [drawing.text.md](drawing.text.md) Spreadsheet Drawing has some copies of Drawing ML elements -Full contract: [drawing.xdr.md](drawing.xdr.md) +Full contract: [drawing.xdr.md](api-002.md#source-f11e9dd9c08d203f) - `XDRPoint2D` - `XDRPositiveSize2D` @@ -946,7 +948,7 @@ Full contract: [drawing.xdr.md](drawing.xdr.md) Typed exceptions for paper-xlsx safety refusals. -Full contract: [errors.md](errors.md) +Full contract: [errors.md](api-002.md#source-412a4d7e688bc7d9) - `AmbiguousTargetError` — The addressed target matches more than one candidate. - `BoundaryViolationError` — The operation would cross a declared boundary (range, sheet, or @@ -961,14 +963,14 @@ Full contract: [errors.md](errors.md) ## `openpyxl.formatting.formatting` -Full contract: [formatting.formatting.md](formatting.formatting.md) +Full contract: [formatting.formatting.md](api-002.md#source-a03877bd6f3ec745) - `ConditionalFormatting` - `ConditionalFormattingList` — Conditional formatting rules. ## `openpyxl.formatting.rule` -Full contract: [formatting.rule.md](formatting.rule.md) +Full contract: [formatting.rule.md](api-002.md#source-0912702f237be935) - `CellIsRule(operator=None, formula=None, stopIfTrue=None, font=None, border=None, fill=None)` — Conditional formatting rule based on cell contents. - `ColorScale` @@ -987,7 +989,7 @@ Full contract: [formatting.rule.md](formatting.rule.md) This module contains a tokenizer for Excel formulae. -Full contract: [formula.tokenizer.md](formula.tokenizer.md) +Full contract: [formula.tokenizer.md](api-002.md#source-47c58ef1a2cd9787) - `EXCEL_ERROR_CODES = ('#NULL!', '#DIV/0!', '#VALUE!', '#REF!', '#NAME?', '#NUM!', '#N/A', '#SPILL!', '#CALC!', '#FIELD!', '#BLOCKED!', '#UNKNOWN!', '#CONNECT!', '#BUSY!', '#PYTHON!', '#GETTING_DATA')` - `Token` — A token in an Excel formula. @@ -998,7 +1000,7 @@ Full contract: [formula.tokenizer.md](formula.tokenizer.md) This module contains code to translate formulae across cells in a worksheet. -Full contract: [formula.translate.md](formula.translate.md) +Full contract: [formula.translate.md](api-002.md#source-d375fa42a478a201) - `Translator` — Modifies a formula so that it can be translated from one cell to another. - `TranslatorError` — Raised when a formula can't be translated across cells. @@ -1009,7 +1011,7 @@ Bounded recalculation and certification via headless LibreOffice. **Not available here: LibreOffice is not installed. Do not call anything in this section.** -Full contract: [oracle.md](oracle.md) +Full contract: [oracle.md](api-003.md#source-ebde9fced8d61f90) - `CertificationResult` - `DATE_SERIAL_ABS_FLOOR = 1e-11` @@ -1030,7 +1032,7 @@ Full contract: [oracle.md](oracle.md) Package-level perception: semantic XML comparison and part-by-part -Full contract: [package.md](package.md) +Full contract: [package.md](api-003.md#source-200a6283165cf51d) - `CellsDiff` - `PackageDiff` — Part-by-part diff of two OOXML packages. @@ -1044,14 +1046,14 @@ Full contract: [package.md](package.md) ``diff_cells(a, b)``: which cells changed between two workbooks, as -Full contract: [package.cells.md](package.cells.md) +Full contract: [package.cells.md](api-003.md#source-ddf84a6b15b5516a) - `CellsDiff` - `diff_cells(a, b)` — Cell-level semantic diff of two packages (paths, bytes, or binary ## `openpyxl.package.diff` -Full contract: [package.diff.md](package.diff.md) +Full contract: [package.diff.md](api-003.md#source-7a8d187cd50ffd35) - `PackageDiff` — Part-by-part diff of two OOXML packages. - `PartChange` — One changed part in a package diff. @@ -1061,7 +1063,7 @@ Full contract: [package.diff.md](package.diff.md) ## `openpyxl.packaging.core` -Full contract: [packaging.core.md](packaging.core.md) +Full contract: [packaging.core.md](api-003.md#source-e4be8124af7b1145) - `DocumentProperties` — High-level properties of the document. - `NestedDateTime` @@ -1071,7 +1073,7 @@ Full contract: [packaging.core.md](packaging.core.md) Implementation of custom properties see § 22.3 in the specification -Full contract: [packaging.custom.md](packaging.custom.md) +Full contract: [packaging.custom.md](api-003.md#source-1c9347e95cfa1b38) - `BoolProperty` - `CLASS_MAPPING = {StringProperty: 'lpwstr', IntProperty: 'i4', FloatProperty: 'r8', DateTimeProperty: 'filetime', BoolProperty: 'bool', LinkProperty: 'linkTarget'}` @@ -1086,7 +1088,7 @@ Full contract: [packaging.custom.md](packaging.custom.md) ## `openpyxl.packaging.extended` -Full contract: [packaging.extended.md](packaging.extended.md) +Full contract: [packaging.extended.md](api-003.md#source-2ab99e664c59be34) - `DigSigBlob` - `ExtendedProperties` — See 22.2 @@ -1095,7 +1097,7 @@ Full contract: [packaging.extended.md](packaging.extended.md) ## `openpyxl.packaging.interface` -Full contract: [packaging.interface.md](packaging.interface.md) +Full contract: [packaging.interface.md](api-003.md#source-7c2d5135e8714d7f) - `ISerialisableFile` — Interface for Serialisable classes that represent files in the archive @@ -1103,7 +1105,7 @@ Full contract: [packaging.interface.md](packaging.interface.md) File manifest -Full contract: [packaging.manifest.md](packaging.manifest.md) +Full contract: [packaging.manifest.md](api-003.md#source-7be05c5195852bae) - `DEFAULT_OVERRIDE = [Override('/' + ARC_STYLE, STYLES_TYPE), Override('/' + ARC_THEME, THEME_TYPE), Override('/docProps/core.xml', 'application/vnd.openxmlformats-package.core-properties+xml'), Override('/docProps/app.xml', 'application/vnd.openxmlformats-officedocument.extended-properties+xml')]` - `DEFAULT_TYPES = [FileExtension('rels', 'application/vnd.openxmlformats-package.relationships+xml'), FileExtension('xml', 'application/xml')]` @@ -1114,7 +1116,7 @@ Full contract: [packaging.manifest.md](packaging.manifest.md) ## `openpyxl.packaging.relationship` -Full contract: [packaging.relationship.md](packaging.relationship.md) +Full contract: [packaging.relationship.md](api-003.md#source-742f592e72c0a181) - `Relationship` — Represents many kinds of relationships. - `RelationshipList` @@ -1124,7 +1126,7 @@ Full contract: [packaging.relationship.md](packaging.relationship.md) ## `openpyxl.packaging.workbook` -Full contract: [packaging.workbook.md](packaging.workbook.md) +Full contract: [packaging.workbook.md](api-003.md#source-013a0f423868189c) - `ChildSheet` — Represents a reference to a worksheet or chartsheet in workbook.xml - `FileRecoveryProperties` @@ -1133,7 +1135,7 @@ Full contract: [packaging.workbook.md](packaging.workbook.md) ## `openpyxl.pivot.cache` -Full contract: [pivot.cache.md](pivot.cache.md) +Full contract: [pivot.cache.md](api-004.md#source-941ae8248b588306) - `CacheDefinition` - `CacheField` @@ -1165,7 +1167,7 @@ Full contract: [pivot.cache.md](pivot.cache.md) ## `openpyxl.pivot.fields` -Full contract: [pivot.fields.md](pivot.fields.md) +Full contract: [pivot.fields.md](api-004.md#source-3cf0f0af742e40e4) - `Boolean` - `DateTimeField` @@ -1179,14 +1181,14 @@ Full contract: [pivot.fields.md](pivot.fields.md) ## `openpyxl.pivot.record` -Full contract: [pivot.record.md](pivot.record.md) +Full contract: [pivot.record.md](api-004.md#source-c029de0a44922d18) - `Record` - `RecordList` ## `openpyxl.pivot.table` -Full contract: [pivot.table.md](pivot.table.md) +Full contract: [pivot.table.md](api-004.md#source-20844e186f19a8eb) - `AutoSortScope` - `ChartFormat` @@ -1217,14 +1219,14 @@ Full contract: [pivot.table.md](pivot.table.md) Preserve mode: the original package is the source of truth; the object -Full contract: [preserve.md](preserve.md) +Full contract: [preserve.md](api-004.md#source-a322204280c7237d) ## `openpyxl.preserve.chartpatch` Targeted patches of series references inside PRESERVED chart parts, and -Full contract: [preserve.chartpatch.md](preserve.chartpatch.md) +Full contract: [preserve.chartpatch.md](api-004.md#source-d9953f8ae9473b20) - `CHART_NS = b'http://schemas.openxmlformats.org/drawingml/2006/chart'` - `DRAWING_MAIN_NS = b'http://schemas.openxmlformats.org/drawingml/2006/main'` @@ -1241,7 +1243,7 @@ Full contract: [preserve.chartpatch.md](preserve.chartpatch.md) Comments on sheets whose original package carries NO comment machinery — -Full contract: [preserve.comments.md](preserve.comments.md) +Full contract: [preserve.comments.md](api-004.md#source-d967888f51029fae) - `COMMENTS_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml'` - `VML_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.vmlDrawing'` @@ -1254,7 +1256,7 @@ Full contract: [preserve.comments.md](preserve.comments.md) Cross-check the splice output against the ledger's claims. -Full contract: [preserve.crosscheck.md](preserve.crosscheck.md) +Full contract: [preserve.crosscheck.md](api-004.md#source-0cbd9d1b33825bab) - `LedgerCrossCheckError` — The splice changed cells the ledger never recorded. - `verify_splice(source_bytes, output_bytes, dirty_by_part, baselines=None, region_claims=None, row_claims=None)` — Assert that in every spliced part, the set of semantically changed @@ -1263,7 +1265,7 @@ Full contract: [preserve.crosscheck.md](preserve.crosscheck.md) Targeted edits to non-worksheet parts under preserve mode. -Full contract: [preserve.crosspart.md](preserve.crosspart.md) +Full contract: [preserve.crosspart.md](api-004.md#source-3e11e9868cabfe3a) - `CT_STYLESHEET_INDEX = {tag: i for i, tag in enumerate(CT_STYLESHEET_ORDER)}` - `CT_STYLESHEET_ORDER = ['numFmts', 'fonts', 'fills', 'borders', 'cellStyleXfs', 'cellXfs', 'cellStyles', 'dxfs', 'tableStyles', 'colors', 'extLst']` @@ -1288,7 +1290,7 @@ Full contract: [preserve.crosspart.md](preserve.crosspart.md) Compare two workbook packages cell-wise, classifying differences as -Full contract: [preserve.diffreport.md](preserve.diffreport.md) +Full contract: [preserve.diffreport.md](api-004.md#source-f7cd2750fd55a935) - `DiffReport` - `diff_workbooks(a, b, remaps=())` — A cell-level report of how package ``b`` differs from ``a`` @@ -1297,7 +1299,7 @@ Full contract: [preserve.diffreport.md](preserve.diffreport.md) Charts and images added in-session become NEW drawing/chart/media parts -Full contract: [preserve.drawings.md](preserve.drawings.md) +Full contract: [preserve.drawings.md](api-004.md#source-b5b52da8244416c1) - `CHART_CT = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'` - `CHART_REL_TYPE = REL_NS + '/chart'` @@ -1314,7 +1316,7 @@ Full contract: [preserve.drawings.md](preserve.drawings.md) Serialize single cells and rows from the model as bare fragments ready to -Full contract: [preserve.emit.md](preserve.emit.md) +Full contract: [preserve.emit.md](api-004.md#source-9a0ac37d05cee3b3) - `carry_attributes(new_cell_bytes, original_cell_bytes, drop_metadata=False)` — Attribute-carry rule: re-attach every original cell attribute - `carry_start_tag_attributes(new_fragment, original_fragment, skip=())` @@ -1328,7 +1330,7 @@ Full contract: [preserve.emit.md](preserve.emit.md) Report cached error values and broken formula references. -Full contract: [preserve.hygiene.md](preserve.hygiene.md) +Full contract: [preserve.hygiene.md](api-004.md#source-ed053253dd2df0ca) - `ERROR_TOKENS = frozenset(EXCEL_ERROR_CODES)` - `current_titles_by_part(wb, zin)` — Map worksheet part names to current live titles. @@ -1338,7 +1340,7 @@ Full contract: [preserve.hygiene.md](preserve.hygiene.md) Replace one drawing relationship without rewriting the drawing. -Full contract: [preserve.images.md](preserve.images.md) +Full contract: [preserve.images.md](api-004.md#source-8f78b00e05b56f86) - `plan_replacements(zin, requests, part_plan, names, plan)` — Add replacement media parts and retarget their relationships. - `request_replacement(ws, target, replacement, *, name=None)` — Validate and record one relationship-owned image replacement. @@ -1347,7 +1349,7 @@ Full contract: [preserve.images.md](preserve.images.md) Scan a source archive for content the stock save path cannot preserve. -Full contract: [preserve.inventory.md](preserve.inventory.md) +Full contract: [preserve.inventory.md](api-004.md#source-870c85169521c44b) - `LossInventory` — What a stock save would rebuild lossily or drop, as - `scan_archive(archive, valid_files, keep_vba=False, rich_text=False)` — Build a `LossInventory` from an open source ZipFile. @@ -1356,7 +1358,7 @@ Full contract: [preserve.inventory.md](preserve.inventory.md) Records what the object model changed, so the splice save can apply -Full contract: [preserve.ledger.md](preserve.ledger.md) +Full contract: [preserve.ledger.md](api-004.md#source-09d4a5de9fa61d51) - `DirtyLedger` - `allow_sheet_removal(wb, ws)` — Removing a sheet ADDED in this session is a net no-op and allowed; @@ -1382,7 +1384,7 @@ Full contract: [preserve.ledger.md](preserve.ledger.md) Patch modeled XML changes without reserializing unchanged syntax. -Full contract: [preserve.lexical.md](preserve.lexical.md) +Full contract: [preserve.lexical.md](api-004.md#source-3e5bc57ca6b8e74d) - `patch_xml(original, baseline, current, expected_root)` — Return ``original`` with only model-observed lexical deltas applied. @@ -1390,7 +1392,7 @@ Full contract: [preserve.lexical.md](preserve.lexical.md) One primitive, both directions: every part a save creates or deletes -Full contract: [preserve.lifecycle.md](preserve.lifecycle.md) +Full contract: [preserve.lifecycle.md](api-004.md#source-e246639f0d4e37ce) - `PartPlan` — Adds/removals of whole parts for one save, with their content-type @@ -1398,7 +1400,7 @@ Full contract: [preserve.lifecycle.md](preserve.lifecycle.md) Coarse formula-dependency analysis used by model maps and shift guards. -Full contract: [preserve.perception.md](preserve.perception.md) +Full contract: [preserve.perception.md](api-004.md#source-0e0dcdb8b73e2d74) - `DependencySketch` — Coarse formula-dependency map: which cells feed which. - `VOLATILE_NONDETERMINISTIC = ('NOW', 'TODAY', 'RAND', 'RANDBETWEEN', 'RANDARRAY', 'CELL', 'INFO')` @@ -1408,7 +1410,7 @@ Full contract: [preserve.perception.md](preserve.perception.md) Resolve pivot names and patch only cache refresh metadata. -Full contract: [preserve.pivots.md](preserve.pivots.md) +Full contract: [preserve.pivots.md](api-004.md#source-8a00241b322c2838) - `parts_referencing_sheet(wb, sheet_title)` — Return local pivot-cache parts that may depend on one worksheet. - `plan_refresh(zin, parts, plan)` — Add pivot refresh requests to a package byte plan. @@ -1421,7 +1423,7 @@ Full contract: [preserve.pivots.md](preserve.pivots.md) One artifact answering "what did that save actually do?": cells-diff -Full contract: [preserve.receipts.md](preserve.receipts.md) +Full contract: [preserve.receipts.md](api-004.md#source-5455ecb3da11461a) - `EditReceipt` - `receipt(before, after, *, recalc=None, _ledger=None, _workbook=None)` — Build an `EditReceipt` from two package states (paths, @@ -1430,7 +1432,7 @@ Full contract: [preserve.receipts.md](preserve.receipts.md) Modeled reference surfaces shared by structural edits and renames. -Full contract: [preserve.references.md](preserve.references.md) +Full contract: [preserve.references.md](api-004.md#source-7998be0ec1a9ddd2) - `FormulaSurface` — A formula-like string with enough context to rewrite it safely. - `apply_rewrites(rewrites)` @@ -1443,7 +1445,7 @@ Full contract: [preserve.references.md](preserve.references.md) Fully-modeled worksheet satellite elements: faithful serialization, -Full contract: [preserve.regions.md](preserve.regions.md) +Full contract: [preserve.regions.md](api-004.md#source-b39469458b878e54) - `CT_ORDER_INDEX = {tag: i for i, tag in enumerate(CT_WORKSHEET_ORDER)}` - `CT_WORKSHEET_ORDER = ['sheetPr', 'dimension', 'sheetViews', 'sheetFormatPr', 'cols', 'sheetData', 'sheetCalcPr', 'sheetProtection', 'protectedRanges', 'scenarios', 'autoFilter', 'sortState', 'dataConsolidate', 'customSheetViews', 'mergeCells', 'phoneticPr', 'conditionalFormatting', 'dataValidations', 'hyperlinks', 'printOptions', 'pageMargins', 'pageSetup', 'headerFooter', 'rowBreaks', 'colBreaks', 'customProperties', 'cellWatches', 'ignoredErrors', 'smartTags', 'drawing', 'legacyDrawing', 'legacyDrawingHF', 'picture', 'oleObjects', 'controls', 'webPublishItems', 'tableParts', 'extLst']` @@ -1464,7 +1466,7 @@ Full contract: [preserve.regions.md](preserve.regions.md) Rewrite references for row/column inserts and deletes the way EXCEL -Full contract: [preserve.rewrite.md](preserve.rewrite.md) +Full contract: [preserve.rewrite.md](api-004.md#source-cd8a1000b07edf45) - `EXCEL_MAX_COL = 16384` - `EXCEL_MAX_ROW = 1048576` @@ -1485,7 +1487,7 @@ Full contract: [preserve.rewrite.md](preserve.rewrite.md) Save dispatch target for preserve-mode workbooks. -Full contract: [preserve.saver.md](preserve.saver.md) +Full contract: [preserve.saver.md](api-004.md#source-28c2379f22b2a183) - `save_preserved(workbook, target, *, allow_formula_loss=False)` — Plan and deliver without retaining serializer side effects. - `validate_preserved(workbook, *, allow_formula_loss=False)` — Run the exact preserve save planner without assembling an archive. @@ -1494,7 +1496,7 @@ Full contract: [preserve.saver.md](preserve.saver.md) Read package sources without imposing workbook eligibility caps. -Full contract: [preserve.sourceio.md](preserve.sourceio.md) +Full contract: [preserve.sourceio.md](api-004.md#source-032c362b6f1bfd59) - `read_source_bytes(source, *, context='workbook package')` — Read package bytes while preserving a seekable stream's position. @@ -1502,7 +1504,7 @@ Full contract: [preserve.sourceio.md](preserve.sourceio.md) Apply ledger-recorded edits to one original worksheet part, byte-wise. -Full contract: [preserve.splice.md](preserve.splice.md) +Full contract: [preserve.splice.md](api-004.md#source-b3a3fcc019839696) - `SpliceRefusal` - `resolve_dirty_cells(ws, ledger_dirty, scan, value_overwrites=frozenset())` — The effective dirty-coordinate set for one sheet. @@ -1512,7 +1514,7 @@ Full contract: [preserve.splice.md](preserve.splice.md) Analyze what a row/column shift would strand. -Full contract: [preserve.structural.md](preserve.structural.md) +Full contract: [preserve.structural.md](api-004.md#source-528bc730406df5a1) - `AddressRemap` — How one structural edit moved addresses: - `EXCEL_MAX_COL = 16384` @@ -1532,7 +1534,7 @@ Full contract: [preserve.structural.md](preserve.structural.md) Translate the model's style indices into the ORIGINAL file's xf indices. -Full contract: [preserve.styletrans.md](preserve.styletrans.md) +Full contract: [preserve.styletrans.md](api-004.md#source-3ab6a969b80c3002) - `StyleTranslator` @@ -1540,7 +1542,7 @@ Full contract: [preserve.styletrans.md](preserve.styletrans.md) Small preserve-aware helpers for explicit formatting operations. -Full contract: [preserve.styleverbs.md](preserve.styleverbs.md) +Full contract: [preserve.styleverbs.md](api-004.md#source-d70eac76dcc56f47) - `copy_format(ws, src_cell, dst_range)` — Atomically copy one cell's complete cell style onto a finite range. @@ -1548,7 +1550,7 @@ Full contract: [preserve.styleverbs.md](preserve.styleverbs.md) Loaded-table mutation, and the table row discipline. -Full contract: [preserve.tables.md](preserve.tables.md) +Full contract: [preserve.tables.md](api-004.md#source-9ee989781cba945e) - `TABLE_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml'` - `append_table_row(ws, table_name, values)` — Atomically append one row to a supported named worksheet table. @@ -1561,7 +1563,7 @@ Full contract: [preserve.tables.md](preserve.tables.md) Read deterministic list data-validation values for a worksheet cell. -Full contract: [preserve.validation.md](preserve.validation.md) +Full contract: [preserve.validation.md](api-004.md#source-f16fdb7768b8f254) - `allowed_values(ws, cell)` — Return deterministic list-validation values covering ``cell``. @@ -1569,7 +1571,7 @@ Full contract: [preserve.validation.md](preserve.validation.md) Conditional-formatting edits on sheets whose rules carry x14 twins. -Full contract: [preserve.x14.md](preserve.x14.md) +Full contract: [preserve.x14.md](api-004.md#source-d40b85555ab1dd2d) - `check_dv_coexistence(ws, scan, original)` — Refuse only when a classic DV range intersects an x14 DV range — - `plan_cf_composed(wb, ws, scan, original, armed_blocks)` — (classic_cf_replacement_bytes, extlst_replacement_or_None). @@ -1579,7 +1581,7 @@ Full contract: [preserve.x14.md](preserve.x14.md) Namespace-tracking streaming scanner over ORIGINAL worksheet XML bytes. -Full contract: [preserve.xmlscan.md](preserve.xmlscan.md) +Full contract: [preserve.xmlscan.md](api-004.md#source-62a14a621d09f34c) - `CellSpan` - `RegionSpan` @@ -1590,7 +1592,7 @@ Full contract: [preserve.xmlscan.md](preserve.xmlscan.md) ## `openpyxl.preserve.zipguard` -Full contract: [preserve.zipguard.md](preserve.zipguard.md) +Full contract: [preserve.zipguard.md](api-004.md#source-60d38bd4d72ced0e) - `LargeZipFile = zipfile.LargeZipFile` - `validate_archive(archive, *, context='preserve-mode package')` — Validate one ZIP before any workbook model is constructed. @@ -1600,7 +1602,7 @@ Full contract: [preserve.zipguard.md](preserve.zipguard.md) Zip-layer machinery for the preserve-mode save. -Full contract: [preserve.zipio.md](preserve.zipio.md) +Full contract: [preserve.zipio.md](api-004.md#source-603c612a89a8f6ad) - `FIXED_DATE_TIME = (1980, 1, 1, 0, 0, 0)` - `PathIdentity` — Content-bound identity of one pathname and its resolved occupant. @@ -1618,7 +1620,7 @@ Full contract: [preserve.zipio.md](preserve.zipio.md) ## `openpyxl.reader.drawings` -Full contract: [reader.drawings.md](reader.drawings.md) +Full contract: [reader.drawings.md](api-004.md#source-ce2037d44bda1ee5) - `find_images(archive, path)` — Given the path to a drawing file extract charts and images @@ -1626,7 +1628,7 @@ Full contract: [reader.drawings.md](reader.drawings.md) Read an xlsx file into Python -Full contract: [reader.excel.md](reader.excel.md) +Full contract: [reader.excel.md](api-004.md#source-4a78d3edb09b7a63) - `ExcelReader` — Read an Excel package and dispatch the contents to the relevant modules - `KEEP_VBA = os.environ.get('OPENPYXL_KEEP_VBA', 'False') == 'True'` @@ -1637,20 +1639,20 @@ Full contract: [reader.excel.md](reader.excel.md) ## `openpyxl.reader.strings` -Full contract: [reader.strings.md](reader.strings.md) +Full contract: [reader.strings.md](api-004.md#source-8a0e56e8dd7b39db) - `read_rich_text(xml_source)` — Read in all shared strings in the table - `read_string_table(xml_source)` — Read in all shared strings in the table ## `openpyxl.reader.workbook` -Full contract: [reader.workbook.md](reader.workbook.md) +Full contract: [reader.workbook.md](api-004.md#source-ef36c94784741be0) - `WorkbookParser` ## `openpyxl.styles.alignment` -Full contract: [styles.alignment.md](styles.alignment.md) +Full contract: [styles.alignment.md](api-005.md#source-bb419157f845abfd) - `Alignment` — Alignment options for use in styles. - `horizontal_alignments = ('general', 'left', 'center', 'right', 'fill', 'justify', 'centerContinuous', 'distributed')` @@ -1658,7 +1660,7 @@ Full contract: [styles.alignment.md](styles.alignment.md) ## `openpyxl.styles.borders` -Full contract: [styles.borders.md](styles.borders.md) +Full contract: [styles.borders.md](api-005.md#source-32708b35df8895e8) - `BORDER_DASHDOT = 'dashDot'` - `BORDER_DASHDOTDOT = 'dashDotDot'` @@ -1680,7 +1682,7 @@ Full contract: [styles.borders.md](styles.borders.md) ## `openpyxl.styles.builtins` -Full contract: [styles.builtins.md](styles.builtins.md) +Full contract: [styles.builtins.md](api-005.md#source-01b61061a0865c64) - `accent_1 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'` - `accent_1_20 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'` @@ -1736,7 +1738,7 @@ Full contract: [styles.builtins.md](styles.builtins.md) ## `openpyxl.styles.cell_style` -Full contract: [styles.cell_style.md](styles.cell_style.md) +Full contract: [styles.cell_style.md](api-005.md#source-cb779624a4ba2035) - `ArrayDescriptor` - `CellStyle` @@ -1745,7 +1747,7 @@ Full contract: [styles.cell_style.md](styles.cell_style.md) ## `openpyxl.styles.colors` -Full contract: [styles.colors.md](styles.colors.md) +Full contract: [styles.colors.md](api-005.md#source-ecf582ec6b216c54) - `BLACK = COLOR_INDEX[0]` - `BLUE = COLOR_INDEX[4]` @@ -1760,14 +1762,14 @@ Full contract: [styles.colors.md](styles.colors.md) ## `openpyxl.styles.differential` -Full contract: [styles.differential.md](styles.differential.md) +Full contract: [styles.differential.md](api-005.md#source-d0a0b9a81c7f920a) - `DifferentialStyle` - `DifferentialStyleList` — Dedupable container for differential styles. ## `openpyxl.styles.fills` -Full contract: [styles.fills.md](styles.fills.md) +Full contract: [styles.fills.md](api-005.md#source-b269beb7a0cbde62) - `DEFAULT_EMPTY_FILL = PatternFill()` - `DEFAULT_GRAY_FILL = PatternFill(patternType='gray125')` @@ -1799,21 +1801,21 @@ Full contract: [styles.fills.md](styles.fills.md) ## `openpyxl.styles.fonts` -Full contract: [styles.fonts.md](styles.fonts.md) +Full contract: [styles.fonts.md](api-005.md#source-0df56276100d3084) - `DEFAULT_FONT = Font(name='Calibri', sz=11, family=2, b=False, i=False, color=Color(theme=1), scheme='minor')` - `Font` — Font options used in styles. ## `openpyxl.styles.named_styles` -Full contract: [styles.named_styles.md](styles.named_styles.md) +Full contract: [styles.named_styles.md](api-005.md#source-1530f4a92cb48fe3) - `NamedStyle` — Named and editable styles - `NamedStyleList` — Named styles are editable and can be applied to multiple objects ## `openpyxl.styles.numbers` -Full contract: [styles.numbers.md](styles.numbers.md) +Full contract: [styles.numbers.md](api-005.md#source-4d922d768f98118f) - `BUILTIN_FORMATS = {0: 'General', 1: '0', 2: '0.00', 3: '#,##0', 4: '#,##0.00', 5: '"$"#,##0_);("$"#,##0)', 6: '"$"#,##0_);[Red]("$"#,##0)', 7: '"$"#,##0.00_);("$"#,##0.00)', 8: '"$"#,##0.00_);[Red]("$"#,##0.00)', 9: '0%', 10: '0.00%', 11: '0.00E+00', 12: '# ?/?', 13: '# ??/??', 14: 'mm-dd-yy', 15: 'd-mmm-yy', 16: 'd-mmm', 17: 'mmm-yy', 18: 'h:mm AM/PM', 19: 'h:mm:ss AM/PM', 20: 'h:mm', 21: 'h:mm:ss', 22: 'm/d/yy h:mm', 37: '#,##0_);(#,##0)', 38: '#,##0_);[Red](#,##0)', 39: '#,##0.00_);(#,##0.00)', 40: '#,##0.00_);[Red](#,##0.00)', 41: '_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)', 42: '_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)', 43: '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)', 44: '_("$"* #,##0.00_)_("$"* \\(#,##0.00\\)_("$"* "-"??_)_(@_)', 45: 'mm:ss', 46: '[h]:mm:ss', 47: 'mmss.0', 48: '##0.0E+0', 49: '@'}` - `BUILTIN_FORMATS_MAX_SIZE = 164` @@ -1869,19 +1871,19 @@ Full contract: [styles.numbers.md](styles.numbers.md) ## `openpyxl.styles.protection` -Full contract: [styles.protection.md](styles.protection.md) +Full contract: [styles.protection.md](api-005.md#source-32563683afceebdf) - `Protection` — Protection options for use in styles. ## `openpyxl.styles.proxy` -Full contract: [styles.proxy.md](styles.proxy.md) +Full contract: [styles.proxy.md](api-005.md#source-615c138ff9f6c642) - `StyleProxy` — Proxy formatting objects so that they cannot be altered ## `openpyxl.styles.styleable` -Full contract: [styles.styleable.md](styles.styleable.md) +Full contract: [styles.styleable.md](api-005.md#source-097d17698a55bcb9) - `NamedStyleDescriptor` - `NumberFormatDescriptor` @@ -1891,7 +1893,7 @@ Full contract: [styles.styleable.md](styles.styleable.md) ## `openpyxl.styles.stylesheet` -Full contract: [styles.stylesheet.md](styles.stylesheet.md) +Full contract: [styles.stylesheet.md](api-005.md#source-0b1265ac9a41ca09) - `Stylesheet` - `apply_stylesheet(archive, wb)` — Add styles to workbook if present @@ -1899,7 +1901,7 @@ Full contract: [styles.stylesheet.md](styles.stylesheet.md) ## `openpyxl.styles.table` -Full contract: [styles.table.md](styles.table.md) +Full contract: [styles.table.md](api-005.md#source-8f19b77089b2b6b7) - `TableStyle` - `TableStyleElement` @@ -1907,7 +1909,7 @@ Full contract: [styles.table.md](styles.table.md) ## `openpyxl.utils.bound_dictionary` -Full contract: [utils.bound_dictionary.md](utils.bound_dictionary.md) +Full contract: [utils.bound_dictionary.md](api-005.md#source-95b075ccece20337) - `BoundDictionary` — A default dictionary where elements are tightly coupled. @@ -1915,7 +1917,7 @@ Full contract: [utils.bound_dictionary.md](utils.bound_dictionary.md) Collection of utilities used within the package and also available for client code -Full contract: [utils.cell.md](utils.cell.md) +Full contract: [utils.cell.md](api-005.md#source-ea51eb6f6d93fbdb) - `ABSOLUTE_RE = re.compile('^' + RANGE_EXPR + '$', re.VERBOSE)` - `COL_RANGE = '[A-Z]{1,3}:[A-Z]{1,3}:'` @@ -1938,7 +1940,7 @@ Full contract: [utils.cell.md](utils.cell.md) ## `openpyxl.utils.dataframe` -Full contract: [utils.dataframe.md](utils.dataframe.md) +Full contract: [utils.dataframe.md](api-005.md#source-6350c9094247d10b) - `dataframe_to_rows(df, index=True, header=True)` — Convert a Pandas dataframe into something suitable for passing into a worksheet. - `expand_index(index, header=False)` — Expand axis or column Multiindex @@ -1947,7 +1949,7 @@ Full contract: [utils.dataframe.md](utils.dataframe.md) Manage Excel date weirdness. -Full contract: [utils.datetime.md](utils.datetime.md) +Full contract: [utils.datetime.md](api-005.md#source-547de2ac2229bb22) - `CALENDAR_MAC_1904 = MAC_EPOCH` - `CALENDAR_WINDOWS_1900 = WINDOWS_EPOCH` @@ -1969,7 +1971,7 @@ Full contract: [utils.datetime.md](utils.datetime.md) OOXML has non-standard escaping for characters <  -Full contract: [utils.escape.md](utils.escape.md) +Full contract: [utils.escape.md](api-005.md#source-7994116a0686fcac) - `escape(value)` — Convert ASCII < 31 to OOXML: \n == _x + hex(ord(\n)) + _ - `unescape(value)` — Convert escaped strings to ASCIII: _x000a_ == \n @@ -1978,7 +1980,7 @@ Full contract: [utils.escape.md](utils.escape.md) Definitions for openpyxl shared exception classes. -Full contract: [utils.exceptions.md](utils.exceptions.md) +Full contract: [utils.exceptions.md](api-005.md#source-01383234eb75a671) - `CellCoordinatesException` — Error for converting between numeric and A1-style cell references. - `IllegalCharacterError` — The data submitted which cannot be used directly in Excel files. It @@ -1992,14 +1994,14 @@ Full contract: [utils.exceptions.md](utils.exceptions.md) List of builtin formulae -Full contract: [utils.formulas.md](utils.formulas.md) +Full contract: [utils.formulas.md](api-005.md#source-f22095774595c7ac) - `FORMULAE = frozenset(FORMULAE)` - `validate(formula)` — Utility function for checking whether a formula is syntactically correct ## `openpyxl.utils.indexed_list` -Full contract: [utils.indexed_list.md](utils.indexed_list.md) +Full contract: [utils.indexed_list.md](api-005.md#source-564e6c5bc656348c) - `IndexedList` — List with optimised access by value @@ -2007,7 +2009,7 @@ Full contract: [utils.indexed_list.md](utils.indexed_list.md) Type inference functions -Full contract: [utils.inference.md](utils.inference.md) +Full contract: [utils.inference.md](api-005.md#source-7f6e6339eb8ae312) - `NUMBER_REGEX = re.compile('^-?([\\d]|[\\d]+\\.[\\d]*|\\.[\\d]+|[1-9][\\d]+\\.?[\\d]*)((E|e)[-+]?[\\d]+)?$')` - `PERCENT_REGEX = re.compile('^(?P\\-?[0-9]*\\.?[0-9]*\\s?)\\%$')` @@ -2018,13 +2020,13 @@ Full contract: [utils.inference.md](utils.inference.md) ## `openpyxl.utils.protection` -Full contract: [utils.protection.md](utils.protection.md) +Full contract: [utils.protection.md](api-005.md#source-03f7831570444295) - `hash_password(plaintext_password='')` — Create a password hash from a given string for protecting a worksheet ## `openpyxl.utils.units` -Full contract: [utils.units.md](utils.units.md) +Full contract: [utils.units.md](api-005.md#source-af4027f0eed404ff) - `BASE_COL_WIDTH = 8` - `DEFAULT_COLUMN_WIDTH = BASE_COL_WIDTH + 5` @@ -2050,14 +2052,14 @@ Full contract: [utils.units.md](utils.units.md) ## `openpyxl.workbook.child` -Full contract: [workbook.child.md](workbook.child.md) +Full contract: [workbook.child.md](api-005.md#source-2cab1d49f7874ba4) - `INVALID_TITLE_REGEX = re.compile('[\\\\*?:/\\[\\]]')` - `avoid_duplicate_name(names, value)` — Naive check to see whether name already exists. ## `openpyxl.workbook.defined_name` -Full contract: [workbook.defined_name.md](workbook.defined_name.md) +Full contract: [workbook.defined_name.md](api-005.md#source-cdc8cf267a11c926) - `DefinedName` - `DefinedNameDict` — Utility class for storing defined names. @@ -2067,7 +2069,7 @@ Full contract: [workbook.defined_name.md](workbook.defined_name.md) ## `openpyxl.workbook.external_link.external` -Full contract: [workbook.external_link.external.md](workbook.external_link.external.md) +Full contract: [workbook.external_link.external.md](api-005.md#source-4ed40eb17098b439) - `ExternalBook` - `ExternalCell` @@ -2081,20 +2083,20 @@ Full contract: [workbook.external_link.external.md](workbook.external_link.exter ## `openpyxl.workbook.external_reference` -Full contract: [workbook.external_reference.md](workbook.external_reference.md) +Full contract: [workbook.external_reference.md](api-005.md#source-30b4bbc946d274e4) - `ExternalReference` ## `openpyxl.workbook.function_group` -Full contract: [workbook.function_group.md](workbook.function_group.md) +Full contract: [workbook.function_group.md](api-005.md#source-7dd441243b8117b2) - `FunctionGroup` - `FunctionGroupList` ## `openpyxl.workbook.properties` -Full contract: [workbook.properties.md](workbook.properties.md) +Full contract: [workbook.properties.md](api-005.md#source-f4537b8fcc3a61f4) - `CalcProperties` - `FileVersion` @@ -2102,7 +2104,7 @@ Full contract: [workbook.properties.md](workbook.properties.md) ## `openpyxl.workbook.protection` -Full contract: [workbook.protection.md](workbook.protection.md) +Full contract: [workbook.protection.md](api-005.md#source-0be0a32ded03ff34) - `DocumentSecurity = WorkbookProtection` - `FileSharing` @@ -2110,7 +2112,7 @@ Full contract: [workbook.protection.md](workbook.protection.md) ## `openpyxl.workbook.smart_tags` -Full contract: [workbook.smart_tags.md](workbook.smart_tags.md) +Full contract: [workbook.smart_tags.md](api-005.md#source-63df5fe8310d5f5e) - `SmartTag` - `SmartTagList` @@ -2118,14 +2120,14 @@ Full contract: [workbook.smart_tags.md](workbook.smart_tags.md) ## `openpyxl.workbook.views` -Full contract: [workbook.views.md](workbook.views.md) +Full contract: [workbook.views.md](api-005.md#source-7454aa0ef9cbfb90) - `BookView` - `CustomWorkbookView` ## `openpyxl.workbook.web` -Full contract: [workbook.web.md](workbook.web.md) +Full contract: [workbook.web.md](api-005.md#source-4ccc69c70b6fee89) - `WebPublishObject` - `WebPublishObjectList` @@ -2135,7 +2137,7 @@ Full contract: [workbook.web.md](workbook.web.md) Workbook is the top-level container for all document information. -Full contract: [workbook.workbook.md](workbook.workbook.md) +Full contract: [workbook.workbook.md](api-005.md#source-30e69ade650d2348) - `INTEGER_TYPES = (int,)` - `Workbook` — Workbook is the container for all other parts of the document. @@ -2143,21 +2145,21 @@ Full contract: [workbook.workbook.md](workbook.workbook.md) ## `openpyxl.worksheet.cell_range` -Full contract: [worksheet.cell_range.md](worksheet.cell_range.md) +Full contract: [worksheet.cell_range.md](api-005.md#source-80c28a6be1246deb) - `CellRange` — Represents a range in a sheet: title and coordinates. - `MultiCellRange` ## `openpyxl.worksheet.cell_watch` -Full contract: [worksheet.cell_watch.md](worksheet.cell_watch.md) +Full contract: [worksheet.cell_watch.md](api-005.md#source-8ea50312d76405e1) - `CellWatch` - `CellWatches` ## `openpyxl.worksheet.controls` -Full contract: [worksheet.controls.md](worksheet.controls.md) +Full contract: [worksheet.controls.md](api-005.md#source-e27859326a006ba1) - `Control` - `ControlProperty` @@ -2165,20 +2167,20 @@ Full contract: [worksheet.controls.md](worksheet.controls.md) ## `openpyxl.worksheet.copier` -Full contract: [worksheet.copier.md](worksheet.copier.md) +Full contract: [worksheet.copier.md](api-005.md#source-f67cfb58d7dc95a7) - `WorksheetCopy` — Copy the values, styles, dimensions, merged cells, margins, and ## `openpyxl.worksheet.custom` -Full contract: [worksheet.custom.md](worksheet.custom.md) +Full contract: [worksheet.custom.md](api-005.md#source-79843bc233bce421) - `CustomProperties` - `CustomProperty` ## `openpyxl.worksheet.datavalidation` -Full contract: [worksheet.datavalidation.md](worksheet.datavalidation.md) +Full contract: [worksheet.datavalidation.md](api-006.md#source-60fe02a730221325) - `DataValidation` - `DataValidationList` @@ -2187,7 +2189,7 @@ Full contract: [worksheet.datavalidation.md](worksheet.datavalidation.md) ## `openpyxl.worksheet.dimensions` -Full contract: [worksheet.dimensions.md](worksheet.dimensions.md) +Full contract: [worksheet.dimensions.md](api-006.md#source-cb74d46f5d0698ac) - `ColumnDimension` — Information about the display properties of a column. - `Dimension` — Information about the display properties of a row or column. @@ -2198,13 +2200,13 @@ Full contract: [worksheet.dimensions.md](worksheet.dimensions.md) ## `openpyxl.worksheet.drawing` -Full contract: [worksheet.drawing.md](worksheet.drawing.md) +Full contract: [worksheet.drawing.md](api-006.md#source-901659f1034a5916) - `Drawing` ## `openpyxl.worksheet.errors` -Full contract: [worksheet.errors.md](worksheet.errors.md) +Full contract: [worksheet.errors.md](api-006.md#source-3f89a953c9c69936) - `Extension` - `ExtensionList` @@ -2213,7 +2215,7 @@ Full contract: [worksheet.errors.md](worksheet.errors.md) ## `openpyxl.worksheet.filters` -Full contract: [worksheet.filters.md](worksheet.filters.md) +Full contract: [worksheet.filters.md](api-006.md#source-8a8d5d6f529cee72) - `AutoFilter` - `BlankFilter` — Exclude blanks @@ -2234,14 +2236,14 @@ Full contract: [worksheet.filters.md](worksheet.filters.md) ## `openpyxl.worksheet.formula` -Full contract: [worksheet.formula.md](worksheet.formula.md) +Full contract: [worksheet.formula.md](api-006.md#source-b99f53736b7d7fa8) - `ArrayFormula` - `DataTableFormula` ## `openpyxl.worksheet.header_footer` -Full contract: [worksheet.header_footer.md](worksheet.header_footer.md) +Full contract: [worksheet.header_footer.md](api-006.md#source-2a28ccae5527dd47) - `COLOR_PATTERN = '&K(?P[A-F0-9]{6})'` - `FONT_PATTERN = '&"(?P.+)"'` @@ -2252,14 +2254,14 @@ Full contract: [worksheet.header_footer.md](worksheet.header_footer.md) ## `openpyxl.worksheet.hyperlink` -Full contract: [worksheet.hyperlink.md](worksheet.hyperlink.md) +Full contract: [worksheet.hyperlink.md](api-006.md#source-c737669f74634355) - `Hyperlink` - `HyperlinkList` ## `openpyxl.worksheet.merge` -Full contract: [worksheet.merge.md](worksheet.merge.md) +Full contract: [worksheet.merge.md](api-006.md#source-422e6fdff00c6a5a) - `MergeCell` - `MergeCells` @@ -2267,7 +2269,7 @@ Full contract: [worksheet.merge.md](worksheet.merge.md) ## `openpyxl.worksheet.ole` -Full contract: [worksheet.ole.md](worksheet.ole.md) +Full contract: [worksheet.ole.md](api-006.md#source-7e9688432c1ced6d) - `ObjectAnchor` - `ObjectPr` @@ -2276,7 +2278,7 @@ Full contract: [worksheet.ole.md](worksheet.ole.md) ## `openpyxl.worksheet.page` -Full contract: [worksheet.page.md](worksheet.page.md) +Full contract: [worksheet.page.md](api-006.md#source-27b45173e10c321f) - `PageMargins` — Information about page margins for view/print layouts. - `PrintOptions` — Worksheet print options @@ -2284,7 +2286,7 @@ Full contract: [worksheet.page.md](worksheet.page.md) ## `openpyxl.worksheet.pagebreak` -Full contract: [worksheet.pagebreak.md](worksheet.pagebreak.md) +Full contract: [worksheet.pagebreak.md](api-006.md#source-5dc3bf5a0c561965) - `Break` - `ColBreak` @@ -2293,13 +2295,13 @@ Full contract: [worksheet.pagebreak.md](worksheet.pagebreak.md) ## `openpyxl.worksheet.picture` -Full contract: [worksheet.picture.md](worksheet.picture.md) +Full contract: [worksheet.picture.md](api-006.md#source-59436f848d5c5750) - `SheetBackgroundPicture` ## `openpyxl.worksheet.print_settings` -Full contract: [worksheet.print_settings.md](worksheet.print_settings.md) +Full contract: [worksheet.print_settings.md](api-006.md#source-6bd75d181077a6b4) - `COL_RANGE = '(?P[$]?(?P[a-zA-Z]{1,3}):[$]?(?P[a-zA-Z]{1,3}))'` - `COL_RANGE_RE = re.compile(COL_RANGE)` @@ -2316,7 +2318,7 @@ Full contract: [worksheet.print_settings.md](worksheet.print_settings.md) Worksheet Properties -Full contract: [worksheet.properties.md](worksheet.properties.md) +Full contract: [worksheet.properties.md](api-006.md#source-ddc15793fa43dafb) - `Outline` - `PageSetupProperties` @@ -2324,19 +2326,19 @@ Full contract: [worksheet.properties.md](worksheet.properties.md) ## `openpyxl.worksheet.protection` -Full contract: [worksheet.protection.md](worksheet.protection.md) +Full contract: [worksheet.protection.md](api-006.md#source-116766f8fc6ec106) - `SheetProtection` — Information about protection of various aspects of a sheet. True values ## `openpyxl.worksheet.related` -Full contract: [worksheet.related.md](worksheet.related.md) +Full contract: [worksheet.related.md](api-006.md#source-44591a2d435623a4) - `Related` ## `openpyxl.worksheet.scenario` -Full contract: [worksheet.scenario.md](worksheet.scenario.md) +Full contract: [worksheet.scenario.md](api-006.md#source-5f856bee1ca68795) - `InputCells` - `Scenario` @@ -2344,7 +2346,7 @@ Full contract: [worksheet.scenario.md](worksheet.scenario.md) ## `openpyxl.worksheet.smart_tag` -Full contract: [worksheet.smart_tag.md](worksheet.smart_tag.md) +Full contract: [worksheet.smart_tag.md](api-006.md#source-106360ebbec4849b) - `CellSmartTag` - `CellSmartTagPr` @@ -2353,7 +2355,7 @@ Full contract: [worksheet.smart_tag.md](worksheet.smart_tag.md) ## `openpyxl.worksheet.table` -Full contract: [worksheet.table.md](worksheet.table.md) +Full contract: [worksheet.table.md](api-006.md#source-91b33fcee316b3c2) - `PIVOTSTYLES = tuple(['PivotStyleMedium{0}'.format(i) for i in range(1, 29)] + ['PivotStyleLight{0}'.format(i) for i in range(1, 29)] + ['PivotStyleDark{0}'.format(i) for i in range(1, 29)])` - `TABLESTYLES = tuple(['TableStyleMedium{0}'.format(i) for i in range(1, 29)] + ['TableStyleLight{0}'.format(i) for i in range(1, 22)] + ['TableStyleDark{0}'.format(i) for i in range(1, 12)])` @@ -2368,7 +2370,7 @@ Full contract: [worksheet.table.md](worksheet.table.md) ## `openpyxl.worksheet.views` -Full contract: [worksheet.views.md](worksheet.views.md) +Full contract: [worksheet.views.md](api-006.md#source-33cbf051ab4acbe8) - `Pane` - `Selection` @@ -2379,13 +2381,13 @@ Full contract: [worksheet.views.md](worksheet.views.md) Worksheet is the 2nd-level container in Excel. -Full contract: [worksheet.worksheet.md](worksheet.worksheet.md) +Full contract: [worksheet.worksheet.md](api-006.md#source-e523255d86018c5c) - `Worksheet` — Represents a worksheet. ## `openpyxl.writer.excel` -Full contract: [writer.excel.md](writer.excel.md) +Full contract: [writer.excel.md](api-006.md#source-b93344bcc8140f4a) - `ExcelWriter` — Write a workbook object to an Excel file. - `WorkbookWriter` @@ -2396,7 +2398,7 @@ Full contract: [writer.excel.md](writer.excel.md) Write the theme xml based on a fixed string. -Full contract: [writer.theme.md](writer.theme.md) +Full contract: [writer.theme.md](api-006.md#source-504b64732d5fdb9c) - `theme_xml = '\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n'` - `write_theme()` — Write the theme xml. @@ -2405,7 +2407,7 @@ Full contract: [writer.theme.md](writer.theme.md) Collection of XML resources compatible across different Python versions -Full contract: [xml.md](xml.md) +Full contract: [xml.md](api-006.md#source-f0625460739d514a) - `DEFUSEDXML = defusedxml_available() and defusedxml_env_set()` - `LXML = lxml_available() and lxml_env_set()` @@ -2418,7 +2420,7 @@ Full contract: [xml.md](xml.md) Constants for fixed paths in a file and xml namespace urls. -Full contract: [xml.constants.md](xml.constants.md) +Full contract: [xml.constants.md](api-006.md#source-b82975613b24944b) - `ACTIVEX = 'application/vnd.ms-office.activeX+xml'` - `ARC_APP = PACKAGE_PROPS + '/app.xml'` @@ -2501,7 +2503,7 @@ Full contract: [xml.constants.md](xml.constants.md) XML compatibility functions -Full contract: [xml.functions.md](xml.functions.md) +Full contract: [xml.functions.md](api-006.md#source-79cb9f8ea9d3a94d) - `DEFUSEDXML = defusedxml_available() and defusedxml_env_set()` - `LXML = lxml_available() and lxml_env_set()` @@ -2510,3 +2512,1980 @@ Full contract: [xml.functions.md](xml.functions.md) - `safe_parser = XMLParser(resolve_entities=False)` - `tostring = partial(tostring, encoding='utf-8')` - `whitespace(node)` + + + + + +# `openpyxl.oracle` + +Bounded recalculation and certification via headless LibreOffice. + +**Not available here: LibreOffice is not installed. Do not call anything on this page.** + +## `CertificationResult` + +```python +CertificationResult(status, checked, divergences, volatile_excluded, unverifiable, external_excluded = None, unsupported_excluded = None, input_excluded = None, artifact_sha256 = None) +``` + +### `BASELINE_UNVERIFIABLE` + +```python +BASELINE_UNVERIFIABLE = 'BASELINE_UNVERIFIABLE' +``` + +### `CERTIFIED` + +```python +CERTIFIED = 'CERTIFIED' +``` + +### `DIVERGED` + +```python +DIVERGED = 'DIVERGED' +``` + +### `SCHEMA` + +```python +SCHEMA = 'oracle_certification' +``` + +### `VERSION` + +```python +VERSION = 1 +``` + +### `artifact_sha256` + +```python +artifact_sha256 = artifact_sha256 +``` + +### `checked` + +```python +checked = checked +``` + +### `classify_tolerance` + +```python +classify_tolerance(*, abs_tol = None, rel_tol = None) +``` + +Classify recorded strict divergences under a numeric tolerance. + +Strict matches are not re-evaluated, so this cannot impose a policy +narrower than Paper's strict comparator. The classification does not +alter `status` or establish complete coverage. Formula errors, +nonnumeric mismatches, and non-finite values always remain outside. + +**Returns:** + +- `openpyxl.oracle.NumericalToleranceResult` – A measurement-only classification of the recorded strict +divergences. + +### `divergences` + +```python +divergences = divergences +``` + +### `external_excluded` + +```python +external_excluded = external_excluded or [] +``` + +### `input_excluded` + +```python +input_excluded = input_excluded or [] +``` + +### `status` + +```python +status = status +``` + +### `to_dict` + +```python +to_dict() +``` + +### `unsupported_excluded` + +```python +unsupported_excluded = unsupported_excluded or [] +``` + +### `unverifiable` + +```python +unverifiable = unverifiable +``` + +### `volatile_excluded` + +```python +volatile_excluded = volatile_excluded +``` + +## `DATE_SERIAL_ABS_FLOOR` + +```python +DATE_SERIAL_ABS_FLOOR = 1e-11 +``` + +## `ERROR_TOKENS` + +```python +ERROR_TOKENS = frozenset(EXCEL_ERROR_CODES) +``` + +## `Evaluation` + +```python +Evaluation(inputs, outputs, errors, certification, artifact_sha256 = None) +``` + +One what-if run: inputs applied to a TEMP COPY through the spine, +LibreOffice recalculated, outputs harvested. Pinned surface. + +### `FORMULA_ERRORS_DETECTED` + +```python +FORMULA_ERRORS_DETECTED = 'FORMULA_ERRORS_DETECTED' +``` + +### `NO_DETECTED_FORMULA_ERRORS` + +```python +NO_DETECTED_FORMULA_ERRORS = 'NO_DETECTED_FORMULA_ERRORS' +``` + +### `SCHEMA` + +```python +SCHEMA = 'evaluation' +``` + +### `VERSION` + +```python +VERSION = 2 +``` + +### `artifact_sha256` + +```python +artifact_sha256 = artifact_sha256 +``` + +### `certification` + +```python +certification = certification +``` + +### `error_cells` + +```python +error_cells +``` + +### `errors` + +```python +errors = errors +``` + +### `inputs` + +```python +inputs = inputs +``` + +### `outputs` + +```python +outputs = outputs +``` + +### `status` + +```python +status +``` + +### `to_dict` + +```python +to_dict() +``` + +## `NUMERIC_ULPS` + +```python +NUMERIC_ULPS = 4 +``` + +## `NumericalToleranceResult` + +```python +NumericalToleranceResult(strict_status, coverage_complete, absolute_tolerance, relative_tolerance, within_tolerance, outside_tolerance) +``` + +Measurement-only classification of strict numeric divergences. + +`strict_status` remains the original certification result. Coverage and +tolerance buckets are reported separately; this object never replaces or +weakens strict certification. + +### `SCHEMA` + +```python +SCHEMA = 'oracle_numerical_tolerance' +``` + +### `VERSION` + +```python +VERSION = 1 +``` + +### `absolute_tolerance` + +```python +absolute_tolerance = absolute_tolerance +``` + +### `all_divergences_within_tolerance` + +```python +all_divergences_within_tolerance = None if not within_tolerance and not outside_tolerance else not outside_tolerance +``` + +### `coverage_complete` + +```python +coverage_complete = coverage_complete +``` + +### `outside_tolerance` + +```python +outside_tolerance = outside_tolerance +``` + +### `relative_tolerance` + +```python +relative_tolerance = relative_tolerance +``` + +### `strict_status` + +```python +strict_status = strict_status +``` + +### `to_dict` + +```python +to_dict() +``` + +### `within_tolerance` + +```python +within_tolerance = within_tolerance +``` + +## `ORACLE_UNSUPPORTED_FUNCS` + +```python +ORACLE_UNSUPPORTED_FUNCS = frozenset(['LAMBDA', 'LET', 'MAP', 'REDUCE', 'SCAN', 'BYROW', 'BYCOL', 'MAKEARRAY', 'ISOMITTED', 'STOCKHISTORY', 'RTD', 'WEBSERVICE', 'FILTERXML', 'IMAGE', 'PY', 'CUBEVALUE', 'CUBEMEMBER', 'CUBESET', 'CUBESETCOUNT', 'CUBERANKEDMEMBER', 'CUBEMEMBERPROPERTY', 'CUBEKPIMEMBER']) +``` + +## `RecalcResult` + +```python +RecalcResult(cells_scanned, formula_cells, errors, *, output_kind = None, written = None, verified_unchanged = None, excluded = None, package_diff = None, pivot_refreshes = None, artifact_sha256 = None, calculation_artifact_sha256 = None) +``` + +### `FORMULA_ERRORS_DETECTED` + +```python +FORMULA_ERRORS_DETECTED = 'FORMULA_ERRORS_DETECTED' +``` + +### `NO_DETECTED_FORMULA_ERRORS` + +```python +NO_DETECTED_FORMULA_ERRORS = 'NO_DETECTED_FORMULA_ERRORS' +``` + +### `SCHEMA` + +```python +SCHEMA = 'oracle_recalc' +``` + +### `VERSION` + +```python +VERSION = 2 +``` + +### `artifact_sha256` + +```python +artifact_sha256 = artifact_sha256 +``` + +### `calculation_artifact_sha256` + +```python +calculation_artifact_sha256 = calculation_artifact_sha256 +``` + +### `cells_scanned` + +```python +cells_scanned = cells_scanned +``` + +### `cells_written` + +```python +cells_written +``` + +Return the number of formula caches written to the candidate. + +**Returns:** + +- `int` – Number of entries in `written`. + +### `engine` + +```python +engine = 'libreoffice' +``` + +### `errors` + +```python +errors = errors +``` + +### `excluded` + +```python +excluded = dict(excluded or {}) +``` + +### `formula_cells` + +```python +formula_cells = formula_cells +``` + +### `output_kind` + +```python +output_kind = output_kind +``` + +### `package_diff` + +```python +package_diff = list(package_diff or ()) +``` + +### `pivot_refreshes` + +```python +pivot_refreshes = list(pivot_refreshes or ()) +``` + +### `status` + +```python +status +``` + +### `to_dict` + +```python +to_dict() +``` + +### `verified_unchanged` + +```python +verified_unchanged = list(verified_unchanged or ()) +``` + +### `written` + +```python +written = list(written or ()) +``` + +## `available` + +```python +available() +``` + +True when a LibreOffice installation can be found. + +## `certify` + +```python +certify(source, *, timeout = 120.0) +``` + +The divergence check: does LibreOffice reproduce the file's own +cached values? Pre-flights on an untouched temp copy; the caller's file +is never modified. Returns measurements, never judgments. + +## `evaluate` + +```python +evaluate(source, set, read, *, timeout = 120.0) +``` + +Scenario run against ``source`` (path/bytes/file-like): apply +``set`` inputs to a temp copy through the preserve spine, recalculate +with LibreOffice, harvest ``read`` outputs. The source and every +caller file stay untouched. One LibreOffice run serves both the +outputs and the certification (original caches vs computed, with +inputs' downstream cells excluded as ``input_excluded``). + +## `evaluate_many` + +```python +evaluate_many(source, cases, read, *, pool_size = 2, timeout = 120.0) +``` + +``evaluate`` for a list of input dicts, sharing warm LibreOffice +profiles across cases (the pool is an implementation +detail — ``pool_size`` per-thread-isolated profiles, created lazily, +crash-replaced once, destroyed before return). + +## `find_soffice` + +```python +find_soffice() +``` + +Locate the LibreOffice binary, or None. + +## `recalc` + +```python +recalc(source, *, output_path = None, timeout = 120.0) +``` + +Recalculate a temporary copy with LibreOffice. + +With no ``output_path``, return error-scan evidence and write nothing. +With a separate ``output_path``, build a Paper-preserved candidate by +splicing eligible calculated caches into the original package structure. +If those writes or the requested full recalculation can affect a local +pivot source, the candidate requests refresh-on-open and +``RecalcResult.pivot_refreshes`` reports the Excel refresh requirement. +LibreOffice's rewritten package is never delivered, and the result makes +no claim of Excel equivalence or financial correctness. + + + + + +# `openpyxl.package.cells` + +``diff_cells(a, b)``: which cells changed between two workbooks, as + +## `CellsDiff` + +```python +CellsDiff(changes, sheets_added, sheets_removed) +``` + +### `SCHEMA` + +```python +SCHEMA = 'cells_diff' +``` + +### `VERSION` + +```python +VERSION = 1 +``` + +### `changes` + +```python +changes = changes +``` + +### `clean` + +```python +clean +``` + +### `sheets_added` + +```python +sheets_added = sheets_added +``` + +### `sheets_removed` + +```python +sheets_removed = sheets_removed +``` + +### `to_dict` + +```python +to_dict() +``` + +## `diff_cells` + +```python +diff_cells(a, b) +``` + +Cell-level semantic diff of two packages (paths, bytes, or binary +file-likes). Deterministic order: sheet, then row, then column. + + + + + +# `openpyxl.package.diff` + +## `PackageDiff` + +```python +PackageDiff(added, removed, changed, identical, equivalent) +``` + +Part-by-part diff of two OOXML packages. + +XML parts are compared semantically; binary parts by size and SHA-256. +``identical`` counts parts whose payloads are byte-identical (a stricter +condition than semantic equivalence; byte-identical XML parts are never +parsed at all). + +### `SCHEMA` + +```python +SCHEMA = 'package_diff' +``` + +### `VERSION` + +```python +VERSION = 1 +``` + +### `added` + +```python +added = sorted(added) +``` + +### `changed` + +```python +changed = sorted(changed, key=lambda c: c.part) +``` + +### `clean` + +```python +clean +``` + +No parts added, removed, or semantically changed. + +### `equivalent` + +```python +equivalent = sorted(equivalent) +``` + +### `identical` + +```python +identical = sorted(identical) +``` + +### `removed` + +```python +removed = sorted(removed) +``` + +### `to_dict` + +```python +to_dict() +``` + +## `PartChange` + +```python +PartChange(part, kind, detail) +``` + +One changed part in a package diff. + +### `detail` + +```python +detail = detail +``` + +### `kind` + +```python +kind = kind +``` + +### `part` + +```python +part = part +``` + +### `to_dict` + +```python +to_dict() +``` + +## `diff_package` + +```python +diff_package(a, b, max_detail = 25) +``` + +Diff two packages (paths, bytes, or binary file-likes) part by part. + +## `xml_equivalent` + +```python +xml_equivalent(a, b) +``` + +True when two XML payloads are semantically equivalent. + +Never normalizes cell text content. + +## `xml_semantic_diff` + +```python +xml_semantic_diff(a, b, max_diffs = 25) +``` + +Semantic differences between two XML payloads (paths/bytes/file-likes). + +Compared: element structure, Clark-qualified tags (namespace *prefixes* +are insignificant), attributes (order-insensitive), and text content — +which is never normalized. Returns a list of human-readable differences, +empty when equivalent. + + + + + +# `openpyxl.package` + +Package-level perception: semantic XML comparison and part-by-part + +## `CellsDiff` + +```python +CellsDiff(changes, sheets_added, sheets_removed) +``` + +### `SCHEMA` + +```python +SCHEMA = 'cells_diff' +``` + +### `VERSION` + +```python +VERSION = 1 +``` + +### `changes` + +```python +changes = changes +``` + +### `clean` + +```python +clean +``` + +### `sheets_added` + +```python +sheets_added = sheets_added +``` + +### `sheets_removed` + +```python +sheets_removed = sheets_removed +``` + +### `to_dict` + +```python +to_dict() +``` + +## `PackageDiff` + +```python +PackageDiff(added, removed, changed, identical, equivalent) +``` + +Part-by-part diff of two OOXML packages. + +XML parts are compared semantically; binary parts by size and SHA-256. +``identical`` counts parts whose payloads are byte-identical (a stricter +condition than semantic equivalence; byte-identical XML parts are never +parsed at all). + +### `SCHEMA` + +```python +SCHEMA = 'package_diff' +``` + +### `VERSION` + +```python +VERSION = 1 +``` + +### `added` + +```python +added = sorted(added) +``` + +### `changed` + +```python +changed = sorted(changed, key=lambda c: c.part) +``` + +### `clean` + +```python +clean +``` + +No parts added, removed, or semantically changed. + +### `equivalent` + +```python +equivalent = sorted(equivalent) +``` + +### `identical` + +```python +identical = sorted(identical) +``` + +### `removed` + +```python +removed = sorted(removed) +``` + +### `to_dict` + +```python +to_dict() +``` + +## `PartChange` + +```python +PartChange(part, kind, detail) +``` + +One changed part in a package diff. + +### `detail` + +```python +detail = detail +``` + +### `kind` + +```python +kind = kind +``` + +### `part` + +```python +part = part +``` + +### `to_dict` + +```python +to_dict() +``` + +## `diff_cells` + +```python +diff_cells(a, b) +``` + +Cell-level semantic diff of two packages (paths, bytes, or binary +file-likes). Deterministic order: sheet, then row, then column. + +## `diff_package` + +```python +diff_package(a, b, max_detail = 25) +``` + +Diff two packages (paths, bytes, or binary file-likes) part by part. + +## `xml_equivalent` + +```python +xml_equivalent(a, b) +``` + +True when two XML payloads are semantically equivalent. + +Never normalizes cell text content. + +## `xml_semantic_diff` + +```python +xml_semantic_diff(a, b, max_diffs = 25) +``` + +Semantic differences between two XML payloads (paths/bytes/file-likes). + +Compared: element structure, Clark-qualified tags (namespace *prefixes* +are insignificant), attributes (order-insensitive), and text content — +which is never normalized. Returns a list of human-readable differences, +empty when equivalent. + + + + + +# `openpyxl.packaging.core` + +## `DocumentProperties` + +```python +DocumentProperties(category = None, contentStatus = None, keywords = None, lastModifiedBy = None, lastPrinted = None, revision = None, version = None, created = None, creator = 'openpyxl', description = None, identifier = None, language = None, modified = None, subject = None, title = None) +``` + +Bases: `Serialisable` + +High-level properties of the document. +Defined in ECMA-376 Par2 Annex D + +### `category` + +```python +category = category +``` + +### `contentStatus` + +```python +contentStatus = contentStatus +``` + +### `created` + +```python +created = created or now +``` + +### `creator` + +```python +creator = creator +``` + +### `description` + +```python +description = description +``` + +### `identifier` + +```python +identifier = identifier +``` + +### `keywords` + +```python +keywords = keywords +``` + +### `language` + +```python +language = language +``` + +### `lastModifiedBy` + +```python +lastModifiedBy = lastModifiedBy +``` + +### `lastPrinted` + +```python +lastPrinted = lastPrinted +``` + +### `last_modified_by` + +```python +last_modified_by = Alias('lastModifiedBy') +``` + +### `modified` + +```python +modified = modified or now +``` + +### `namespace` + +```python +namespace = COREPROPS_NS +``` + +### `revision` + +```python +revision = revision +``` + +### `subject` + +```python +subject = subject +``` + +### `tagname` + +```python +tagname = 'coreProperties' +``` + +### `title` + +```python +title = title +``` + +### `version` + +```python +version = version +``` + +## `NestedDateTime` + +Bases: `DateTime`, `NestedText` + +### `expected_type` + +```python +expected_type = datetime.datetime +``` + +### `to_tree` + +```python +to_tree(tagname = None, value = None, namespace = None) +``` + +## `QualifiedDateTime` + +Bases: `NestedDateTime` + +In certain situations Excel will complain if the additional type +attribute isn't set + +### `to_tree` + +```python +to_tree(tagname = None, value = None, namespace = None) +``` + + + + + +# `openpyxl.packaging.custom` + +Implementation of custom properties see § 22.3 in the specification + +## `BoolProperty` + +Bases: `_TypedProperty` + +### `value` + +```python +value = Bool() +``` + +## `CLASS_MAPPING` + +```python +CLASS_MAPPING = {StringProperty: 'lpwstr', IntProperty: 'i4', FloatProperty: 'r8', DateTimeProperty: 'filetime', BoolProperty: 'bool', LinkProperty: 'linkTarget'} +``` + +## `CustomPropertyList` + +```python +CustomPropertyList() +``` + +Bases: `Strict` + +### `append` + +```python +append(prop) +``` + +### `from_tree` + +```python +from_tree(tree) +``` + +Create list from OOXML element + +### `names` + +```python +names +``` + +List of property names + +### `props` + +```python +props = [] +``` + +### `to_tree` + +```python +to_tree() +``` + +## `DateTimeProperty` + +Bases: `_TypedProperty` + +### `value` + +```python +value = DateTime() +``` + +## `FloatProperty` + +Bases: `_TypedProperty` + +### `value` + +```python +value = Float() +``` + +## `IntProperty` + +Bases: `_TypedProperty` + +### `value` + +```python +value = Integer() +``` + +## `LinkProperty` + +Bases: `_TypedProperty` + +### `value` + +```python +value = String() +``` + +## `NestedBoolText` + +Bases: `Bool`, `NestedText` + +Descriptor for handling nested elements with the value stored in the text part + +## `StringProperty` + +Bases: `_TypedProperty` + +### `value` + +```python +value = String(allow_none=True) +``` + +## `XML_MAPPING` + +```python +XML_MAPPING = {v: k for k, v in CLASS_MAPPING.items()} +``` + + + + + +# `openpyxl.packaging.extended` + +## `DigSigBlob` + +Bases: `Serialisable` + +## `ExtendedProperties` + +```python +ExtendedProperties(Template = None, Manager = None, Company = None, Pages = None, Words = None, Characters = None, PresentationFormat = None, Lines = None, Paragraphs = None, Slides = None, Notes = None, TotalTime = None, HiddenSlides = None, MMClips = None, ScaleCrop = None, HeadingPairs = None, TitlesOfParts = None, LinksUpToDate = None, CharactersWithSpaces = None, SharedDoc = None, HyperlinkBase = None, HLinks = None, HyperlinksChanged = None, DigSig = None, Application = None, AppVersion = None, DocSecurity = None) +``` + +Bases: `Serialisable` + +See 22.2 + +Most of this is irrelevant but Excel is very picky about the version number + +It uses XX.YYYY (Version.Build) and expects everyone else to + +We provide Major.Minor and the full version in the application name + +### `AppVersion` + +```python +AppVersion = '.'.join(__version__.split('.')[:-1]) +``` + +### `Application` + +```python +Application = f'Microsoft Excel Compatible / Openpyxl {__version__}' +``` + +### `Characters` + +```python +Characters = Characters +``` + +### `CharactersWithSpaces` + +```python +CharactersWithSpaces = CharactersWithSpaces +``` + +### `Company` + +```python +Company = Company +``` + +### `DigSig` + +```python +DigSig = None +``` + +### `DocSecurity` + +```python +DocSecurity = DocSecurity +``` + +### `HLinks` + +```python +HLinks = None +``` + +### `HeadingPairs` + +```python +HeadingPairs = None +``` + +### `HiddenSlides` + +```python +HiddenSlides = HiddenSlides +``` + +### `HyperlinkBase` + +```python +HyperlinkBase = HyperlinkBase +``` + +### `HyperlinksChanged` + +```python +HyperlinksChanged = HyperlinksChanged +``` + +### `Lines` + +```python +Lines = Lines +``` + +### `LinksUpToDate` + +```python +LinksUpToDate = LinksUpToDate +``` + +### `MMClips` + +```python +MMClips = MMClips +``` + +### `Manager` + +```python +Manager = Manager +``` + +### `Notes` + +```python +Notes = Notes +``` + +### `Pages` + +```python +Pages = Pages +``` + +### `Paragraphs` + +```python +Paragraphs = Paragraphs +``` + +### `PresentationFormat` + +```python +PresentationFormat = PresentationFormat +``` + +### `ScaleCrop` + +```python +ScaleCrop = ScaleCrop +``` + +### `SharedDoc` + +```python +SharedDoc = SharedDoc +``` + +### `Slides` + +```python +Slides = Slides +``` + +### `Template` + +```python +Template = Template +``` + +### `TitlesOfParts` + +```python +TitlesOfParts = None +``` + +### `TotalTime` + +```python +TotalTime = TotalTime +``` + +### `Words` + +```python +Words = Words +``` + +### `tagname` + +```python +tagname = 'Properties' +``` + +### `to_tree` + +```python +to_tree() +``` + +## `VectorLpstr` + +Bases: `Serialisable` + +## `VectorVariant` + +Bases: `Serialisable` + + + + + +# `openpyxl.packaging.interface` + +## `ISerialisableFile` + +Bases: `ABC` + +Interface for Serialisable classes that represent files in the archive + +### `id` + +```python +id() +``` + +Object id making it unique + + + + + +# `openpyxl.packaging.manifest` + +File manifest + +## `DEFAULT_OVERRIDE` + +```python +DEFAULT_OVERRIDE = [Override('/' + ARC_STYLE, STYLES_TYPE), Override('/' + ARC_THEME, THEME_TYPE), Override('/docProps/core.xml', 'application/vnd.openxmlformats-package.core-properties+xml'), Override('/docProps/app.xml', 'application/vnd.openxmlformats-officedocument.extended-properties+xml')] +``` + +## `DEFAULT_TYPES` + +```python +DEFAULT_TYPES = [FileExtension('rels', 'application/vnd.openxmlformats-package.relationships+xml'), FileExtension('xml', 'application/xml')] +``` + +## `FileExtension` + +```python +FileExtension(Extension, ContentType) +``` + +Bases: `Serialisable` + +### `ContentType` + +```python +ContentType = ContentType +``` + +### `Extension` + +```python +Extension = Extension +``` + +### `tagname` + +```python +tagname = 'Default' +``` + +## `Manifest` + +```python +Manifest(Default = (), Override = ()) +``` + +Bases: `Serialisable` + +### `Default` + +```python +Default = Default +``` + +### `Override` + +```python +Override = Override +``` + +### `append` + +```python +append(obj) +``` + +Add content object to the package manifest +# needs a contract... + +### `extensions` + +```python +extensions +``` + +Map content types to file extensions +Skip parts without extensions + +### `filenames` + +```python +filenames +``` + +### `find` + +```python +find(content_type) +``` + +Find specific content-type + +### `findall` + +```python +findall(content_type) +``` + +Find all elements of a specific content-type + +### `path` + +```python +path = '[Content_Types].xml' +``` + +### `tagname` + +```python +tagname = 'Types' +``` + +### `to_tree` + +```python +to_tree() +``` + +Custom serialisation method to allow setting a default namespace + +## `Override` + +```python +Override(PartName, ContentType) +``` + +Bases: `Serialisable` + +### `ContentType` + +```python +ContentType = ContentType +``` + +### `PartName` + +```python +PartName = PartName +``` + +### `tagname` + +```python +tagname = 'Override' +``` + +## `mimetypes` + +```python +mimetypes = MimeTypes() +``` + + + + + +# `openpyxl.packaging.relationship` + +## `Relationship` + +```python +Relationship(Id = None, Type = None, type = None, Target = None, TargetMode = None) +``` + +Bases: `Serialisable` + +Represents many kinds of relationships. + +`type` can be used as a shorthand with the default relationships namespace +otherwise the `Type` must be a fully qualified URL + +### `Id` + +```python +Id = Id +``` + +### `Target` + +```python +Target = Target +``` + +### `TargetMode` + +```python +TargetMode = TargetMode +``` + +### `Type` + +```python +Type = Type +``` + +### `id` + +```python +id = Alias('Id') +``` + +### `tagname` + +```python +tagname = 'Relationship' +``` + +### `target` + +```python +target = Alias('Target') +``` + +## `RelationshipList` + +Bases: `ElementList` + +### `append` + +```python +append(value) +``` + +### `expected_type` + +```python +expected_type = Relationship +``` + +### `find` + +```python +find(content_type) +``` + +Find relationships by content-type +NB. these content-types namespaced objects and different to the MIME-types +in the package manifest :-( + +### `get` + +```python +get(key) +``` + +### `tagname` + +```python +tagname = 'Relationships' +``` + +### `to_dict` + +```python +to_dict() +``` + +Return a dictionary of relations keyed by id + +### `to_tree` + +```python +to_tree() +``` + +## `get_dependents` + +```python +get_dependents(archive, filename) +``` + +Normalise dependency file paths to absolute ones + +Relative paths are relative to parent object + +## `get_rel` + +```python +get_rel(archive, deps, id = None, cls = None) +``` + +Get related object based on id or rel_type + +## `get_rels_path` + +```python +get_rels_path(path) +``` + +Convert relative path to absolutes that can be loaded from a zip +archive. +The path to be passed in is that of containing object (workbook, +worksheet, etc.) + + + + + +# `openpyxl.packaging.workbook` + +## `ChildSheet` + +```python +ChildSheet(name = None, sheetId = None, state = 'visible', id = None) +``` + +Bases: `Serialisable` + +Represents a reference to a worksheet or chartsheet in workbook.xml + +It contains the title, order and state but only an indirect reference to +the objects themselves. + +### `id` + +```python +id = id +``` + +### `name` + +```python +name = name +``` + +### `sheetId` + +```python +sheetId = sheetId +``` + +### `state` + +```python +state = state +``` + +### `tagname` + +```python +tagname = 'sheet' +``` + +## `FileRecoveryProperties` + +```python +FileRecoveryProperties(autoRecover = None, crashSave = None, dataExtractLoad = None, repairLoad = None) +``` + +Bases: `Serialisable` + +### `autoRecover` + +```python +autoRecover = autoRecover +``` + +### `crashSave` + +```python +crashSave = crashSave +``` + +### `dataExtractLoad` + +```python +dataExtractLoad = dataExtractLoad +``` + +### `repairLoad` + +```python +repairLoad = repairLoad +``` + +### `tagname` + +```python +tagname = 'fileRecoveryPr' +``` + +## `PivotCache` + +```python +PivotCache(cacheId = None, id = None) +``` + +Bases: `Serialisable` + +### `cacheId` + +```python +cacheId = cacheId +``` + +### `id` + +```python +id = id +``` + +### `tagname` + +```python +tagname = 'pivotCache' +``` + +## `WorkbookPackage` + +```python +WorkbookPackage(conformance = None, fileVersion = None, fileSharing = None, workbookPr = None, workbookProtection = None, bookViews = (), sheets = (), functionGroups = None, externalReferences = (), definedNames = None, calcPr = None, oleSize = None, customWorkbookViews = (), pivotCaches = (), smartTagPr = None, smartTagTypes = None, webPublishing = None, fileRecoveryPr = None, webPublishObjects = None, extLst = None, Ignorable = None) +``` + +Bases: `Serialisable` + +Represent the workbook file in the archive + +### `Ignorable` + +```python +Ignorable = NestedString(namespace='http://schemas.openxmlformats.org/markup-compatibility/2006', allow_none=True) +``` + +### `active` + +```python +active +``` + +### `bookViews` + +```python +bookViews = bookViews +``` + +### `calcPr` + +```python +calcPr = calcPr +``` + +### `conformance` + +```python +conformance = conformance +``` + +### `customWorkbookViews` + +```python +customWorkbookViews = customWorkbookViews +``` + +### `definedNames` + +```python +definedNames = definedNames +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `externalReferences` + +```python +externalReferences = externalReferences +``` + +### `fileRecoveryPr` + +```python +fileRecoveryPr = fileRecoveryPr +``` + +### `fileSharing` + +```python +fileSharing = fileSharing +``` + +### `fileVersion` + +```python +fileVersion = fileVersion +``` + +### `functionGroups` + +```python +functionGroups = functionGroups +``` + +### `oleSize` + +```python +oleSize = oleSize +``` + +### `pivotCaches` + +```python +pivotCaches = pivotCaches +``` + +### `properties` + +```python +properties = Alias('workbookPr') +``` + +### `sheets` + +```python +sheets = sheets +``` + +### `smartTagPr` + +```python +smartTagPr = smartTagPr +``` + +### `smartTagTypes` + +```python +smartTagTypes = smartTagTypes +``` + +### `tagname` + +```python +tagname = 'workbook' +``` + +### `to_tree` + +```python +to_tree() +``` + +### `webPublishObjects` + +```python +webPublishObjects = webPublishObjects +``` + +### `webPublishing` + +```python +webPublishing = webPublishing +``` + +### `workbookPr` + +```python +workbookPr = workbookPr +``` + +### `workbookProtection` + +```python +workbookProtection = workbookProtection +``` diff --git a/addons/sandbox/skills/xlsx/references/api-004.md b/addons/sandbox/skills/xlsx/references/api-004.md new file mode 100644 index 000000000..68986adca --- /dev/null +++ b/addons/sandbox/skills/xlsx/references/api-004.md @@ -0,0 +1,7785 @@ + + + + +# `openpyxl.pivot.cache` + +## `CacheDefinition` + +```python +CacheDefinition(invalid = None, saveData = None, refreshOnLoad = None, optimizeMemory = None, enableRefresh = None, refreshedBy = None, refreshedDate = None, refreshedDateIso = None, backgroundQuery = None, missingItemsLimit = None, createdVersion = None, refreshedVersion = None, minRefreshableVersion = None, recordCount = None, upgradeOnRefresh = None, tupleCache = None, supportSubquery = None, supportAdvancedDrill = None, cacheSource = None, cacheFields = (), cacheHierarchies = (), kpis = (), calculatedItems = (), calculatedMembers = (), dimensions = (), measureGroups = (), maps = (), extLst = None, id = None) +``` + +Bases: `Serialisable` + +### `backgroundQuery` + +```python +backgroundQuery = backgroundQuery +``` + +### `cacheFields` + +```python +cacheFields = cacheFields +``` + +### `cacheHierarchies` + +```python +cacheHierarchies = cacheHierarchies +``` + +### `cacheSource` + +```python +cacheSource = cacheSource +``` + +### `calculatedItems` + +```python +calculatedItems = calculatedItems +``` + +### `calculatedMembers` + +```python +calculatedMembers = calculatedMembers +``` + +### `createdVersion` + +```python +createdVersion = createdVersion +``` + +### `dimensions` + +```python +dimensions = dimensions +``` + +### `enableRefresh` + +```python +enableRefresh = enableRefresh +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `id` + +```python +id = id +``` + +### `invalid` + +```python +invalid = invalid +``` + +### `kpis` + +```python +kpis = kpis +``` + +### `maps` + +```python +maps = maps +``` + +### `measureGroups` + +```python +measureGroups = measureGroups +``` + +### `mime_type` + +```python +mime_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml' +``` + +### `minRefreshableVersion` + +```python +minRefreshableVersion = minRefreshableVersion +``` + +### `missingItemsLimit` + +```python +missingItemsLimit = missingItemsLimit +``` + +### `optimizeMemory` + +```python +optimizeMemory = optimizeMemory +``` + +### `path` + +```python +path +``` + +### `recordCount` + +```python +recordCount = recordCount +``` + +### `records` + +```python +records = None +``` + +### `refreshOnLoad` + +```python +refreshOnLoad = refreshOnLoad +``` + +### `refreshedBy` + +```python +refreshedBy = refreshedBy +``` + +### `refreshedDate` + +```python +refreshedDate = refreshedDate +``` + +### `refreshedDateIso` + +```python +refreshedDateIso = refreshedDateIso +``` + +### `refreshedVersion` + +```python +refreshedVersion = refreshedVersion +``` + +### `rel_type` + +```python +rel_type = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition' +``` + +### `saveData` + +```python +saveData = saveData +``` + +### `supportAdvancedDrill` + +```python +supportAdvancedDrill = supportAdvancedDrill +``` + +### `supportSubquery` + +```python +supportSubquery = supportSubquery +``` + +### `tagname` + +```python +tagname = 'pivotCacheDefinition' +``` + +### `to_tree` + +```python +to_tree() +``` + +### `tupleCache` + +```python +tupleCache = tupleCache +``` + +### `upgradeOnRefresh` + +```python +upgradeOnRefresh = upgradeOnRefresh +``` + +## `CacheField` + +```python +CacheField(sharedItems = None, fieldGroup = None, mpMap = None, extLst = None, name = None, caption = None, propertyName = None, serverField = None, uniqueList = True, numFmtId = None, formula = None, sqlType = 0, hierarchy = 0, level = 0, databaseField = True, mappingCount = None, memberPropertyField = None) +``` + +Bases: `Serialisable` + +### `caption` + +```python +caption = caption +``` + +### `databaseField` + +```python +databaseField = databaseField +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `fieldGroup` + +```python +fieldGroup = fieldGroup +``` + +### `formula` + +```python +formula = formula +``` + +### `hierarchy` + +```python +hierarchy = hierarchy +``` + +### `level` + +```python +level = level +``` + +### `mappingCount` + +```python +mappingCount = mappingCount +``` + +### `memberPropertyField` + +```python +memberPropertyField = memberPropertyField +``` + +### `mpMap` + +```python +mpMap = mpMap +``` + +### `name` + +```python +name = name +``` + +### `numFmtId` + +```python +numFmtId = numFmtId +``` + +### `propertyName` + +```python +propertyName = propertyName +``` + +### `serverField` + +```python +serverField = serverField +``` + +### `sharedItems` + +```python +sharedItems = sharedItems +``` + +### `sqlType` + +```python +sqlType = sqlType +``` + +### `tagname` + +```python +tagname = 'cacheField' +``` + +### `uniqueList` + +```python +uniqueList = uniqueList +``` + +## `CacheHierarchy` + +```python +CacheHierarchy(uniqueName = '', caption = None, measure = None, set = None, parentSet = None, iconSet = 0, attribute = None, time = None, keyAttribute = None, defaultMemberUniqueName = None, allUniqueName = None, allCaption = None, dimensionUniqueName = None, displayFolder = None, measureGroup = None, measures = None, count = None, oneField = None, memberValueDatatype = None, unbalanced = None, unbalancedGroup = None, hidden = None, fieldsUsage = (), groupLevels = (), extLst = None) +``` + +Bases: `Serialisable` + +### `allCaption` + +```python +allCaption = allCaption +``` + +### `allUniqueName` + +```python +allUniqueName = allUniqueName +``` + +### `attribute` + +```python +attribute = attribute +``` + +### `caption` + +```python +caption = caption +``` + +### `count` + +```python +count = count +``` + +### `defaultMemberUniqueName` + +```python +defaultMemberUniqueName = defaultMemberUniqueName +``` + +### `dimensionUniqueName` + +```python +dimensionUniqueName = dimensionUniqueName +``` + +### `displayFolder` + +```python +displayFolder = displayFolder +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `fieldsUsage` + +```python +fieldsUsage = fieldsUsage +``` + +### `groupLevels` + +```python +groupLevels = groupLevels +``` + +### `hidden` + +```python +hidden = hidden +``` + +### `iconSet` + +```python +iconSet = iconSet +``` + +### `keyAttribute` + +```python +keyAttribute = keyAttribute +``` + +### `measure` + +```python +measure = measure +``` + +### `measureGroup` + +```python +measureGroup = measureGroup +``` + +### `measures` + +```python +measures = measures +``` + +### `memberValueDatatype` + +```python +memberValueDatatype = memberValueDatatype +``` + +### `oneField` + +```python +oneField = oneField +``` + +### `parentSet` + +```python +parentSet = parentSet +``` + +### `set` + +```python +set = set +``` + +### `tagname` + +```python +tagname = 'cacheHierarchy' +``` + +### `time` + +```python +time = time +``` + +### `unbalanced` + +```python +unbalanced = unbalanced +``` + +### `unbalancedGroup` + +```python +unbalancedGroup = unbalancedGroup +``` + +### `uniqueName` + +```python +uniqueName = uniqueName +``` + +## `CacheSource` + +```python +CacheSource(type = None, connectionId = None, worksheetSource = None, consolidation = None, extLst = None) +``` + +Bases: `Serialisable` + +### `connectionId` + +```python +connectionId = connectionId +``` + +### `consolidation` + +```python +consolidation = consolidation +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `tagname` + +```python +tagname = 'cacheSource' +``` + +### `type` + +```python +type = type +``` + +### `worksheetSource` + +```python +worksheetSource = worksheetSource +``` + +## `CalculatedItem` + +```python +CalculatedItem(field = None, formula = None, pivotArea = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = extLst +``` + +### `field` + +```python +field = field +``` + +### `formula` + +```python +formula = formula +``` + +### `pivotArea` + +```python +pivotArea = pivotArea +``` + +### `tagname` + +```python +tagname = 'calculatedItem' +``` + +## `CalculatedMember` + +```python +CalculatedMember(name = None, mdx = None, memberName = None, hierarchy = None, parent = None, solveOrder = None, set = None, extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `hierarchy` + +```python +hierarchy = hierarchy +``` + +### `mdx` + +```python +mdx = mdx +``` + +### `memberName` + +```python +memberName = memberName +``` + +### `name` + +```python +name = name +``` + +### `parent` + +```python +parent = parent +``` + +### `set` + +```python +set = set +``` + +### `solveOrder` + +```python +solveOrder = solveOrder +``` + +### `tagname` + +```python +tagname = 'calculatedMember' +``` + +## `Consolidation` + +```python +Consolidation(autoPage = None, pages = (), rangeSets = ()) +``` + +Bases: `Serialisable` + +### `autoPage` + +```python +autoPage = autoPage +``` + +### `pages` + +```python +pages = pages +``` + +### `rangeSets` + +```python +rangeSets = rangeSets +``` + +### `tagname` + +```python +tagname = 'consolidation' +``` + +## `FieldGroup` + +```python +FieldGroup(par = None, base = None, rangePr = None, discretePr = (), groupItems = None) +``` + +Bases: `Serialisable` + +### `base` + +```python +base = base +``` + +### `discretePr` + +```python +discretePr = discretePr +``` + +### `groupItems` + +```python +groupItems = groupItems +``` + +### `par` + +```python +par = par +``` + +### `rangePr` + +```python +rangePr = rangePr +``` + +### `tagname` + +```python +tagname = 'fieldGroup' +``` + +## `FieldUsage` + +```python +FieldUsage(x = None) +``` + +Bases: `Serialisable` + +### `tagname` + +```python +tagname = 'fieldUsage' +``` + +### `x` + +```python +x = x +``` + +## `GroupItems` + +```python +GroupItems(count = None, m = (), n = (), b = (), e = (), s = (), d = ()) +``` + +Bases: `Serialisable` + +### `b` + +```python +b = b +``` + +### `count` + +```python +count +``` + +### `d` + +```python +d = d +``` + +### `e` + +```python +e = e +``` + +### `m` + +```python +m = m +``` + +### `n` + +```python +n = n +``` + +### `s` + +```python +s = s +``` + +### `tagname` + +```python +tagname = 'groupItems' +``` + +## `GroupLevel` + +```python +GroupLevel(uniqueName = None, caption = None, user = None, customRollUp = None, groups = (), extLst = None) +``` + +Bases: `Serialisable` + +### `caption` + +```python +caption = caption +``` + +### `customRollUp` + +```python +customRollUp = customRollUp +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `groups` + +```python +groups = groups +``` + +### `tagname` + +```python +tagname = 'groupLevel' +``` + +### `uniqueName` + +```python +uniqueName = uniqueName +``` + +### `user` + +```python +user = user +``` + +## `GroupMember` + +```python +GroupMember(uniqueName = None, group = None) +``` + +Bases: `Serialisable` + +### `group` + +```python +group = group +``` + +### `tagname` + +```python +tagname = 'groupMember' +``` + +### `uniqueName` + +```python +uniqueName = uniqueName +``` + +## `LevelGroup` + +```python +LevelGroup(name = None, uniqueName = None, caption = None, uniqueParent = None, id = None, groupMembers = ()) +``` + +Bases: `Serialisable` + +### `caption` + +```python +caption = caption +``` + +### `groupMembers` + +```python +groupMembers = groupMembers +``` + +### `id` + +```python +id = id +``` + +### `name` + +```python +name = name +``` + +### `tagname` + +```python +tagname = 'group' +``` + +### `uniqueName` + +```python +uniqueName = uniqueName +``` + +### `uniqueParent` + +```python +uniqueParent = uniqueParent +``` + +## `MeasureDimensionMap` + +```python +MeasureDimensionMap(measureGroup = None, dimension = None) +``` + +Bases: `Serialisable` + +### `dimension` + +```python +dimension = dimension +``` + +### `measureGroup` + +```python +measureGroup = measureGroup +``` + +### `tagname` + +```python +tagname = 'map' +``` + +## `MeasureGroup` + +```python +MeasureGroup(name = None, caption = None) +``` + +Bases: `Serialisable` + +### `caption` + +```python +caption = caption +``` + +### `name` + +```python +name = name +``` + +### `tagname` + +```python +tagname = 'measureGroup' +``` + +## `OLAPKPI` + +```python +OLAPKPI(uniqueName = None, caption = None, displayFolder = None, measureGroup = None, parent = None, value = None, goal = None, status = None, trend = None, weight = None, time = None) +``` + +Bases: `Serialisable` + +### `caption` + +```python +caption = caption +``` + +### `displayFolder` + +```python +displayFolder = displayFolder +``` + +### `goal` + +```python +goal = goal +``` + +### `measureGroup` + +```python +measureGroup = measureGroup +``` + +### `parent` + +```python +parent = parent +``` + +### `status` + +```python +status = status +``` + +### `tagname` + +```python +tagname = 'kpi' +``` + +### `time` + +```python +time = time +``` + +### `trend` + +```python +trend = trend +``` + +### `uniqueName` + +```python +uniqueName = uniqueName +``` + +### `value` + +```python +value = value +``` + +### `weight` + +```python +weight = weight +``` + +## `OLAPSet` + +```python +OLAPSet(count = None, maxRank = None, setDefinition = None, sortType = None, queryFailed = None, tpls = None, sortByTuple = None) +``` + +Bases: `Serialisable` + +### `count` + +```python +count = count +``` + +### `maxRank` + +```python +maxRank = maxRank +``` + +### `queryFailed` + +```python +queryFailed = queryFailed +``` + +### `setDefinition` + +```python +setDefinition = setDefinition +``` + +### `sortByTuple` + +```python +sortByTuple = sortByTuple +``` + +### `sortType` + +```python +sortType = sortType +``` + +### `tagname` + +```python +tagname = 'set' +``` + +### `tpls` + +```python +tpls = tpls +``` + +## `PCDSDTCEntries` + +```python +PCDSDTCEntries(count = None, m = None, n = None, e = None, s = None) +``` + +Bases: `Serialisable` + +### `count` + +```python +count = count +``` + +### `e` + +```python +e = e +``` + +### `m` + +```python +m = m +``` + +### `n` + +```python +n = n +``` + +### `s` + +```python +s = s +``` + +### `tagname` + +```python +tagname = 'entries' +``` + +## `PageItem` + +```python +PageItem(name = None) +``` + +Bases: `Serialisable` + +### `name` + +```python +name = name +``` + +### `tagname` + +```python +tagname = 'pageItem' +``` + +## `PivotDimension` + +```python +PivotDimension(measure = None, name = None, uniqueName = None, caption = None) +``` + +Bases: `Serialisable` + +### `caption` + +```python +caption = caption +``` + +### `measure` + +```python +measure = measure +``` + +### `name` + +```python +name = name +``` + +### `tagname` + +```python +tagname = 'dimension' +``` + +### `uniqueName` + +```python +uniqueName = uniqueName +``` + +## `Query` + +```python +Query(mdx = None, tpls = None) +``` + +Bases: `Serialisable` + +### `mdx` + +```python +mdx = mdx +``` + +### `tagname` + +```python +tagname = 'query' +``` + +### `tpls` + +```python +tpls = tpls +``` + +## `RangePr` + +```python +RangePr(autoStart = True, autoEnd = True, groupBy = 'range', startNum = None, endNum = None, startDate = None, endDate = None, groupInterval = 1) +``` + +Bases: `Serialisable` + +### `autoEnd` + +```python +autoEnd = autoEnd +``` + +### `autoStart` + +```python +autoStart = autoStart +``` + +### `endDate` + +```python +endDate = endDate +``` + +### `endNum` + +```python +endNum = endNum +``` + +### `groupBy` + +```python +groupBy = groupBy +``` + +### `groupInterval` + +```python +groupInterval = groupInterval +``` + +### `startDate` + +```python +startDate = startDate +``` + +### `startNum` + +```python +startNum = startNum +``` + +### `tagname` + +```python +tagname = 'rangePr' +``` + +## `RangeSet` + +```python +RangeSet(i1 = None, i2 = None, i3 = None, i4 = None, ref = None, name = None, sheet = None) +``` + +Bases: `Serialisable` + +### `i1` + +```python +i1 = i1 +``` + +### `i2` + +```python +i2 = i2 +``` + +### `i3` + +```python +i3 = i3 +``` + +### `i4` + +```python +i4 = i4 +``` + +### `name` + +```python +name = name +``` + +### `ref` + +```python +ref = ref +``` + +### `sheet` + +```python +sheet = sheet +``` + +### `tagname` + +```python +tagname = 'rangeSet' +``` + +## `ServerFormat` + +```python +ServerFormat(culture = None, format = None) +``` + +Bases: `Serialisable` + +### `culture` + +```python +culture = culture +``` + +### `format` + +```python +format = format +``` + +### `tagname` + +```python +tagname = 'serverFormat' +``` + +## `SharedItems` + +```python +SharedItems(_fields = (), containsSemiMixedTypes = None, containsNonDate = None, containsDate = None, containsString = None, containsBlank = None, containsMixedTypes = None, containsNumber = None, containsInteger = None, minValue = None, maxValue = None, minDate = None, maxDate = None, count = None, longText = None) +``` + +Bases: `Serialisable` + +### `b` + +```python +b = MultiSequencePart(expected_type=Boolean, store='_fields') +``` + +### `containsBlank` + +```python +containsBlank = containsBlank +``` + +### `containsDate` + +```python +containsDate = containsDate +``` + +### `containsInteger` + +```python +containsInteger = containsInteger +``` + +### `containsMixedTypes` + +```python +containsMixedTypes = containsMixedTypes +``` + +### `containsNonDate` + +```python +containsNonDate = containsNonDate +``` + +### `containsNumber` + +```python +containsNumber = containsNumber +``` + +### `containsSemiMixedTypes` + +```python +containsSemiMixedTypes = containsSemiMixedTypes +``` + +### `containsString` + +```python +containsString = containsString +``` + +### `count` + +```python +count +``` + +### `d` + +```python +d = MultiSequencePart(expected_type=DateTimeField, store='_fields') +``` + +### `e` + +```python +e = MultiSequencePart(expected_type=Error, store='_fields') +``` + +### `longText` + +```python +longText = longText +``` + +### `m` + +```python +m = MultiSequencePart(expected_type=Missing, store='_fields') +``` + +### `maxDate` + +```python +maxDate = maxDate +``` + +### `maxValue` + +```python +maxValue = maxValue +``` + +### `minDate` + +```python +minDate = minDate +``` + +### `minValue` + +```python +minValue = minValue +``` + +### `n` + +```python +n = MultiSequencePart(expected_type=Number, store='_fields') +``` + +### `s` + +```python +s = MultiSequencePart(expected_type=Text, store='_fields') +``` + +### `tagname` + +```python +tagname = 'sharedItems' +``` + +## `TupleCache` + +```python +TupleCache(entries = None, sets = (), queryCache = (), serverFormats = (), extLst = None) +``` + +Bases: `Serialisable` + +### `entries` + +```python +entries = entries +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `queryCache` + +```python +queryCache = queryCache +``` + +### `serverFormats` + +```python +serverFormats = serverFormats +``` + +### `sets` + +```python +sets = sets +``` + +### `tagname` + +```python +tagname = 'tupleCache' +``` + +## `WorksheetSource` + +```python +WorksheetSource(ref = None, name = None, sheet = None) +``` + +Bases: `Serialisable` + +### `name` + +```python +name = name +``` + +### `ref` + +```python +ref = ref +``` + +### `sheet` + +```python +sheet = sheet +``` + +### `tagname` + +```python +tagname = 'worksheetSource' +``` + + + + + +# `openpyxl.pivot.fields` + +## `Boolean` + +```python +Boolean(x = (), v = None, u = None, f = None, c = None, cp = None) +``` + +Bases: `Serialisable` + +### `c` + +```python +c = c +``` + +### `cp` + +```python +cp = cp +``` + +### `f` + +```python +f = f +``` + +### `tagname` + +```python +tagname = 'b' +``` + +### `u` + +```python +u = u +``` + +### `v` + +```python +v = v +``` + +### `x` + +```python +x = x +``` + +## `DateTimeField` + +```python +DateTimeField(x = (), v = None, u = None, f = None, c = None, cp = None) +``` + +Bases: `Serialisable` + +### `c` + +```python +c = c +``` + +### `cp` + +```python +cp = cp +``` + +### `f` + +```python +f = f +``` + +### `tagname` + +```python +tagname = 'd' +``` + +### `u` + +```python +u = u +``` + +### `v` + +```python +v = v +``` + +### `x` + +```python +x = x +``` + +## `Error` + +```python +Error(tpls = None, x = (), v = None, u = None, f = None, c = None, cp = None, _in = None, bc = None, fc = None, i = None, un = None, st = None, b = None) +``` + +Bases: `Serialisable` + +### `b` + +```python +b = b +``` + +### `bc` + +```python +bc = bc +``` + +### `c` + +```python +c = c +``` + +### `cp` + +```python +cp = cp +``` + +### `f` + +```python +f = f +``` + +### `fc` + +```python +fc = fc +``` + +### `i` + +```python +i = i +``` + +### `st` + +```python +st = st +``` + +### `tagname` + +```python +tagname = 'e' +``` + +### `tpls` + +```python +tpls = tpls +``` + +### `u` + +```python +u = u +``` + +### `un` + +```python +un = un +``` + +### `v` + +```python +v = v +``` + +### `x` + +```python +x = x +``` + +## `Index` + +```python +Index(v = 0) +``` + +Bases: `Serialisable` + +### `tagname` + +```python +tagname = 'x' +``` + +### `v` + +```python +v = v +``` + +## `Missing` + +```python +Missing(tpls = (), x = (), u = None, f = None, c = None, cp = None, _in = None, bc = None, fc = None, i = None, un = None, st = None, b = None) +``` + +Bases: `Serialisable` + +### `b` + +```python +b = b +``` + +### `bc` + +```python +bc = bc +``` + +### `c` + +```python +c = c +``` + +### `cp` + +```python +cp = cp +``` + +### `f` + +```python +f = f +``` + +### `fc` + +```python +fc = fc +``` + +### `i` + +```python +i = i +``` + +### `st` + +```python +st = st +``` + +### `tagname` + +```python +tagname = 'm' +``` + +### `tpls` + +```python +tpls = tpls +``` + +### `u` + +```python +u = u +``` + +### `un` + +```python +un = un +``` + +### `x` + +```python +x = x +``` + +## `Number` + +```python +Number(tpls = (), x = (), v = None, u = None, f = None, c = None, cp = None, _in = None, bc = None, fc = None, i = None, un = None, st = None, b = None) +``` + +Bases: `Serialisable` + +### `b` + +```python +b = b +``` + +### `bc` + +```python +bc = bc +``` + +### `c` + +```python +c = c +``` + +### `cp` + +```python +cp = cp +``` + +### `f` + +```python +f = f +``` + +### `fc` + +```python +fc = fc +``` + +### `i` + +```python +i = i +``` + +### `st` + +```python +st = st +``` + +### `tagname` + +```python +tagname = 'n' +``` + +### `tpls` + +```python +tpls = tpls +``` + +### `u` + +```python +u = u +``` + +### `un` + +```python +un = un +``` + +### `v` + +```python +v = v +``` + +### `x` + +```python +x = x +``` + +## `Text` + +```python +Text(tpls = (), x = (), v = None, u = None, f = None, c = None, cp = None, _in = None, bc = None, fc = None, i = None, un = None, st = None, b = None) +``` + +Bases: `Serialisable` + +### `b` + +```python +b = b +``` + +### `bc` + +```python +bc = bc +``` + +### `c` + +```python +c = c +``` + +### `cp` + +```python +cp = cp +``` + +### `f` + +```python +f = f +``` + +### `fc` + +```python +fc = fc +``` + +### `i` + +```python +i = i +``` + +### `st` + +```python +st = st +``` + +### `tagname` + +```python +tagname = 's' +``` + +### `tpls` + +```python +tpls = tpls +``` + +### `u` + +```python +u = u +``` + +### `un` + +```python +un = un +``` + +### `v` + +```python +v = v +``` + +### `x` + +```python +x = x +``` + +## `Tuple` + +```python +Tuple(fld = None, hier = None, item = None) +``` + +Bases: `Serialisable` + +### `fld` + +```python +fld = fld +``` + +### `hier` + +```python +hier = hier +``` + +### `item` + +```python +item = item +``` + +### `tagname` + +```python +tagname = 'tpl' +``` + +## `TupleList` + +```python +TupleList(c = None, tpl = None) +``` + +Bases: `Serialisable` + +### `c` + +```python +c = c +``` + +### `tagname` + +```python +tagname = 'tpls' +``` + +### `tpl` + +```python +tpl = tpl +``` + + + + + +# `openpyxl.pivot.record` + +## `Record` + +```python +Record(_fields = (), m = None, n = None, b = None, e = None, s = None, d = None, x = None) +``` + +Bases: `Serialisable` + +### `b` + +```python +b = MultiSequencePart(expected_type=Boolean, store='_fields') +``` + +### `d` + +```python +d = MultiSequencePart(expected_type=DateTimeField, store='_fields') +``` + +### `e` + +```python +e = MultiSequencePart(expected_type=Error, store='_fields') +``` + +### `m` + +```python +m = MultiSequencePart(expected_type=Missing, store='_fields') +``` + +### `n` + +```python +n = MultiSequencePart(expected_type=Number, store='_fields') +``` + +### `s` + +```python +s = MultiSequencePart(expected_type=Text, store='_fields') +``` + +### `tagname` + +```python +tagname = 'r' +``` + +### `x` + +```python +x = MultiSequencePart(expected_type=Index, store='_fields') +``` + +## `RecordList` + +```python +RecordList(count = None, r = (), extLst = None) +``` + +Bases: `Serialisable` + +### `count` + +```python +count +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `mime_type` + +```python +mime_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml' +``` + +### `path` + +```python +path +``` + +### `r` + +```python +r = r +``` + +### `rel_type` + +```python +rel_type = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords' +``` + +### `tagname` + +```python +tagname = 'pivotCacheRecords' +``` + +### `to_tree` + +```python +to_tree() +``` + + + + + +# `openpyxl.pivot.table` + +## `AutoSortScope` + +```python +AutoSortScope(pivotArea = None) +``` + +Bases: `Serialisable` + +### `pivotArea` + +```python +pivotArea = pivotArea +``` + +## `ChartFormat` + +```python +ChartFormat(chart = None, format = None, series = None, pivotArea = None) +``` + +Bases: `Serialisable` + +### `chart` + +```python +chart = chart +``` + +### `format` + +```python +format = format +``` + +### `pivotArea` + +```python +pivotArea = pivotArea +``` + +### `series` + +```python +series = series +``` + +### `tagname` + +```python +tagname = 'chartFormat' +``` + +## `ColHierarchiesUsage` + +```python +ColHierarchiesUsage(count = None, colHierarchyUsage = ()) +``` + +Bases: `Serialisable` + +### `colHierarchyUsage` + +```python +colHierarchyUsage = colHierarchyUsage +``` + +### `count` + +```python +count +``` + +### `tagname` + +```python +tagname = 'colHierarchiesUsage' +``` + +## `ConditionalFormat` + +```python +ConditionalFormat(scope = 'selection', type = None, priority = None, pivotAreas = (), extLst = None) +``` + +Bases: `Serialisable` + +### `extLst` + +```python +extLst = extLst +``` + +### `pivotAreas` + +```python +pivotAreas = pivotAreas +``` + +### `priority` + +```python +priority = priority +``` + +### `scope` + +```python +scope = scope +``` + +### `tagname` + +```python +tagname = 'conditionalFormat' +``` + +### `type` + +```python +type = type +``` + +## `ConditionalFormatList` + +```python +ConditionalFormatList(conditionalFormat = (), count = None) +``` + +Bases: `Serialisable` + +### `by_priority` + +```python +by_priority() +``` + +Return a dictionary of format objects keyed by (field id and format property). +This can be used to map the formats to field but also to dedupe to match +worksheet definitions which are grouped by cell range + +### `conditionalFormat` + +```python +conditionalFormat = conditionalFormat +``` + +### `count` + +```python +count +``` + +### `tagname` + +```python +tagname = 'conditionalFormats' +``` + +### `to_tree` + +```python +to_tree(tagname = None) +``` + +## `DataField` + +```python +DataField(name = None, fld = None, subtotal = 'sum', showDataAs = 'normal', baseField = -1, baseItem = 1048832, numFmtId = None, extLst = None) +``` + +Bases: `Serialisable` + +### `baseField` + +```python +baseField = baseField +``` + +### `baseItem` + +```python +baseItem = baseItem +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `fld` + +```python +fld = fld +``` + +### `name` + +```python +name = name +``` + +### `numFmtId` + +```python +numFmtId = numFmtId +``` + +### `showDataAs` + +```python +showDataAs = showDataAs +``` + +### `subtotal` + +```python +subtotal = subtotal +``` + +### `tagname` + +```python +tagname = 'dataField' +``` + +## `FieldItem` + +```python +FieldItem(n = None, t = 'data', h = None, s = None, sd = True, f = None, m = None, c = None, x = None, d = None, e = None) +``` + +Bases: `Serialisable` + +### `c` + +```python +c = c +``` + +### `d` + +```python +d = d +``` + +### `e` + +```python +e = e +``` + +### `f` + +```python +f = f +``` + +### `h` + +```python +h = h +``` + +### `m` + +```python +m = m +``` + +### `n` + +```python +n = n +``` + +### `s` + +```python +s = s +``` + +### `sd` + +```python +sd = sd +``` + +### `t` + +```python +t = t +``` + +### `tagname` + +```python +tagname = 'item' +``` + +### `x` + +```python +x = x +``` + +## `Format` + +```python +Format(action = 'formatting', dxfId = None, pivotArea = None, extLst = None) +``` + +Bases: `Serialisable` + +### `action` + +```python +action = action +``` + +### `dxfId` + +```python +dxfId = dxfId +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `pivotArea` + +```python +pivotArea = pivotArea +``` + +### `tagname` + +```python +tagname = 'format' +``` + +## `HierarchyUsage` + +```python +HierarchyUsage(hierarchyUsage = None) +``` + +Bases: `Serialisable` + +### `hierarchyUsage` + +```python +hierarchyUsage = hierarchyUsage +``` + +### `tagname` + +```python +tagname = 'hierarchyUsage' +``` + +## `Location` + +```python +Location(ref = None, firstHeaderRow = None, firstDataRow = None, firstDataCol = None, rowPageCount = None, colPageCount = None) +``` + +Bases: `Serialisable` + +### `colPageCount` + +```python +colPageCount = colPageCount +``` + +### `firstDataCol` + +```python +firstDataCol = firstDataCol +``` + +### `firstDataRow` + +```python +firstDataRow = firstDataRow +``` + +### `firstHeaderRow` + +```python +firstHeaderRow = firstHeaderRow +``` + +### `ref` + +```python +ref = ref +``` + +### `rowPageCount` + +```python +rowPageCount = rowPageCount +``` + +### `tagname` + +```python +tagname = 'location' +``` + +## `MemberList` + +```python +MemberList(count = None, level = None, member = ()) +``` + +Bases: `Serialisable` + +### `count` + +```python +count +``` + +### `level` + +```python +level = level +``` + +### `member` + +```python +member = member +``` + +### `tagname` + +```python +tagname = 'members' +``` + +## `MemberProperty` + +```python +MemberProperty(name = None, showCell = None, showTip = None, showAsCaption = None, nameLen = None, pPos = None, pLen = None, level = None, field = None) +``` + +Bases: `Serialisable` + +### `field` + +```python +field = field +``` + +### `level` + +```python +level = level +``` + +### `name` + +```python +name = name +``` + +### `nameLen` + +```python +nameLen = nameLen +``` + +### `pLen` + +```python +pLen = pLen +``` + +### `pPos` + +```python +pPos = pPos +``` + +### `showAsCaption` + +```python +showAsCaption = showAsCaption +``` + +### `showCell` + +```python +showCell = showCell +``` + +### `showTip` + +```python +showTip = showTip +``` + +### `tagname` + +```python +tagname = 'mps' +``` + +## `PageField` + +```python +PageField(fld = None, item = None, hier = None, name = None, cap = None, extLst = None) +``` + +Bases: `Serialisable` + +### `cap` + +```python +cap = cap +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `fld` + +```python +fld = fld +``` + +### `hier` + +```python +hier = hier +``` + +### `item` + +```python +item = item +``` + +### `name` + +```python +name = name +``` + +### `tagname` + +```python +tagname = 'pageField' +``` + +## `PivotArea` + +```python +PivotArea(references = (), extLst = None, field = None, type = 'normal', dataOnly = True, labelOnly = None, grandRow = None, grandCol = None, cacheIndex = None, outline = True, offset = None, collapsedLevelsAreSubtotals = None, axis = None, fieldPosition = None) +``` + +Bases: `Serialisable` + +### `axis` + +```python +axis = axis +``` + +### `cacheIndex` + +```python +cacheIndex = cacheIndex +``` + +### `collapsedLevelsAreSubtotals` + +```python +collapsedLevelsAreSubtotals = collapsedLevelsAreSubtotals +``` + +### `dataOnly` + +```python +dataOnly = dataOnly +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `field` + +```python +field = field +``` + +### `fieldPosition` + +```python +fieldPosition = fieldPosition +``` + +### `grandCol` + +```python +grandCol = grandCol +``` + +### `grandRow` + +```python +grandRow = grandRow +``` + +### `labelOnly` + +```python +labelOnly = labelOnly +``` + +### `offset` + +```python +offset = offset +``` + +### `outline` + +```python +outline = outline +``` + +### `references` + +```python +references = references +``` + +### `tagname` + +```python +tagname = 'pivotArea' +``` + +### `type` + +```python +type = type +``` + +## `PivotField` + +```python +PivotField(items = (), autoSortScope = None, name = None, axis = None, dataField = None, subtotalCaption = None, showDropDowns = True, hiddenLevel = None, uniqueMemberProperty = None, compact = True, allDrilled = None, numFmtId = None, outline = True, subtotalTop = True, dragToRow = True, dragToCol = True, multipleItemSelectionAllowed = None, dragToPage = True, dragToData = True, dragOff = True, showAll = True, insertBlankRow = None, serverField = None, insertPageBreak = None, autoShow = None, topAutoShow = True, hideNewItems = None, measureFilter = None, includeNewItemsInFilter = None, itemPageCount = 10, sortType = 'manual', dataSourceSort = None, nonAutoSortDefault = None, rankBy = None, defaultSubtotal = True, sumSubtotal = None, countASubtotal = None, avgSubtotal = None, maxSubtotal = None, minSubtotal = None, productSubtotal = None, countSubtotal = None, stdDevSubtotal = None, stdDevPSubtotal = None, varSubtotal = None, varPSubtotal = None, showPropCell = None, showPropTip = None, showPropAsCaption = None, defaultAttributeDrillState = None, extLst = None) +``` + +Bases: `Serialisable` + +### `allDrilled` + +```python +allDrilled = allDrilled +``` + +### `autoShow` + +```python +autoShow = autoShow +``` + +### `autoSortScope` + +```python +autoSortScope = autoSortScope +``` + +### `avgSubtotal` + +```python +avgSubtotal = avgSubtotal +``` + +### `axis` + +```python +axis = axis +``` + +### `compact` + +```python +compact = compact +``` + +### `countASubtotal` + +```python +countASubtotal = countASubtotal +``` + +### `countSubtotal` + +```python +countSubtotal = countSubtotal +``` + +### `dataField` + +```python +dataField = dataField +``` + +### `dataSourceSort` + +```python +dataSourceSort = dataSourceSort +``` + +### `defaultAttributeDrillState` + +```python +defaultAttributeDrillState = defaultAttributeDrillState +``` + +### `defaultSubtotal` + +```python +defaultSubtotal = defaultSubtotal +``` + +### `dragOff` + +```python +dragOff = dragOff +``` + +### `dragToCol` + +```python +dragToCol = dragToCol +``` + +### `dragToData` + +```python +dragToData = dragToData +``` + +### `dragToPage` + +```python +dragToPage = dragToPage +``` + +### `dragToRow` + +```python +dragToRow = dragToRow +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `hiddenLevel` + +```python +hiddenLevel = hiddenLevel +``` + +### `hideNewItems` + +```python +hideNewItems = hideNewItems +``` + +### `includeNewItemsInFilter` + +```python +includeNewItemsInFilter = includeNewItemsInFilter +``` + +### `insertBlankRow` + +```python +insertBlankRow = insertBlankRow +``` + +### `insertPageBreak` + +```python +insertPageBreak = insertPageBreak +``` + +### `itemPageCount` + +```python +itemPageCount = itemPageCount +``` + +### `items` + +```python +items = items +``` + +### `maxSubtotal` + +```python +maxSubtotal = maxSubtotal +``` + +### `measureFilter` + +```python +measureFilter = measureFilter +``` + +### `minSubtotal` + +```python +minSubtotal = minSubtotal +``` + +### `multipleItemSelectionAllowed` + +```python +multipleItemSelectionAllowed = multipleItemSelectionAllowed +``` + +### `name` + +```python +name = name +``` + +### `nonAutoSortDefault` + +```python +nonAutoSortDefault = nonAutoSortDefault +``` + +### `numFmtId` + +```python +numFmtId = numFmtId +``` + +### `outline` + +```python +outline = outline +``` + +### `productSubtotal` + +```python +productSubtotal = productSubtotal +``` + +### `rankBy` + +```python +rankBy = rankBy +``` + +### `serverField` + +```python +serverField = serverField +``` + +### `showAll` + +```python +showAll = showAll +``` + +### `showDropDowns` + +```python +showDropDowns = showDropDowns +``` + +### `showPropAsCaption` + +```python +showPropAsCaption = showPropAsCaption +``` + +### `showPropCell` + +```python +showPropCell = showPropCell +``` + +### `showPropTip` + +```python +showPropTip = showPropTip +``` + +### `sortType` + +```python +sortType = sortType +``` + +### `stdDevPSubtotal` + +```python +stdDevPSubtotal = stdDevPSubtotal +``` + +### `stdDevSubtotal` + +```python +stdDevSubtotal = stdDevSubtotal +``` + +### `subtotalCaption` + +```python +subtotalCaption = subtotalCaption +``` + +### `subtotalTop` + +```python +subtotalTop = subtotalTop +``` + +### `sumSubtotal` + +```python +sumSubtotal = sumSubtotal +``` + +### `tagname` + +```python +tagname = 'pivotField' +``` + +### `topAutoShow` + +```python +topAutoShow = topAutoShow +``` + +### `uniqueMemberProperty` + +```python +uniqueMemberProperty = uniqueMemberProperty +``` + +### `varPSubtotal` + +```python +varPSubtotal = varPSubtotal +``` + +### `varSubtotal` + +```python +varSubtotal = varSubtotal +``` + +## `PivotFilter` + +```python +PivotFilter(fld = None, mpFld = None, type = None, evalOrder = None, id = None, iMeasureHier = None, iMeasureFld = None, name = None, description = None, stringValue1 = None, stringValue2 = None, autoFilter = None, extLst = None) +``` + +Bases: `Serialisable` + +### `autoFilter` + +```python +autoFilter = autoFilter +``` + +### `description` + +```python +description = description +``` + +### `evalOrder` + +```python +evalOrder = evalOrder +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `fld` + +```python +fld = fld +``` + +### `iMeasureFld` + +```python +iMeasureFld = iMeasureFld +``` + +### `iMeasureHier` + +```python +iMeasureHier = iMeasureHier +``` + +### `id` + +```python +id = id +``` + +### `mpFld` + +```python +mpFld = mpFld +``` + +### `name` + +```python +name = name +``` + +### `stringValue1` + +```python +stringValue1 = stringValue1 +``` + +### `stringValue2` + +```python +stringValue2 = stringValue2 +``` + +### `tagname` + +```python +tagname = 'filter' +``` + +### `type` + +```python +type = type +``` + +## `PivotFilters` + +```python +PivotFilters(count = None, filter = None) +``` + +Bases: `Serialisable` + +### `count` + +```python +count = Integer() +``` + +### `filter` + +```python +filter = filter +``` + +## `PivotHierarchy` + +```python +PivotHierarchy(outline = None, multipleItemSelectionAllowed = None, subtotalTop = None, showInFieldList = None, dragToRow = None, dragToCol = None, dragToPage = None, dragToData = None, dragOff = None, includeNewItemsInFilter = None, caption = None, mps = (), members = None, extLst = None) +``` + +Bases: `Serialisable` + +### `caption` + +```python +caption = caption +``` + +### `dragOff` + +```python +dragOff = dragOff +``` + +### `dragToCol` + +```python +dragToCol = dragToCol +``` + +### `dragToData` + +```python +dragToData = dragToData +``` + +### `dragToPage` + +```python +dragToPage = dragToPage +``` + +### `dragToRow` + +```python +dragToRow = dragToRow +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `includeNewItemsInFilter` + +```python +includeNewItemsInFilter = includeNewItemsInFilter +``` + +### `members` + +```python +members = members +``` + +### `mps` + +```python +mps = mps +``` + +### `multipleItemSelectionAllowed` + +```python +multipleItemSelectionAllowed = multipleItemSelectionAllowed +``` + +### `outline` + +```python +outline = outline +``` + +### `showInFieldList` + +```python +showInFieldList = showInFieldList +``` + +### `subtotalTop` + +```python +subtotalTop = subtotalTop +``` + +### `tagname` + +```python +tagname = 'pivotHierarchy' +``` + +## `PivotTableStyle` + +```python +PivotTableStyle(name = None, showRowHeaders = None, showColHeaders = None, showRowStripes = None, showColStripes = None, showLastColumn = None) +``` + +Bases: `Serialisable` + +### `name` + +```python +name = name +``` + +### `showColHeaders` + +```python +showColHeaders = showColHeaders +``` + +### `showColStripes` + +```python +showColStripes = showColStripes +``` + +### `showLastColumn` + +```python +showLastColumn = showLastColumn +``` + +### `showRowHeaders` + +```python +showRowHeaders = showRowHeaders +``` + +### `showRowStripes` + +```python +showRowStripes = showRowStripes +``` + +### `tagname` + +```python +tagname = 'pivotTableStyleInfo' +``` + +## `Reference` + +```python +Reference(field = None, count = None, selected = None, byPosition = None, relative = None, defaultSubtotal = None, sumSubtotal = None, countASubtotal = None, avgSubtotal = None, maxSubtotal = None, minSubtotal = None, productSubtotal = None, countSubtotal = None, stdDevSubtotal = None, stdDevPSubtotal = None, varSubtotal = None, varPSubtotal = None, x = (), extLst = None) +``` + +Bases: `Serialisable` + +### `avgSubtotal` + +```python +avgSubtotal = avgSubtotal +``` + +### `byPosition` + +```python +byPosition = byPosition +``` + +### `count` + +```python +count +``` + +### `countASubtotal` + +```python +countASubtotal = countASubtotal +``` + +### `countSubtotal` + +```python +countSubtotal = countSubtotal +``` + +### `defaultSubtotal` + +```python +defaultSubtotal = defaultSubtotal +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `field` + +```python +field = field +``` + +### `maxSubtotal` + +```python +maxSubtotal = maxSubtotal +``` + +### `minSubtotal` + +```python +minSubtotal = minSubtotal +``` + +### `productSubtotal` + +```python +productSubtotal = productSubtotal +``` + +### `relative` + +```python +relative = relative +``` + +### `selected` + +```python +selected = selected +``` + +### `stdDevPSubtotal` + +```python +stdDevPSubtotal = stdDevPSubtotal +``` + +### `stdDevSubtotal` + +```python +stdDevSubtotal = stdDevSubtotal +``` + +### `sumSubtotal` + +```python +sumSubtotal = sumSubtotal +``` + +### `tagname` + +```python +tagname = 'reference' +``` + +### `varPSubtotal` + +```python +varPSubtotal = varPSubtotal +``` + +### `varSubtotal` + +```python +varSubtotal = varSubtotal +``` + +### `x` + +```python +x = x +``` + +## `RowColField` + +```python +RowColField(x = None) +``` + +Bases: `Serialisable` + +### `tagname` + +```python +tagname = 'field' +``` + +### `x` + +```python +x = x +``` + +## `RowColItem` + +```python +RowColItem(t = 'data', r = 0, i = 0, x = ()) +``` + +Bases: `Serialisable` + +### `i` + +```python +i = i +``` + +### `r` + +```python +r = r +``` + +### `t` + +```python +t = t +``` + +### `tagname` + +```python +tagname = 'i' +``` + +### `x` + +```python +x = x +``` + +## `RowHierarchiesUsage` + +```python +RowHierarchiesUsage(count = None, rowHierarchyUsage = ()) +``` + +Bases: `Serialisable` + +### `count` + +```python +count +``` + +### `rowHierarchyUsage` + +```python +rowHierarchyUsage = rowHierarchyUsage +``` + +### `tagname` + +```python +tagname = 'rowHierarchiesUsage' +``` + +## `TableDefinition` + +```python +TableDefinition(name = None, cacheId = None, dataOnRows = False, dataPosition = None, dataCaption = None, grandTotalCaption = None, errorCaption = None, showError = False, missingCaption = None, showMissing = True, pageStyle = None, pivotTableStyle = None, vacatedStyle = None, tag = None, updatedVersion = 0, minRefreshableVersion = 0, asteriskTotals = False, showItems = True, editData = False, disableFieldList = False, showCalcMbrs = True, visualTotals = True, showMultipleLabel = True, showDataDropDown = True, showDrill = True, printDrill = False, showMemberPropertyTips = True, showDataTips = True, enableWizard = True, enableDrill = True, enableFieldProperties = True, preserveFormatting = True, useAutoFormatting = False, pageWrap = 0, pageOverThenDown = False, subtotalHiddenItems = False, rowGrandTotals = True, colGrandTotals = True, fieldPrintTitles = False, itemPrintTitles = False, mergeItem = False, showDropZones = True, createdVersion = 0, indent = 1, showEmptyRow = False, showEmptyCol = False, showHeaders = True, compact = True, outline = False, outlineData = False, compactData = True, published = False, gridDropZones = False, immersive = True, multipleFieldFilters = None, chartFormat = 0, rowHeaderCaption = None, colHeaderCaption = None, fieldListSortAscending = None, mdxSubqueries = None, customListSort = None, autoFormatId = None, applyNumberFormats = False, applyBorderFormats = False, applyFontFormats = False, applyPatternFormats = False, applyAlignmentFormats = False, applyWidthHeightFormats = False, location = None, pivotFields = (), rowFields = (), rowItems = (), colFields = (), colItems = (), pageFields = (), dataFields = (), formats = (), conditionalFormats = None, chartFormats = (), pivotHierarchies = (), pivotTableStyleInfo = None, filters = (), rowHierarchiesUsage = None, colHierarchiesUsage = None, extLst = None, id = None) +``` + +Bases: `Serialisable` + +### `applyAlignmentFormats` + +```python +applyAlignmentFormats = applyAlignmentFormats +``` + +### `applyBorderFormats` + +```python +applyBorderFormats = applyBorderFormats +``` + +### `applyFontFormats` + +```python +applyFontFormats = applyFontFormats +``` + +### `applyNumberFormats` + +```python +applyNumberFormats = applyNumberFormats +``` + +### `applyPatternFormats` + +```python +applyPatternFormats = applyPatternFormats +``` + +### `applyWidthHeightFormats` + +```python +applyWidthHeightFormats = applyWidthHeightFormats +``` + +### `asteriskTotals` + +```python +asteriskTotals = asteriskTotals +``` + +### `autoFormatId` + +```python +autoFormatId = autoFormatId +``` + +### `cache` + +```python +cache = None +``` + +### `cacheId` + +```python +cacheId = cacheId +``` + +### `chartFormat` + +```python +chartFormat = chartFormat +``` + +### `chartFormats` + +```python +chartFormats = chartFormats +``` + +### `colFields` + +```python +colFields = colFields +``` + +### `colGrandTotals` + +```python +colGrandTotals = colGrandTotals +``` + +### `colHeaderCaption` + +```python +colHeaderCaption = colHeaderCaption +``` + +### `colHierarchiesUsage` + +```python +colHierarchiesUsage = colHierarchiesUsage +``` + +### `colItems` + +```python +colItems = colItems +``` + +### `compact` + +```python +compact = compact +``` + +### `compactData` + +```python +compactData = compactData +``` + +### `conditionalFormats` + +```python +conditionalFormats = None +``` + +### `createdVersion` + +```python +createdVersion = createdVersion +``` + +### `customListSort` + +```python +customListSort = customListSort +``` + +### `dataCaption` + +```python +dataCaption = dataCaption +``` + +### `dataFields` + +```python +dataFields = dataFields +``` + +### `dataOnRows` + +```python +dataOnRows = dataOnRows +``` + +### `dataPosition` + +```python +dataPosition = dataPosition +``` + +### `disableFieldList` + +```python +disableFieldList = disableFieldList +``` + +### `editData` + +```python +editData = editData +``` + +### `enableDrill` + +```python +enableDrill = enableDrill +``` + +### `enableFieldProperties` + +```python +enableFieldProperties = enableFieldProperties +``` + +### `enableWizard` + +```python +enableWizard = enableWizard +``` + +### `errorCaption` + +```python +errorCaption = errorCaption +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `fieldListSortAscending` + +```python +fieldListSortAscending = fieldListSortAscending +``` + +### `fieldPrintTitles` + +```python +fieldPrintTitles = fieldPrintTitles +``` + +### `filters` + +```python +filters = filters +``` + +### `formats` + +```python +formats = formats +``` + +### `formatted_fields` + +```python +formatted_fields() +``` + +Map fields to associated conditional formats by priority + +### `grandTotalCaption` + +```python +grandTotalCaption = grandTotalCaption +``` + +### `gridDropZones` + +```python +gridDropZones = gridDropZones +``` + +### `id` + +```python +id = id +``` + +### `immersive` + +```python +immersive = immersive +``` + +### `indent` + +```python +indent = indent +``` + +### `itemPrintTitles` + +```python +itemPrintTitles = itemPrintTitles +``` + +### `location` + +```python +location = location +``` + +### `mdxSubqueries` + +```python +mdxSubqueries = mdxSubqueries +``` + +### `mergeItem` + +```python +mergeItem = mergeItem +``` + +### `mime_type` + +```python +mime_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml' +``` + +### `minRefreshableVersion` + +```python +minRefreshableVersion = minRefreshableVersion +``` + +### `missingCaption` + +```python +missingCaption = missingCaption +``` + +### `multipleFieldFilters` + +```python +multipleFieldFilters = multipleFieldFilters +``` + +### `name` + +```python +name = name +``` + +### `outline` + +```python +outline = outline +``` + +### `outlineData` + +```python +outlineData = outlineData +``` + +### `pageFields` + +```python +pageFields = pageFields +``` + +### `pageOverThenDown` + +```python +pageOverThenDown = pageOverThenDown +``` + +### `pageStyle` + +```python +pageStyle = pageStyle +``` + +### `pageWrap` + +```python +pageWrap = pageWrap +``` + +### `path` + +```python +path +``` + +### `pivotFields` + +```python +pivotFields = pivotFields +``` + +### `pivotHierarchies` + +```python +pivotHierarchies = pivotHierarchies +``` + +### `pivotTableStyle` + +```python +pivotTableStyle = pivotTableStyle +``` + +### `pivotTableStyleInfo` + +```python +pivotTableStyleInfo = pivotTableStyleInfo +``` + +### `preserveFormatting` + +```python +preserveFormatting = preserveFormatting +``` + +### `printDrill` + +```python +printDrill = printDrill +``` + +### `published` + +```python +published = published +``` + +### `rel_type` + +```python +rel_type = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable' +``` + +### `rowFields` + +```python +rowFields = rowFields +``` + +### `rowGrandTotals` + +```python +rowGrandTotals = rowGrandTotals +``` + +### `rowHeaderCaption` + +```python +rowHeaderCaption = rowHeaderCaption +``` + +### `rowHierarchiesUsage` + +```python +rowHierarchiesUsage = rowHierarchiesUsage +``` + +### `rowItems` + +```python +rowItems = rowItems +``` + +### `showCalcMbrs` + +```python +showCalcMbrs = showCalcMbrs +``` + +### `showDataDropDown` + +```python +showDataDropDown = showDataDropDown +``` + +### `showDataTips` + +```python +showDataTips = showDataTips +``` + +### `showDrill` + +```python +showDrill = showDrill +``` + +### `showDropZones` + +```python +showDropZones = showDropZones +``` + +### `showEmptyCol` + +```python +showEmptyCol = showEmptyCol +``` + +### `showEmptyRow` + +```python +showEmptyRow = showEmptyRow +``` + +### `showError` + +```python +showError = showError +``` + +### `showHeaders` + +```python +showHeaders = showHeaders +``` + +### `showItems` + +```python +showItems = showItems +``` + +### `showMemberPropertyTips` + +```python +showMemberPropertyTips = showMemberPropertyTips +``` + +### `showMissing` + +```python +showMissing = showMissing +``` + +### `showMultipleLabel` + +```python +showMultipleLabel = showMultipleLabel +``` + +### `subtotalHiddenItems` + +```python +subtotalHiddenItems = subtotalHiddenItems +``` + +### `summary` + +```python +summary +``` + +Provide a simplified summary of the table + +### `tag` + +```python +tag = tag +``` + +### `tagname` + +```python +tagname = 'pivotTableDefinition' +``` + +### `to_tree` + +```python +to_tree() +``` + +### `updatedVersion` + +```python +updatedVersion = updatedVersion +``` + +### `useAutoFormatting` + +```python +useAutoFormatting = useAutoFormatting +``` + +### `vacatedStyle` + +```python +vacatedStyle = vacatedStyle +``` + +### `visualTotals` + +```python +visualTotals = visualTotals +``` + + + + + +# `openpyxl.preserve.chartpatch` + +Targeted patches of series references inside PRESERVED chart parts, and + +## `CHART_NS` + +```python +CHART_NS = b'http://schemas.openxmlformats.org/drawingml/2006/chart' +``` + +## `DRAWING_MAIN_NS` + +```python +DRAWING_MAIN_NS = b'http://schemas.openxmlformats.org/drawingml/2006/main' +``` + +## `XDR_NS` + +```python +XDR_NS = b'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing' +``` + +## `parse_series_range` + +```python +parse_series_range(text) +``` + +(sheet_title, range_part) for a sheet-qualified single-area range; +raises ValueError on anything else (external refs, multi-area, array +literals, unqualified ranges). + +## `patch_chart` + +```python +patch_chart(payload, sheet_title, operation, index, amount) +``` + +(new_payload, changed, blockers): rewrite every chart formula text +referencing ``sheet_title`` per the shift. + +## `patch_chart_rename` + +```python +patch_chart_rename(payload, old_title, new_title) +``` + +Rewrite every chart formula text (``) referencing ``old_title`` +to ``new_title``. Returns the patched payload, or None +when nothing referenced the old title. Refuses when the chart carries +machinery whose references the patch cannot see (the same blocker set +as shift patching). + +## `patch_chart_renames` + +```python +patch_chart_renames(payload, mapping) +``` + +Rewrite chart formula texts through a SIMULTANEOUS title mapping +(title swaps must never merge reference classes). +Returns the patched payload or None when nothing matched. + +## `patch_drawing_anchors` + +```python +patch_drawing_anchors(payload, operation, index, amount) +``` + +(new_payload, changed): move drawing anchor markers with the cells +(from/to row and col elements in the spreadsheetDrawing namespace). + +## `plan_chart_updates` + +```python +plan_chart_updates(wb, sheet_title, operation, index, amount, overrides = None) +``` + +Plan every chart/drawing part patch for a shift on ``sheet_title``. + +Returns (`{part_name: new_payload}`, blockers). Used twice: as a dry run +when the edit is attempted (blockers refuse before any mutation) and for +real at save time. ``overrides`` supplies already-planned payloads so a +part touched by an earlier shift is patched incrementally. + +## `plan_property_edits` + +```python +plan_property_edits(wb, ws, key, armed, current, original, allow_composed_formula_baseline = False) +``` + +A loaded chart's model drifted since arm: express the drift as byte +patches on the ORIGINAL part bytes, or refuse naming the first +property chartpatch cannot express. Expressible: +series/axis formula texts (``) and text runs (`` — titles, +axis titles). Cached series values are left as-is: Excel re-reads +series from cells when it renders the chart. + + + + + +# `openpyxl.preserve.comments` + +Comments on sheets whose original package carries NO comment machinery — + +## `COMMENTS_CONTENT_TYPE` + +```python +COMMENTS_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml' +``` + +## `VML_CONTENT_TYPE` + +```python +VML_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.vmlDrawing' +``` + +## `comment_anchors_precede_shift` + +```python +comment_anchors_precede_shift(zin, sheet_part, names, axis, index) +``` + +Whether every source note anchor is wholly before one shift. + +## `comment_machinery_kind` + +```python +comment_machinery_kind(zin, sheet_part, names) +``` + +Classify a sheet's comment and VML relationships. + +**Parameters:** + +- **zin** (`ZipFile`) – Open workbook package. +- **sheet_part** (`str`) – Worksheet part name in the package. +- **names** (`set[str]`) – Part names present in the package. + +**Returns:** + +- `str | None` – ``"comments"``, ``"other-vml"``, or ``None``. + +## `plan_comment_creation` + +```python +plan_comment_creation(wb, ws, sheet_part, zin, part_plan, names) +``` + +Create the comments + VML parts for one comment-free sheet; returns +the crafted bytes for the region splice. + +## `sheet_has_comment_machinery` + +```python +sheet_has_comment_machinery(zin, sheet_part, names) +``` + +True only for comment relationships or VML note shapes. + + + + + +# `openpyxl.preserve.crosscheck` + +Cross-check the splice output against the ledger's claims. + +## `LedgerCrossCheckError` + +Bases: `RuntimeError` + +The splice changed cells the ledger never recorded. + +## `verify_splice` + +```python +verify_splice(source_bytes, output_bytes, dirty_by_part, baselines = None, region_claims = None, row_claims = None) +``` + +Assert that in every spliced part, the set of semantically changed +cells is a subset of the ledger's dirty claims — and +that no region the saver didn't claim differs, and no row's display +attributes/multiplicity change outside the claimed rows. + +``baselines`` maps parts to their post-shift bytes: those +parts are checked against the renumbered baseline (the renumber pass is +covered by its own tests and the oracle property tests). +``region_claims`` maps parts to the region tags the saver knowingly +rewrote; an unclaimed region that differs is corruption inside the +safety tooling, exactly like an unclaimed cell. +``row_claims`` maps parts to row indices whose display attributes the +saver knowingly rewrote; rows holding dirty cells are implicitly +allowed (the splice recomputes their spans/attrs when rebuilding). + + + + + +# `openpyxl.preserve.crosspart` + +Targeted edits to non-worksheet parts under preserve mode. + +## `CT_STYLESHEET_INDEX` + +```python +CT_STYLESHEET_INDEX = {tag: i for i, tag in enumerate(CT_STYLESHEET_ORDER)} +``` + +## `CT_STYLESHEET_ORDER` + +```python +CT_STYLESHEET_ORDER = ['numFmts', 'fonts', 'fills', 'borders', 'cellStyleXfs', 'cellXfs', 'cellStyles', 'dxfs', 'tableStyles', 'colors', 'extLst'] +``` + +## `CT_WORKBOOK_INDEX` + +```python +CT_WORKBOOK_INDEX = {tag: i for i, tag in enumerate(CT_WORKBOOK_ORDER)} +``` + +## `CT_WORKBOOK_ORDER` + +```python +CT_WORKBOOK_ORDER = ['fileVersion', 'fileSharing', 'workbookPr', 'workbookProtection', 'bookViews', 'sheets', 'functionGroups', 'externalReferences', 'definedNames', 'calcPr', 'oleSize', 'customWorkbookViews', 'pivotCaches', 'smartTagPr', 'smartTagTypes', 'webPublishing', 'fileRecoveryPr', 'webPublishObjects', 'extLst'] +``` + +## `Node` + +```python +Node(name, start) +``` + +### `attrs` + +```python +attrs = {} +``` + +### `children` + +```python +children = [] +``` + +### `content_end` + +```python +content_end = None +``` + +### `content_start` + +```python +content_start = None +``` + +### `end` + +```python +end = None +``` + +### `local` + +```python +local() +``` + +### `name` + +```python +name = name +``` + +### `self_closing` + +```python +self_closing = False +``` + +### `start` + +```python +start = start +``` + +## `WB_SPLICEABLE` + +```python +WB_SPLICEABLE = {'definedNames', 'calcPr', 'bookViews'} +``` + +## `apply_edits` + +```python +apply_edits(data, edits) +``` + +Apply sorted, non-overlapping (start, end, replacement) edits. + +## `ct_append_defaults` + +```python +ct_append_defaults(data, defaults) +``` + +Append Default entries; ``defaults`` = [(extension, content_type)]. +Callers check for existing extensions first (duplicates are illegal). + +## `ct_append_overrides` + +```python +ct_append_overrides(data, overrides) +``` + +Append Override entries; ``overrides`` = [(part_name, content_type)]. + +## `ct_remove_override` + +```python +ct_remove_override(data, part_name) +``` + +Remove the Override for ``part_name``; no-op when absent. + +## `plan_styles_xml` + +```python +plan_styles_xml(wb, led, original, translator) +``` + +New styles.xml bytes appending the styles created since arming, or +None when nothing was added. Never rewrites existing entries. + +Fonts/fills/borders/dxfs come from the MODEL tails (their numbering is +file-stable at load: seeded in file order, never renumbered). Cell xfs +and custom number formats come from the `StyleTranslator`, which +owns the model-to-file numbering translation. + +## `plan_workbook_xml` + +```python +plan_workbook_xml(wb, led, original, new_sheet_entries, force_tags = ()) +``` + +New workbook.xml bytes, or None if nothing changes. + +``new_sheet_entries``: [(title, sheet_id, rid, state)] for added sheets. +``force_tags``: spliceable elements re-rendered even when the arm-vs-save +diff sees no change (the recalc-on-load flag: the model defaults it, so +only a forced re-render can write it into files that lack it). +Raises for changes outside the v0-spliceable set. + +## `rels_append` + +```python +rels_append(data, entries) +``` + +Append relationship entries: [(rId, type, target, target_mode|None)]. + +## `rels_next_rid` + +```python +rels_next_rid(data) +``` + +## `rels_remove_by_target_suffix` + +```python +rels_remove_by_target_suffix(data, suffix) +``` + +Remove relationships whose Target ends with ``suffix``. + +## `render_rels_document` + +```python +render_rels_document(entries) +``` + +A whole new .rels part (for sheets that had none). + +## `render_workbook_elements` + +```python +render_workbook_elements(wb) +``` + +Per-element model renders of workbook.xml (self-consistent between +arm and save; 'sheets' is compared structurally, not by render). + +## `scan_small` + +```python +scan_small(data, expected_root, max_depth = 3, *, allow_prefixed_root = False) +``` + +Compact span scanner for small XML parts (workbook.xml, styles.xml, +[Content_Types].xml, rels). Records children down to ``max_depth``. +Refuses prefixed roots unless a caller has independently validated the +expanded root name and explicitly opts in. + + + + + +# `openpyxl.preserve.diffreport` + +Compare two workbook packages cell-wise, classifying differences as + +## `DiffReport` + +```python +DiffReport(changed, shifted, added_sheets, removed_sheets) +``` + +### `SCHEMA` + +```python +SCHEMA = 'workbook_diff' +``` + +### `VERSION` + +```python +VERSION = 1 +``` + +### `added_sheets` + +```python +added_sheets = added_sheets +``` + +### `changed` + +```python +changed = changed +``` + +### `removed_sheets` + +```python +removed_sheets = removed_sheets +``` + +### `shifted` + +```python +shifted = shifted +``` + +### `to_dict` + +```python +to_dict() +``` + +## `diff_workbooks` + +```python +diff_workbooks(a, b, remaps = ()) +``` + +A cell-level report of how package ``b`` differs from ``a`` +(paths, bytes, or file-likes). ``remaps``: AddressRemap chain from +the structural edits performed between the two states — differences +explained by a remap classify as "shifted", the rest as "changed". + + + + + +# `openpyxl.preserve.drawings` + +Charts and images added in-session become NEW drawing/chart/media parts + +## `CHART_CT` + +```python +CHART_CT = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml' +``` + +## `CHART_REL_TYPE` + +```python +CHART_REL_TYPE = REL_NS + '/chart' +``` + +## `DRAWING_CT` + +```python +DRAWING_CT = 'application/vnd.openxmlformats-officedocument.drawing+xml' +``` + +## `DRAWING_REL_TYPE` + +```python +DRAWING_REL_TYPE = REL_NS + '/drawing' +``` + +## `IMAGE_REL_TYPE` + +```python +IMAGE_REL_TYPE = REL_NS + '/image' +``` + +## `REL_NS` + +```python +REL_NS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships' +``` + +## `SHEET_DRAWING_NS` + +```python +SHEET_DRAWING_NS = 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing' +``` + +## `plan_added_sheet_drawing` + +```python +plan_added_sheet_drawing(workbook, ws, part_plan, names, rel_entries) +``` + +Charts/images on an ADDED sheet: the stock writer emitted +```` into the fresh sheet payload with an empty rel +Target; supply the drawing/chart/media parts and fill the target. +Returns the updated sheet rel entries. + +## `plan_drawing_append` + +```python +plan_drawing_append(workbook, ws, part_plan, names, drawing_part, original, existing_rels, charts, images) +``` + +Charts/images on a LOADED sheet whose drawing already exists: +new anchors appended INTO the original drawing bytes (``original`` may +already carry this save's shift patches) — only when that drawing is +anchor-only. Returns the new drawing payload. + +## `plan_fresh_drawing` + +```python +plan_fresh_drawing(workbook, ws, part_plan, names, sheet_part, original_sheet_rels, charts, images) +``` + +Charts/images on a LOADED sheet with no drawing machinery: +a fresh drawing part via the engine plus ONE spliced element. Returns +the ```` bytes for the region splice. + + + + + +# `openpyxl.preserve.emit` + +Serialize single cells and rows from the model as bare fragments ready to + +## `carry_attributes` + +```python +carry_attributes(new_cell_bytes, original_cell_bytes, drop_metadata = False) +``` + +Attribute-carry rule: re-attach every original cell attribute +the replacement does not intentionally rewrite (everything except r, s, +t). cm/vm rich-value metadata drops ONLY when the cell's VALUE was +overwritten (the cell stops being a rich value) — style-only edits, +move re-emissions and dissolution re-emits must carry it. + +## `carry_start_tag_attributes` + +```python +carry_start_tag_attributes(new_fragment, original_fragment, skip = ()) +``` + +## `emit_cell` + +```python +emit_cell(ws, cell, style_index) +``` + +Bytes of one ```` element, or ``None`` when the model holds +nothing worth serializing (mirrors the stock writer's skip rule). + +``style_index`` is the FILE xf index (StyleTranslator.resolve), or None. + +## `emit_new_row` + +```python +emit_new_row(ws, index, cells_bytes, attrs) +``` + +Bytes of a whole new ```` element (sorted cells already emitted). + +## `patch_cell_style` + +```python +patch_cell_style(original_cell_bytes, style_index) +``` + +## `patch_start_tag_attribute` + +```python +patch_start_tag_attribute(fragment, name, value) +``` + +## `row_start_tag` + +```python +row_start_tag(index, attrs, self_closing = False) +``` + +Bytes of a ```` start tag with the given display attributes. + + + + + +# `openpyxl.preserve.hygiene` + +Report cached error values and broken formula references. + +## `ERROR_TOKENS` + +```python +ERROR_TOKENS = frozenset(EXCEL_ERROR_CODES) +``` + +## `current_titles_by_part` + +```python +current_titles_by_part(wb, zin) +``` + +Map worksheet part names to current live titles. + +## `scan_errors` + +```python +scan_errors(wb) +``` + +Return cached values and actual formula error operands. + + + + + +# `openpyxl.preserve.images` + +Replace one drawing relationship without rewriting the drawing. + +## `plan_replacements` + +```python +plan_replacements(zin, requests, part_plan, names, plan) +``` + +Add replacement media parts and retarget their relationships. + +**Parameters:** + +- **zin** (`ZipFile`) – Open workbook package. +- **requests** (`mapping`) – Validated replacement requests keyed by image identity. +- **part_plan** (`PartPlan`) – Package lifecycle plan to update. +- **names** (`set[str]`) – Part names present in the package. +- **plan** (`dict`) – Planned replacement bytes keyed by part name. + +**Returns:** + +- `None` – ``None``. + +## `request_replacement` + +```python +request_replacement(ws, target, replacement, *, name = None) +``` + +Validate and record one relationship-owned image replacement. + +**Parameters:** + +- **ws** (`Worksheet`) – Worksheet containing the loaded image. +- **target** (`Image | str`) – Loaded image or its anchor coordinate. +- **replacement** (`Image | path - like`) – Replacement image or image source. +- **name** (`str | None`) – Optional image name used to resolve an ambiguous anchor. + +**Returns:** + +- `openpyxl.drawing.image.Image` – The loaded image selected for replacement. + + + + + +# `openpyxl.preserve.inventory` + +Scan a source archive for content the stock save path cannot preserve. + +## `LossInventory` + +```python +LossInventory() +``` + +What a stock save would rebuild lossily or drop, as +``{"kind", "location", "detail"}`` entries. + +### `add` + +```python +add(kind, location, detail) +``` + +### `kinds` + +```python +kinds() +``` + +### `losses` + +```python +losses = [] +``` + +### `render` + +```python +render() +``` + +## `scan_archive` + +```python +scan_archive(archive, valid_files, keep_vba = False, rich_text = False) +``` + +Build a `LossInventory` from an open source ZipFile. + +``valid_files`` is the archive namelist (already computed by the reader). +Read failures on individual entries are recorded loudly, never swallowed +into silence. + + + + + +# `openpyxl.preserve.ledger` + +Records what the object model changed, so the splice save can apply + +## `DirtyLedger` + +```python +DirtyLedger() +``` + +### `added_sheets` + +```python +added_sheets = set() +``` + +### `arm` + +```python +arm(wb, rich_text = False) +``` + +### `armed` + +```python +armed = False +``` + +### `cache_writes` + +```python +cache_writes = {} +``` + +### `cells` + +```python +cells = {} +``` + +### `chartsheet_snapshots` + +```python +chartsheet_snapshots = {} +``` + +### `check_style_registry` + +```python +check_style_registry(wb) +``` + +Refuse if any interned style component that existed at arm time +was mutated in place (the StyleProxy nested-object leak): such a +mutation silently restyles every aliased cell and cannot be +expressed as an append-only styles.xml edit. + +### `comment_snapshots` + +```python +comment_snapshots = {} +``` + +### `core_snapshot` + +```python +core_snapshot = None +``` + +### `custom_snapshot` + +```python +custom_snapshot = None +``` + +### `dirty_coordinates` + +```python +dirty_coordinates(ws) +``` + +### `dxfs_len` + +```python +dxfs_len = 0 +``` + +### `external_links_snapshot` + +```python +external_links_snapshot = () +``` + +### `formulas_changed` + +```python +formulas_changed = False +``` + +### `image_replacements` + +```python +image_replacements = {} +``` + +### `is_loaded_sheet` + +```python +is_loaded_sheet(ws) +``` + +### `loaded_sheet_titles` + +```python +loaded_sheet_titles = frozenset() +``` + +### `mark_cell` + +```python +mark_cell(ws, row, column) +``` + +### `named_styles_len` + +```python +named_styles_len = 0 +``` + +### `object_snapshots` + +```python +object_snapshots = {} +``` + +### `orig_cell_styles_len` + +```python +orig_cell_styles_len = 0 +``` + +### `pinned_regions` + +```python +pinned_regions = {} +``` + +### `pivot_refresh_requests` + +```python +pivot_refresh_requests = set() +``` + +### `pivot_source_snapshots` + +```python +pivot_source_snapshots = {} +``` + +### `protection_warned` + +```python +protection_warned = set() +``` + +### `region_snapshots` + +```python +region_snapshots = {} +``` + +### `removed_sheets` + +```python +removed_sheets = [] +``` + +### `renames` + +```python +renames = {} +``` + +### `rich_text_mode` + +```python +rich_text_mode = False +``` + +### `row_attr_snapshots` + +```python +row_attr_snapshots = {} +``` + +### `sheet_order` + +```python +sheet_order = [] +``` + +### `sheet_states` + +```python +sheet_states = {} +``` + +### `shifts` + +```python +shifts = {} +``` + +### `template_flag` + +```python +template_flag = False +``` + +### `value_overwrites` + +```python +value_overwrites = {} +``` + +### `workbook_snapshot` + +```python +workbook_snapshot = None +``` + +## `allow_sheet_removal` + +```python +allow_sheet_removal(wb, ws) +``` + +Removing a sheet ADDED in this session is a net no-op and allowed; +removing a loaded sheet is refused (returns False). + +## `audit_sheet_removal` + +```python +audit_sheet_removal(wb, ws) +``` + +The reference audit before a LOADED sheet may be removed: anything on ANOTHER sheet pointing at the victim +refuses with the full enumeration — formulas (3-D endpoints and +textual/INDIRECT included), defined names, chart parts, pivot parts. + +## `begin_move_range` + +```python +begin_move_range(ws, move_spec) +``` + +move_range under preserve: expressed as tracked +cell edits (source cleared + destination written — no rows shift, so +no byte renumber). Guards refuse what the move cannot keep coherent: +merges/CF/DV/tables intersecting either rectangle, and formulas +OUTSIDE the moved block referencing the source (Excel's cut-paste +would follow them; we do not rewrite them in this wave). + +## `begin_structural_edit` + +```python +begin_structural_edit(ws, operation, index, amount) +``` + +Gate for insert/delete rows/cols under preserve: shifts +on fully-modeled sheets PROCEED (reference rewriting + byte renumber); +anything with unmodeled range-bearing content refuses with the precise +blocker and victim list. Returns True when the caller must run the +model fixups after mutating. + +## `check_protection` + +```python +check_protection(cell) +``` + +Protection awareness: we report protection, we +never enforce or bypass it. Called BEFORE the value binds (a strict +refusal must be atomic): a write to a locked cell of a protected +sheet warns once per sheet — or refuses under wb.strict_protection. +Scope: value writes (the chokepoint agents hit); style/comment edits +to locked cells are not protection-checked. + +## `diff_objects` + +```python +diff_objects(ws, armed) +``` + +(kind, key) pairs whose settled serialization drifted since arm — +in-session mutations of preserved-part-backed objects. + +## `finish_structural_edit` + +```python +finish_structural_edit(ws, operation, index, amount, transaction = None) +``` + +Model-side reference fixups + snapshot rebasing, after the cells +moved (see structural.apply_model_shift). Returns the pinned +AddressRemap: pre-edit addresses must be remapped +through it, never reused. + +## `mark_cell_dirty` + +```python +mark_cell_dirty(cell, formula_involved = False, value_change = False) +``` + +Called from Cell mutation chokepoints (value bind, style set, +hyperlink/comment/data_type assignment). ``value_change`` marks the +coordinate as a VALUE overwrite — the only case where a cell's cm/vm +rich-value metadata may drop (style-only re-emissions +and dissolution re-emits must carry it). + +## `mark_deleted_cell` + +```python +mark_deleted_cell(ws, row, column, was_formula) +``` + +## `mark_sheet_added` + +```python +mark_sheet_added(wb, ws) +``` + +## `mark_styleable_dirty` + +```python +mark_styleable_dirty(instance) +``` + +Called from the style descriptors; ``instance`` is a Cell or a +row/column dimension (both carry ``.parent`` = worksheet). + +## `record_rename` + +```python +record_rename(sheet_child, new_title) +``` + +Renaming a LOADED sheet: the cascade +rewrite. Model formulas and defined names are rewritten NOW (upstream +rewrites nothing — the model must stay coherent in-session); chart +parts referencing the old name are byte-patched at save; the sheets +entry in workbook.xml gets a name patch keyed by the ORIGINAL title. +Refuses (atomic, before any mutation): textual references the rewrite +cannot see (the old title inside formula STRING literals — the +INDIRECT class), and pivot parts referencing the old name. + +## `record_sheet_removal` + +```python +record_sheet_removal(wb, ws) +``` + +Called by Workbook.remove for a LOADED sheet, AFTER the audit. + +## `refuse_chart_or_image_add` + +```python +refuse_chart_or_image_add(ws, what) +``` + +Call-time gate for add_chart/add_image under preserve: additions are supported on added sheets, on loaded +sheets without drawing machinery (fresh drawing part + one spliced +element), and on loaded sheets whose existing drawing is anchor-only +(anchors appended into the original part). A drawing carrying anything +else refuses NOW — atomically, before the object joins the model. + +## `refuse_sheet_lifecycle` + +```python +refuse_sheet_lifecycle(wb, operation, detail) +``` + +## `refuse_structural_edit` + +```python +refuse_structural_edit(ws, operation, index = None) +``` + +Row/column shifts under preserve are refused in v0, with the precise +list of what the shift would strand: formulas (cross- +sheet included), defined names, CF/DV ranges, merges, tables, and +series ranges inside preserved chart bytes. Raised BEFORE any mutation, +and only when reference rewriting cannot turn the shift into a correct +edit. + +## `render_core_model` + +```python +render_core_model(wb) +``` + +## `render_custom_model` + +```python +render_custom_model(wb) +``` + + + + + +# `openpyxl.preserve.lexical` + +Patch modeled XML changes without reserializing unchanged syntax. + +## `patch_xml` + +```python +patch_xml(original, baseline, current, expected_root) +``` + +Return ``original`` with only model-observed lexical deltas applied. + +``None`` means the edit changed element shape or could not be mapped +unambiguously. Callers may then use a guarded structural fallback, but +must not silently normalize XML that carries unowned content. + +**Parameters:** + +- **original** (`bytes`) – Original XML bytes to preserve. +- **baseline** (`bytes`) – Model serialization captured before editing. +- **current** (`bytes`) – Model serialization after editing. +- **expected_root** (`str`) – Expected local name of the XML root element. + +**Returns:** + +- `bytes | None` – Patched XML bytes, or ``None`` when a safe patch is unavailable. + + + + + +# `openpyxl.preserve.lifecycle` + +One primitive, both directions: every part a save creates or deletes + +## `PartPlan` + +```python +PartPlan(existing_names) +``` + +Adds/removals of whole parts for one save, with their content-type +and relationship consequences planned in lockstep. + +### `add_default` + +```python +add_default(extension, content_type) +``` + +### `add_part` + +```python +add_part(name, payload, content_type = None, relate_from = None, rel_type = None, rel_id = None) +``` + +Plan a new part; returns the allocated relationship id (or +``rel_id`` when given). ``relate_from`` names the part whose rels +must point at the new part (its rels part is created if absent — +the saver resolves ids at apply time via ``resolve_rel_ids``). + +### `added` + +```python +added = {} +``` + +### `apply_content_types` + +```python +apply_content_types(payload) +``` + +### `apply_rels` + +```python +apply_rels(rels_part, payload) +``` + +The updated payload for one rels part (``payload`` is None when +the part does not exist yet — a fresh rels document is built). + +### `ct_defaults` + +```python +ct_defaults = [] +``` + +### `ct_overrides` + +```python +ct_overrides = [] +``` + +### `ct_removals` + +```python +ct_removals = [] +``` + +### `dropped` + +```python +dropped = set() +``` + +### `existing` + +```python +existing = set(existing_names) +``` + +### `rel_appends` + +```python +rel_appends = {} +``` + +### `rel_removals` + +```python +rel_removals = {} +``` + +### `remove_part` + +```python +remove_part(name, referencing_rels = ()) +``` + +Plan a part's removal: dropped from the copy loop, its +content-type override removed, and the named relationships cut. +``referencing_rels`` is [(rels_part, target_suffix)]. + +### `reserve_rid` + +```python +reserve_rid(rels_part, existing_payload) +``` + +Sequential rId allocation shared by every planner touching one +rels part (two independent next_rid computations collide). + +### `touched_rels_parts` + +```python +touched_rels_parts() +``` + + + + + +# `openpyxl.preserve` + +Preserve mode: the original package is the source of truth; the object + +## `AddressRemap` + +```python +AddressRemap(sheet_title, operation, index, amount) +``` + +How one structural edit moved addresses: +every pre-edit address must be remapped through this, never reused. + +``map('Model!B12') -> 'Model!B13'``; addresses whose cells the edit +deleted map to ``None``; addresses on other sheets (or untouched by +the shift) come back unchanged. Accepts bare cells, ranges, and +sheet-qualified forms; ``$`` markers are kept positionally, matching +the rewriter's Excel semantics. + +### `amount` + +```python +amount = amount +``` + +### `index` + +```python +index = index +``` + +### `map` + +```python +map(address) +``` + +### `operation` + +```python +operation = operation +``` + +### `sheet_title` + +```python +sheet_title = sheet_title +``` + +## `copy_format` + +```python +copy_format(ws, src_cell, dst_range) +``` + +Atomically copy one cell's complete cell style onto a finite range. + +The copied style includes font, fill, border, alignment, number format, +and protection. Values, formulas, comments, hyperlinks, validation, row +heights, and column widths are not copied. + +## `diff_workbooks` + +```python +diff_workbooks(a, b, remaps = ()) +``` + +A cell-level report of how package ``b`` differs from ``a`` +(paths, bytes, or file-likes). ``remaps``: AddressRemap chain from +the structural edits performed between the two states — differences +explained by a remap classify as "shifted", the rest as "changed". + +## `receipt` + +```python +receipt(before, after, *, recalc = None, _ledger = None, _workbook = None) +``` + +Build an `EditReceipt` from two package states (paths, +bytes, or binary file-likes). ``recalc``: an oracle result +(RecalcResult/CertificationResult/Evaluation) whose +``to_dict()`` rides along. The result must carry ``artifact_sha256`` +matching ``after``; unbound or cross-workbook verification refuses. + +## `scan_errors` + +```python +scan_errors(wb) +``` + +Return cached values and actual formula error operands. + + + + + +# `openpyxl.preserve.perception` + +Coarse formula-dependency analysis used by model maps and shift guards. + +## `DependencySketch` + +```python +DependencySketch() +``` + +Coarse formula-dependency map: which cells feed which. + +``references`` maps each formula cell (sheet-qualified A1) to the list +of references its formula makes, as (sheet_title, bounds, raw) tuples — +bounds may contain None for open-ended (whole-row/column) ranges. +Structured references that cannot be resolved to cells are listed in +``unresolved`` (treated as always-intersecting). + +### `cells_referencing` + +```python +cells_referencing(sheet_title, bounds) +``` + +Formula cells whose references intersect ``bounds`` on the given +sheet — plus every cell with an unresolved (structured/table) +reference, reported conservatively. + +### `contextual` + +```python +contextual = set() +``` + +### `references` + +```python +references = {} +``` + +### `to_dict` + +```python +to_dict() +``` + +### `unresolved` + +```python +unresolved = {} +``` + +### `volatile` + +```python +volatile = set() +``` + +## `VOLATILE_NONDETERMINISTIC` + +```python +VOLATILE_NONDETERMINISTIC = ('NOW', 'TODAY', 'RAND', 'RANDBETWEEN', 'RANDARRAY', 'CELL', 'INFO') +``` + +## `dependency_sketch` + +```python +dependency_sketch(wb) +``` + +Build a `DependencySketch` from every formula in the model +(tokenizer-based; — coarse is fine). + + + + + +# `openpyxl.preserve.pivots` + +Resolve pivot names and patch only cache refresh metadata. + +## `parts_referencing_sheet` + +```python +parts_referencing_sheet(wb, sheet_title) +``` + +Return local pivot-cache parts that may depend on one worksheet. + +## `plan_refresh` + +```python +plan_refresh(zin, parts, plan) +``` + +Add pivot refresh requests to a package byte plan. + +**Parameters:** + +- **zin** (`ZipFile`) – Open workbook package. +- **parts** (`iterable of str`) – Pivot cache-definition part names to update. +- **plan** (`dict`) – Planned replacement bytes keyed by part name. + +**Returns:** + +- `list of str` – Part names whose refresh metadata changed. + +## `resolve_requests` + +```python +resolve_requests(wb, pivots = None, *, all = False) +``` + +Resolve requested pivots to their cache-definition parts. + +**Parameters:** + +- **wb** (`Workbook`) – Preserve-mode workbook containing the pivots. +- **pivots** (`iterable of str | None`) – Pivot names, optionally qualified by worksheet name. +- **all** (`bool`) – Select every loaded pivot cache instead of named pivots. + +**Returns:** + +- `list of str` – Sorted package part names for the selected pivot caches. + +## `snapshot_sources` + +```python +snapshot_sources(wb) +``` + +Capture semantic local-source bindings when preservation arms. + +## `source_impacts` + +```python +source_impacts(wb, ledger, *, force_recalculation = False) +``` + +Return local pivot caches that workbook edits can make stale. + +## `validate_source_freshness` + +```python +validate_source_freshness(wb, ledger) +``` + +Refuse silent stale pivot caches without explicit refresh consent. + + + + + +# `openpyxl.preserve.receipts` + +One artifact answering "what did that save actually do?": cells-diff + +## `EditReceipt` + +```python +EditReceipt(cells_changed, parts_changed, parts_added, parts_removed, confession, recalc, derived_effects = ()) +``` + +### `SCHEMA` + +```python +SCHEMA = 'edit_receipt' +``` + +### `VERSION` + +```python +VERSION = 2 +``` + +### `cells_changed` + +```python +cells_changed = cells_changed +``` + +### `confession` + +```python +confession = confession +``` + +### `derived_effects` + +```python +derived_effects = list(derived_effects) +``` + +### `parts_added` + +```python +parts_added = parts_added +``` + +### `parts_changed` + +```python +parts_changed = parts_changed +``` + +### `parts_removed` + +```python +parts_removed = parts_removed +``` + +### `recalc` + +```python +recalc = recalc +``` + +### `to_dict` + +```python +to_dict() +``` + +## `receipt` + +```python +receipt(before, after, *, recalc = None, _ledger = None, _workbook = None) +``` + +Build an `EditReceipt` from two package states (paths, +bytes, or binary file-likes). ``recalc``: an oracle result +(RecalcResult/CertificationResult/Evaluation) whose +``to_dict()`` rides along. The result must carry ``artifact_sha256`` +matching ``after``; unbound or cross-workbook verification refuses. + + + + + +# `openpyxl.preserve.references` + +Modeled reference surfaces shared by structural edits and renames. + +## `FormulaSurface` + +```python +FormulaSurface(sheet, owner, attribute, label, *, index = None, name = False, prefix = False, cell = False, range_ref = False) +``` + +A formula-like string with enough context to rewrite it safely. + +### `attribute` + +```python +attribute = attribute +``` + +### `cell` + +```python +cell = cell +``` + +### `index` + +```python +index = index +``` + +### `label` + +```python +label = label +``` + +### `name` + +```python +name = name +``` + +### `owner` + +```python +owner = owner +``` + +### `prefix` + +```python +prefix = prefix +``` + +### `range_ref` + +```python +range_ref = range_ref +``` + +### `replace` + +```python +replace(value) +``` + +### `sheet` + +```python +sheet = sheet +``` + +### `value` + +```python +value +``` + +## `apply_rewrites` + +```python +apply_rewrites(rewrites) +``` + +## `chart_source_ref_objects` + +```python +chart_source_ref_objects(chart) +``` + +Yield every modeled chart reference, including titles and axes. + +## `formula_surfaces` + +```python +formula_surfaces(wb) +``` + +Yield all formula-like references represented by the live model. + +## `plan_rename` + +```python +plan_rename(wb, old_title, new_title) +``` + +Return all modeled reference rewrites for a worksheet rename. + +## `plan_shift` + +```python +plan_shift(wb, target_sheet, operation, index, amount) +``` + +Validate and return every modeled formula rewrite for one shift. + + + + + +# `openpyxl.preserve.regions` + +Fully-modeled worksheet satellite elements: faithful serialization, + +## `CT_ORDER_INDEX` + +```python +CT_ORDER_INDEX = {tag: i for i, tag in enumerate(CT_WORKSHEET_ORDER)} +``` + +## `CT_WORKSHEET_ORDER` + +```python +CT_WORKSHEET_ORDER = ['sheetPr', 'dimension', 'sheetViews', 'sheetFormatPr', 'cols', 'sheetData', 'sheetCalcPr', 'sheetProtection', 'protectedRanges', 'scenarios', 'autoFilter', 'sortState', 'dataConsolidate', 'customSheetViews', 'mergeCells', 'phoneticPr', 'conditionalFormatting', 'dataValidations', 'hyperlinks', 'printOptions', 'pageMargins', 'pageSetup', 'headerFooter', 'rowBreaks', 'colBreaks', 'customProperties', 'cellWatches', 'ignoredErrors', 'smartTags', 'drawing', 'legacyDrawing', 'legacyDrawingHF', 'picture', 'oleObjects', 'controls', 'webPublishItems', 'tableParts', 'extLst'] +``` + +## `DETECT_ONLY_REGIONS` + +```python +DETECT_ONLY_REGIONS = [] +``` + +## `REGION_BY_TAG` + +```python +REGION_BY_TAG = {r.tag: r for r in SPLICEABLE_REGIONS} +``` + +## `Region` + +```python +Region(tag, serialize) +``` + +### `render` + +```python +render(ws) +``` + +### `serialize` + +```python +serialize = serialize +``` + +### `tag` + +```python +tag = tag +``` + +## `SAVER_CRAFTED_REGIONS` + +```python +SAVER_CRAFTED_REGIONS = frozenset(['tableParts', 'legacyDrawing', 'extLst', 'drawing']) +``` + +## `SPLICEABLE_REGIONS` + +```python +SPLICEABLE_REGIONS = [Region('sheetPr', _sheet_pr), Region('sheetViews', _views), Region('sheetFormatPr', _sheet_format), Region('cols', _cols), Region('sheetProtection', _protection), Region('scenarios', _scenarios), Region('autoFilter', _auto_filter), Region('mergeCells', _merged), Region('dataValidations', _validations), Region('printOptions', _print_options), Region('pageMargins', _margins), Region('pageSetup', _page_setup), Region('headerFooter', _header), Region('rowBreaks', _row_breaks), Region('colBreaks', _col_breaks)] +``` + +## `diff_regions` + +```python +diff_regions(ws, armed_snapshot) +``` + +Return `{tag: new_serialization}` for regions the user changed. + +Rendered twice, second pass kept: the arm snapshot is the settled +render (ledger double-render), so the comparison must +be settled-vs-settled or an impure serializer's first-pass output +false-dirties the region. + +## `diff_row_attrs` + +```python +diff_row_attrs(ws, armed_snapshot) +``` + +Return `{row_index: {attr: value}`} for changed rows; a row present in +the arm snapshot but now attribute-free maps to an empty dict. + +## `hyperlink_signatures` + +```python +hyperlink_signatures(ws) +``` + +Per-cell hyperlink signatures, excluding the relationship id (ids for +new links are allocated at save time and must not affect detection). + +## `render_cf_for_write` + +```python +render_cf_for_write(ws) +``` + +Serialize conditional formatting FOR WRITING, mirroring the stock +writer's dxf handling (worksheet/_writer.py write_formatting): rules +carrying a dxf get a dxfId allocated in the workbook's differential +styles; the new dxfs are appended to styles.xml by the styles planner. + +## `render_hyperlinks_for_write` + +```python +render_hyperlinks_for_write(ws) +``` + +The hyperlinks element from the cells' link objects (ids must already +be assigned for external links). + +## `snapshot_regions` + +```python +snapshot_regions(ws) +``` + +Serialize every tracked region of one worksheet (arm time / save +time; comparing the two detects user changes). + +## `snapshot_row_attrs` + +```python +snapshot_row_attrs(ws) +``` + +Row display attributes (they serialize as attributes of +elements inside sheetData, not as a separate element). + + + + + +# `openpyxl.preserve.rewrite` + +Rewrite references for row/column inserts and deletes the way EXCEL + +## `EXCEL_MAX_COL` + +```python +EXCEL_MAX_COL = 16384 +``` + +## `EXCEL_MAX_ROW` + +```python +EXCEL_MAX_ROW = 1048576 +``` + +## `REF_ERROR` + +```python +REF_ERROR = '#REF!' +``` + +## `rename_sheet_in_formula` + +```python +rename_sheet_in_formula(formula, old_title, new_title) +``` + +Rewrite sheet-prefixed references from ``old_title`` to +``new_title`` (case-insensitive, quote-aware, 3-D span endpoints +included). Returns (new_formula, changed). + +## `rename_sheet_in_formula_fragment` + +```python +rename_sheet_in_formula_fragment(value, old_title, new_title) +``` + +## `rename_sheets_in_formula` + +```python +rename_sheets_in_formula(formula, mapping) +``` + +Simultaneous multi-title rewrite: every sheet component maps +through ``mapping`` (casefold keys resolved per component) exactly +once — a swap can never cascade. + +## `rename_sheets_in_formula_fragment` + +```python +rename_sheets_in_formula_fragment(value, mapping) +``` + +Rename sheet references in a CF/DV formula with optional ``=``. + +## `row_mapping` + +```python +row_mapping(operation, index, amount) +``` + +old_row -> new_row, or None when the row is deleted. + +## `shift_cell_range` + +```python +shift_cell_range(cell_range, axis, index, amount, is_delete) +``` + +Shift a CellRange in place. Returns 'changed', 'unchanged' or +'deleted' (range fully inside a deleted zone — the caller removes it). + +## `shift_formula` + +```python +shift_formula(formula, context_sheet, target_sheet, axis, index, amount, is_delete) +``` + +Rewrite one formula for a shift on ``target_sheet``. + +``context_sheet`` is the sheet the formula lives on (unprefixed +references resolve to it). Returns (new_formula, changed). + +## `shift_formula_fragment` + +```python +shift_formula_fragment(value, context_sheet, target_sheet, axis, index, amount, is_delete) +``` + +Rewrite a CF/DV formula, which may legally omit the leading ``=``. + +## `shift_name_value` + +```python +shift_name_value(value, target_sheet, axis, index, amount, is_delete) +``` + +Defined-name / print-area values are formula fragments with explicit +sheet prefixes; rewrite them with the same machinery. + +## `shift_ref` + +```python +shift_ref(ref, axis, index, amount, is_delete) +``` + +Shift one bare A1 reference (no sheet prefix). Returns the new text, +``ref`` unchanged when unaffected, or ``#REF!``. ``$`` markers are kept +positionally — insert/delete moves absolutes too (Excel semantics). + +## `title_in_string_literals` + +```python +title_in_string_literals(formula, title) +``` + +True when a formula's STRING literals mention ``title`` — the +textual (INDIRECT-style) references a rename cannot rewrite. + + + + + +# `openpyxl.preserve.saver` + +Save dispatch target for preserve-mode workbooks. + +## `save_preserved` + +```python +save_preserved(workbook, target, *, allow_formula_loss = False) +``` + +Plan and deliver without retaining serializer side effects. + +## `validate_preserved` + +```python +validate_preserved(workbook, *, allow_formula_loss = False) +``` + +Run the exact preserve save planner without assembling an archive. + +Serializer helpers used during planning can mutate model registries, so +validation uses the same planning-state guard as delivery and restores the +workbook before returning or raising. + +**Parameters:** + +- **workbook** (`Workbook`) – Preserve-mode workbook to validate. +- **allow_formula_loss** (`bool`) – Allow edited cached values to replace formulas. + +**Returns:** + +- `None` – ``None``. + + + + + +# `openpyxl.preserve.sourceio` + +Read package sources without imposing workbook eligibility caps. + +## `read_source_bytes` + +```python +read_source_bytes(source, *, context = 'workbook package') +``` + +Read package bytes while preserving a seekable stream's position. + +**Parameters:** + +- **source** (`bytes | path-like | binary file-like`) – Package bytes, path, or seekable binary stream. +- **context** (`str`) – Name used in source validation errors. + +**Returns:** + +- `bytes` – Complete package contents. + + + + + +# `openpyxl.preserve.splice` + +Apply ledger-recorded edits to one original worksheet part, byte-wise. + +## `SpliceRefusal` + +Bases: `UnsupportedStructureError` + +## `resolve_dirty_cells` + +```python +resolve_dirty_cells(ws, ledger_dirty, scan, value_overwrites = frozenset()) +``` + +The effective dirty-coordinate set for one sheet. + +- rich-text cells are always dirty (in-place edits bypass every hook); +- a dirty cell intersecting a shared-formula group dissolves the WHOLE + group: every member re-emits as a plain formula from the model (the + model already holds the expanded formulas); +- a dirty cell intersecting an array formula refuses; +- a dirty cell carrying cm/vm metadata or unexpected children refuses. + +## `splice_sheet` + +```python +splice_sheet(ws, original, dirty_cells, region_changes, row_attr_changes, scan = None, cf_replacement = None, hyperlinks_replacement = None, style_resolver = None, value_overwrites = frozenset(), cache_writes = None, cache_invalidations = None) +``` + +Return the new part payload for one worksheet. + +``dirty_cells``: resolved coordinate set (see resolve_dirty_cells). +``region_changes``: `{tag: serialized bytes or None}` — user-changed +satellite regions (None = region now absent). +``row_attr_changes``: `{row_index: {attr: value}`} — changed row display +attributes. +``scan``: a SheetScan of ``original`` if the caller already has one. +``cf_replacement``: bytes replacing ALL conditionalFormatting elements +(gated by the caller; may be b"" to remove them). +``hyperlinks_replacement``: bytes replacing the hyperlinks element. +``style_resolver``: cell -> FILE xf index (StyleTranslator) — +model style indices must never reach the spliced bytes. +``cache_writes``: `{(row, col): computed_value}` — cached-value updates +for untouched formula cells in a preserved recalc candidate: the + bytes stay verbatim, only the cached (and its t attribute) +change. +``cache_invalidations``: `{(row, col)}` — formula cells and array followers +whose cached must be removed because results are uncertified. + + + + + +# `openpyxl.preserve.structural` + +Analyze what a row/column shift would strand. + +## `AddressRemap` + +```python +AddressRemap(sheet_title, operation, index, amount) +``` + +How one structural edit moved addresses: +every pre-edit address must be remapped through this, never reused. + +``map('Model!B12') -> 'Model!B13'``; addresses whose cells the edit +deleted map to ``None``; addresses on other sheets (or untouched by +the shift) come back unchanged. Accepts bare cells, ranges, and +sheet-qualified forms; ``$`` markers are kept positionally, matching +the rewriter's Excel semantics. + +### `amount` + +```python +amount = amount +``` + +### `index` + +```python +index = index +``` + +### `map` + +```python +map(address) +``` + +### `operation` + +```python +operation = operation +``` + +### `sheet_title` + +```python +sheet_title = sheet_title +``` + +## `EXCEL_MAX_COL` + +```python +EXCEL_MAX_COL = 16384 +``` + +## `EXCEL_MAX_ROW` + +```python +EXCEL_MAX_ROW = 1048576 +``` + +## `MAX_COL` + +```python +MAX_COL = 1 << 20 +``` + +## `MAX_ROW` + +```python +MAX_ROW = 1 << 22 +``` + +## `STOCK_WARNING` + +```python +STOCK_WARNING = '{0}() moves cells but updates NOTHING that points at them: formulas keep their old ranges, defined names and chart series keep their old cells — the numbers that come out will look plausible and be wrong. Open the file with preserve=True to get a safety analysis instead.' +``` + +## `StructuralEditTransaction` + +```python +StructuralEditTransaction(ws, operation, warn_protection = False, reference_rewrites = ()) +``` + +In-memory rollback boundary for a preserve-mode row/column shift. + +### `commit` + +```python +commit() +``` + +### `operation` + +```python +operation = operation +``` + +### `reference_rewrites` + +```python +reference_rewrites = tuple(reference_rewrites) +``` + +### `rollback` + +```python +rollback() +``` + +### `warn_protection` + +```python +warn_protection = warn_protection +``` + +### `ws` + +```python +ws = ws +``` + +## `analyze_shift` + +```python +analyze_shift(ws, kind, index) +``` + +Everything a shift would strand, as human-readable impact lines. + +## `apply_model_shift` + +```python +apply_model_shift(ws, operation, index, amount, reference_rewrites = None) +``` + +All the reference updates stock openpyxl skips, applied to the MODEL +after the cells moved (Excel insert/delete semantics via rewrite.py). +Also rebases the positional arm snapshots so pure moves are not +mis-detected as user changes. + +## `apply_shift_to_bytes` + +```python +apply_shift_to_bytes(original, operation, index, amount) +``` + +The byte-level renumber pre-transform: deleted rows are cut; shifted +rows get their r attributes (row and cells) rewritten; every other byte +— cell contents, unmodeled attributes, spans — is copied verbatim. The +result becomes the baseline the standard splice runs against. + +## `shift_blockers` + +```python +shift_blockers(ws, operation, index, amount = 1) +``` + +Content that makes a shift unsafe to REWRITE in v0 — anything whose +references live outside the fully-modeled set. A non-empty result means +refusal (with analyze_shift providing the victim list). + +## `shift_bounds` + +```python +shift_bounds(kind, index) +``` + +The cell region a shift at ``index`` moves or destroys: everything +at or after the index (deletes also destroy the range itself). + +## `validate_model_shift` + +```python +validate_model_shift(ws, operation, index, amount) +``` + +Dry-run every modeled formula reference before cells are moved. + + + + + +# `openpyxl.preserve.styletrans` + +Translate the model's style indices into the ORIGINAL file's xf indices. + +## `StyleTranslator` + +```python +StyleTranslator(wb, original_styles_bytes) +``` + +### `file_xf_count` + +```python +file_xf_count = len(file_arrays) +``` + +### `model_to_file_table` + +```python +model_to_file_table() +``` + +`{model index: file index}` for every current model array — used to +rewrite the s attributes of freshly generated (added-sheet) parts. + +### `render_new_numfmts` + +```python +render_new_numfmts() +``` + +Serialized elements allocated during xf rendering. + +### `render_new_xfs` + +```python +render_new_xfs() +``` + +Serialized elements for the appended entries (mirrors +styles/stylesheet.py write_stylesheet), numFmtIds in FILE numbering. +Call after every resolve() — i.e. after all sheets are planned. + +### `resolve` + +```python +resolve(style_array) +``` + +The FILE xf index for a model StyleArray (allocating an appended +xf when the file has no equivalent). + +### `resolver` + +```python +resolver() +``` + +A per-cell callable for the splice writer. + + + + + +# `openpyxl.preserve.styleverbs` + +Small preserve-aware helpers for explicit formatting operations. + +## `copy_format` + +```python +copy_format(ws, src_cell, dst_range) +``` + +Atomically copy one cell's complete cell style onto a finite range. + +The copied style includes font, fill, border, alignment, number format, +and protection. Values, formulas, comments, hyperlinks, validation, row +heights, and column widths are not copied. + + + + + +# `openpyxl.preserve.tables` + +Loaded-table mutation, and the table row discipline. + +## `TABLE_CONTENT_TYPE` + +```python +TABLE_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml' +``` + +## `append_table_row` + +```python +append_table_row(ws, table_name, values) +``` + +Atomically append one row to a supported named worksheet table. + +The operation plans values, calculated columns, styles, totals movement, +protection, table geometry, and retained OOXML before changing the model. +Unsupported connected, extended, merged, spill, sorted, or ambiguous table +states raise a typed refusal and leave the workbook unchanged. + +**Parameters:** + +- **ws** (`Worksheet`) – Worksheet containing the table. +- **table_name** (`str`) – Name of the table to expand. +- **values** (`iterable | mapping`) – Row values as a sequence or column-name mapping. + +**Returns:** + +- `None` – ``None``. + +## `plan_table_lifecycle` + +```python +plan_table_lifecycle(wb, ws, sheet_part, zin, armed_names, plan, part_plan, names) +``` + +Plan table ADD/REMOVE for one sheet: parts via the engine, the +sheet's tableParts element rebuilt as crafted bytes (returned; the +caller rides them through the region splice). ``armed_names`` is the +arm-time tuple of table names. + +## `plan_table_mutations` + +```python +plan_table_mutations(wb, ws, sheet_part, zin, changed_names, plan, armed_tables = None) +``` + +Patch each changed loaded table into its ORIGINAL part. + +## `sheet_table_parts` + +```python +sheet_table_parts(zin, sheet_part) +``` + +`{displayName: (part_name, original_bytes)}` for one sheet, resolved +through the ORIGINAL rels (producers number table parts arbitrarily — +Table.path's id-derived guess is not trustworthy). + +## `validate_table` + +```python +validate_table(tbl, original_ref) +``` + +Geometry guards, against the ORIGINAL ref. + + + + + +# `openpyxl.preserve.validation` + +Read deterministic list data-validation values for a worksheet cell. + +## `allowed_values` + +```python +allowed_values(ws, cell) +``` + +Return deterministic list-validation values covering ``cell``. + +``None`` means no list validation covers the cell. A matching validation +whose vocabulary cannot be reported exactly raises a typed refusal. +Blank cells in a static source range are returned as ``None`` entries. + +**Parameters:** + +- **ws** (`Worksheet`) – Worksheet containing the validated cell. +- **cell** (`Cell | str`) – Cell object or coordinate to inspect. + +**Returns:** + +- `list | None` – Allowed values, or ``None`` when no list validation applies. + + + + + +# `openpyxl.preserve.x14` + +Conditional-formatting edits on sheets whose rules carry x14 twins. + +## `check_dv_coexistence` + +```python +check_dv_coexistence(ws, scan, original) +``` + +Refuse only when a classic DV range intersects an x14 DV range — +otherwise classic edits proceed and the x14 block stays verbatim. + +## `plan_cf_composed` + +```python +plan_cf_composed(wb, ws, scan, original, armed_blocks) +``` + +(classic_cf_replacement_bytes, extlst_replacement_or_None). + +``armed_blocks``: the arm-time model renders (regions._render_cf +tuple), positionally corresponding to the original document's classic +CF elements. + +## `sheet_has_cf_twins` + +```python +sheet_has_cf_twins(scan, original) +``` + +True when classic rules carry twin pointers or the extLst carries +x14 conditional formattings. + + + + + +# `openpyxl.preserve.xmlscan` + +Namespace-tracking streaming scanner over ORIGINAL worksheet XML bytes. + +## `CellSpan` + +```python +CellSpan(row, column, start) +``` + +### `array_ref` + +```python +array_ref = None +``` + +### `attrs` + +```python +attrs +``` + +### `column` + +```python +column = column +``` + +### `end` + +```python +end = None +``` + +### `has_extlst` + +```python +has_extlst = False +``` + +### `has_formula` + +```python +has_formula = False +``` + +### `has_unowned_children` + +```python +has_unowned_children = False +``` + +### `row` + +```python +row = row +``` + +### `shared_ref` + +```python +shared_ref = None +``` + +### `shared_si` + +```python +shared_si = None +``` + +### `start` + +```python +start = start +``` + +## `RegionSpan` + +```python +RegionSpan(tag, start) +``` + +### `end` + +```python +end = None +``` + +### `raw` + +```python +raw = None +``` + +### `start` + +```python +start = start +``` + +### `tag` + +```python +tag = tag +``` + +## `RowSpan` + +```python +RowSpan(index, start) +``` + +### `attrs` + +```python +attrs = {} +``` + +### `cells` + +```python +cells = {} +``` + +### `content_end` + +```python +content_end = None +``` + +### `content_start` + +```python +content_start = None +``` + +### `end` + +```python +end = None +``` + +### `index` + +```python +index = index +``` + +### `self_closing` + +```python +self_closing = False +``` + +### `start` + +```python +start = start +``` + +## `ScanRefusal` + +Bases: `UnsupportedStructureError` + +The original sheet XML uses a construction the splice cannot edit +safely; the save refuses before writing anything. + +## `SheetScan` + +```python +SheetScan(data) +``` + +Result of scanning one worksheet part. + +### `array_bounds` + +```python +array_bounds = [] +``` + +### `array_refs` + +```python +array_refs = [] +``` + +### `cache_names` + +```python +cache_names = {} +``` + +### `data` + +```python +data = data +``` + +### `formula_names` + +```python +formula_names = {} +``` + +### `region_order` + +```python +region_order = [] +``` + +### `regions` + +```python +regions = {} +``` + +### `root_end_offset` + +```python +root_end_offset = None +``` + +### `row_order` + +```python +row_order = [] +``` + +### `rows` + +```python +rows = {} +``` + +### `rows_monotonic` + +```python +rows_monotonic = True +``` + +### `shared_groups` + +```python +shared_groups = {} +``` + +### `shared_members` + +```python +shared_members = {} +``` + +### `sheetdata` + +```python +sheetdata = None +``` + +### `sheetdata_content` + +```python +sheetdata_content = None +``` + +## `scan_sheet` + +```python +scan_sheet(data) +``` + +Scan one worksheet part's bytes into a `SheetScan`. + +Raises `ScanRefusal` for constructions the splice must not touch. + + + + + +# `openpyxl.preserve.zipguard` + +## `LargeZipFile` + +```python +LargeZipFile = zipfile.LargeZipFile +``` + +## `validate_archive` + +```python +validate_archive(archive, *, context = 'preserve-mode package') +``` + +Validate one ZIP before any workbook model is constructed. + +## `validate_package_bytes` + +```python +validate_package_bytes(data, *, context = 'workbook package') +``` + + + + + +# `openpyxl.preserve.zipio` + +Zip-layer machinery for the preserve-mode save. + +## `FIXED_DATE_TIME` + +```python +FIXED_DATE_TIME = (1980, 1, 1, 0, 0, 0) +``` + +## `PathIdentity` + +```python +PathIdentity(requested: str, resolved: str, entry: object, occupant: object, digest: object) -> None +``` + +Content-bound identity of one pathname and its resolved occupant. + +### `digest` + +```python +digest: object +``` + +### `entry` + +```python +entry: object +``` + +### `exists` + +```python +exists +``` + +### `occupant` + +```python +occupant: object +``` + +### `requested` + +```python +requested: str +``` + +### `resolved` + +```python +resolved: str +``` + +## `RAW_COPY_AVAILABLE` + +```python +RAW_COPY_AVAILABLE = _probe_private_zipfile_api() +``` + +## `build_and_deliver` + +```python +build_and_deliver(build_fn, target, *, expected_identity = None, validator = None, precommit = None, postcommit = None) +``` + +Build the archive DIRECTLY into the delivery temp file for path +targets (~1x file-size peak memory instead of +a whole in-memory copy), atomically replaced and fsynced; exact +``io.BytesIO`` targets keep the in-memory build. + +## `build_archive_bytes` + +```python +build_archive_bytes(build) +``` + +Run ``build(zout)`` against an in-memory archive; return its bytes. + +## `copy_entry` + +```python +copy_entry(zin, info, zout) +``` + +Copy one entry from ``zin`` into ``zout``, raw when possible. + +Payload bytes are identical either way; the raw path also preserves the +compressed stream. Entry metadata is normalized for determinism. + +## `deliver` + +```python +deliver(data, target, *, expected_identity = None, validator = None, precommit = None, postcommit = None) +``` + +Deliver bytes to a path or supported transactional in-memory handle. + +Path targets: temp file in the same directory + ``os.replace`` — the +original survives any mid-write crash (never in-place truncation). +An exact ``io.BytesIO`` receives one built-in state replacement. A verified +path-backed ``io.BufferedRandom`` is rebound around the same temp-file +replacement used for paths. Arbitrary streams are refused because their +write and rollback behavior cannot be proven atomic. + +## `path_identity` + +```python +path_identity(path, *, allow_missing = False) +``` + +Capture a stable, content-bound identity for ``path``. + +## `raw_copy_supported` + +```python +raw_copy_supported(info) +``` + +D10 guards: data-descriptor entries (GP flag bit 3), zip64-sized +entries, and exotic compression methods take the recompression fallback. + +## `read_path_handle_snapshot` + +```python +read_path_handle_snapshot(handle, *, context = 'preserve-mode workbook') +``` + +Return a stable snapshot for a named regular-file handle, or None. + +## `read_path_snapshot` + +```python +read_path_snapshot(path, *, context = 'preserve-mode workbook') +``` + +Read one stable regular-file snapshot and its path identity. + +## `validate_target` + +```python +validate_target(target) +``` + +Refuse unsupported file-like destinations before archive planning. + +## `write_entry` + +```python +write_entry(zout, name, payload, compress_type = zipfile.ZIP_DEFLATED) +``` + +Write one entry with deterministic metadata. + + + + + +# `openpyxl.reader.drawings` + +## `find_images` + +```python +find_images(archive, path) +``` + +Given the path to a drawing file extract charts and images + +Ignore errors due to unsupported parts of DrawingML + + + + + +# `openpyxl.reader.excel` + +Read an xlsx file into Python + +## `ExcelReader` + +```python +ExcelReader(fn, read_only = False, keep_vba = KEEP_VBA, data_only = False, keep_links = True, rich_text = False, *, preserve = False) +``` + +Read an Excel package and dispatch the contents to the relevant modules + +### `archive` + +```python +archive = _validate_archive(fn, preserve=preserve) +``` + +### `data_only` + +```python +data_only = data_only +``` + +### `keep_links` + +```python +keep_links = keep_links +``` + +### `keep_vba` + +```python +keep_vba = keep_vba +``` + +### `preserve` + +```python +preserve = preserve +``` + +### `read` + +```python +read() +``` + +### `read_chartsheet` + +```python +read_chartsheet(sheet, rel) +``` + +### `read_custom` + +```python +read_custom() +``` + +### `read_manifest` + +```python +read_manifest() +``` + +### `read_only` + +```python +read_only = read_only +``` + +### `read_properties` + +```python +read_properties() +``` + +### `read_strings` + +```python +read_strings() +``` + +### `read_theme` + +```python +read_theme() +``` + +### `read_workbook` + +```python +read_workbook() +``` + +### `read_worksheets` + +```python +read_worksheets() +``` + +### `rich_text` + +```python +rich_text = rich_text +``` + +### `shared_strings` + +```python +shared_strings = [] +``` + +### `valid_files` + +```python +valid_files = self.archive.namelist() +``` + +## `KEEP_VBA` + +```python +KEEP_VBA = os.environ.get('OPENPYXL_KEEP_VBA', 'False') == 'True' +``` + +## `ReadOnlyWorksheet` + +```python +ReadOnlyWorksheet(parent_workbook, title, worksheet_path, shared_strings) +``` + +### `calculate_dimension` + +```python +calculate_dimension(force = False) +``` + +### `cell` + +```python +cell = Worksheet.cell +``` + +### `defined_names` + +```python +defined_names = DefinedNameDict() +``` + +### `iter_rows` + +```python +iter_rows = Worksheet.iter_rows +``` + +### `max_column` + +```python +max_column +``` + +### `max_row` + +```python +max_row +``` + +### `min_column` + +```python +min_column +``` + +### `min_row` + +```python +min_row +``` + +### `parent` + +```python +parent = parent_workbook +``` + +### `reset_dimensions` + +```python +reset_dimensions() +``` + +Remove worksheet dimensions if these are incorrect in the worksheet source. +NB. This probably indicates a bug in the library or application that created +the workbook. + +### `rows` + +```python +rows = Worksheet.rows +``` + +### `sheet_state` + +```python +sheet_state = 'visible' +``` + +### `title` + +```python +title = title +``` + +### `values` + +```python +values = Worksheet.values +``` + +## `SUPPORTED_FORMATS` + +```python +SUPPORTED_FORMATS = ('.xlsx', '.xlsm', '.xltx', '.xltm') +``` + +## `WorksheetReader` + +```python +WorksheetReader(ws, xml_source, shared_strings, data_only, rich_text, *, warn_extensions = True) +``` + +Create a parser and apply it to a workbook + +### `bind_all` + +```python +bind_all() +``` + +### `bind_cells` + +```python +bind_cells() +``` + +### `bind_col_dimensions` + +```python +bind_col_dimensions() +``` + +### `bind_formatting` + +```python +bind_formatting() +``` + +### `bind_hyperlinks` + +```python +bind_hyperlinks() +``` + +### `bind_merged_cells` + +```python +bind_merged_cells() +``` + +### `bind_properties` + +```python +bind_properties() +``` + +### `bind_row_dimensions` + +```python +bind_row_dimensions() +``` + +### `bind_tables` + +```python +bind_tables() +``` + +### `normalize_merged_cell_link` + +```python +normalize_merged_cell_link(coord) +``` + +Returns the appropriate cell to which a hyperlink, which references a merged cell at the specified coordinates, +should be bound. + +### `parser` + +```python +parser = WorkSheetParser(xml_source, shared_strings, data_only, ws.parent.epoch, ws.parent._date_formats, ws.parent._timedelta_formats, rich_text, warn_extensions=warn_extensions) +``` + +### `tables` + +```python +tables = [] +``` + +### `ws` + +```python +ws = ws +``` + +## `load_workbook` + +```python +load_workbook(filename, read_only = False, keep_vba = KEEP_VBA, data_only = False, keep_links = True, rich_text = False, *, preserve = None) +``` + +Open the given filename and return the workbook + +**Parameters:** + +- **filename** (`string | a file-like object open in binary mode c.f., `zipfile.ZipFile``) – the path to open or a file-like object +- **read_only** (`bool`) – optimised for reading, content cannot be edited +- **keep_vba** (`bool`) – preserve vba content (this does NOT mean you can use it) +- **data_only** (`bool`) – controls whether cells with formulae have either the formula (default) or the value stored the last time Excel read the sheet +- **keep_links** (`bool`) – whether links to external workbooks should be preserved. The default is True +- **rich_text** (`bool`) – if set to True openpyxl will preserve any rich text formatting in cells. The default is False +- **preserve** (`bool | None`) – control preserve mode: the original package bytes are +retained as the source of truth and save becomes a lossless splice of +recorded edits into them. Content openpyxl does not model (charts, +drawings, VBA, pivot caches, extensions) survives byte-identical. +Unsafe operations raise a typed `openpyxl.errors.PaperRefusal` +instead of proceeding lossily. The default ``None`` enables preserve +mode for editable OOXML workbooks. Read-only and unsupported-format +loads retain stock behavior. Pass ``False`` explicitly to opt into the +stock, potentially lossy round trip. + + + + + +# `openpyxl.reader.strings` + +## `read_rich_text` + +```python +read_rich_text(xml_source) +``` + +Read in all shared strings in the table + +## `read_string_table` + +```python +read_string_table(xml_source) +``` + +Read in all shared strings in the table + + + + + +# `openpyxl.reader.workbook` + +## `WorkbookParser` + +```python +WorkbookParser(archive, workbook_part_name, keep_links = True) +``` + +### `archive` + +```python +archive = archive +``` + +### `assign_names` + +```python +assign_names() +``` + +Bind defined names and other definitions to worksheets or the workbook + +### `defined_names` + +```python +defined_names = DefinedNameList() +``` + +### `find_sheets` + +```python +find_sheets() +``` + +Find all sheets in the workbook and return the link to the source file. + +Older XLSM files sometimes contain invalid sheet elements. +Warn user when these are removed. + +### `keep_links` + +```python +keep_links = keep_links +``` + +### `parse` + +```python +parse() +``` + +### `pivot_caches` + +```python +pivot_caches +``` + +Get PivotCache objects + +### `rels` + +```python +rels +``` + +### `sheets` + +```python +sheets = [] +``` + +### `wb` + +```python +wb = Workbook() +``` + +### `workbook_part_name` + +```python +workbook_part_name = workbook_part_name +``` diff --git a/addons/sandbox/skills/xlsx/references/api-005.md b/addons/sandbox/skills/xlsx/references/api-005.md new file mode 100644 index 000000000..40d4a5eb6 --- /dev/null +++ b/addons/sandbox/skills/xlsx/references/api-005.md @@ -0,0 +1,5982 @@ + + + + +# `openpyxl.styles.alignment` + +## `Alignment` + +```python +Alignment(horizontal = None, vertical = None, textRotation = 0, wrapText = None, shrinkToFit = None, indent = 0, relativeIndent = 0, justifyLastLine = None, readingOrder = 0, text_rotation = None, wrap_text = None, shrink_to_fit = None, mergeCell = None) +``` + +Bases: `Serialisable` + +Alignment options for use in styles. + +### `horizontal` + +```python +horizontal = horizontal +``` + +### `indent` + +```python +indent = indent +``` + +### `justifyLastLine` + +```python +justifyLastLine = justifyLastLine +``` + +### `readingOrder` + +```python +readingOrder = readingOrder +``` + +### `relativeIndent` + +```python +relativeIndent = relativeIndent +``` + +### `shrinkToFit` + +```python +shrinkToFit = shrinkToFit +``` + +### `shrink_to_fit` + +```python +shrink_to_fit = Alias('shrinkToFit') +``` + +### `tagname` + +```python +tagname = 'alignment' +``` + +### `textRotation` + +```python +textRotation = NoneSet(values=range(181)) +``` + +### `text_rotation` + +```python +text_rotation = Alias('textRotation') +``` + +### `vertical` + +```python +vertical = vertical +``` + +### `wrapText` + +```python +wrapText = wrapText +``` + +### `wrap_text` + +```python +wrap_text = Alias('wrapText') +``` + +## `horizontal_alignments` + +```python +horizontal_alignments = ('general', 'left', 'center', 'right', 'fill', 'justify', 'centerContinuous', 'distributed') +``` + +## `vertical_aligments` + +```python +vertical_aligments = ('top', 'center', 'bottom', 'justify', 'distributed') +``` + + + + + +# `openpyxl.styles.borders` + +## `BORDER_DASHDOT` + +```python +BORDER_DASHDOT = 'dashDot' +``` + +## `BORDER_DASHDOTDOT` + +```python +BORDER_DASHDOTDOT = 'dashDotDot' +``` + +## `BORDER_DASHED` + +```python +BORDER_DASHED = 'dashed' +``` + +## `BORDER_DOTTED` + +```python +BORDER_DOTTED = 'dotted' +``` + +## `BORDER_DOUBLE` + +```python +BORDER_DOUBLE = 'double' +``` + +## `BORDER_HAIR` + +```python +BORDER_HAIR = 'hair' +``` + +## `BORDER_MEDIUM` + +```python +BORDER_MEDIUM = 'medium' +``` + +## `BORDER_MEDIUMDASHDOT` + +```python +BORDER_MEDIUMDASHDOT = 'mediumDashDot' +``` + +## `BORDER_MEDIUMDASHDOTDOT` + +```python +BORDER_MEDIUMDASHDOTDOT = 'mediumDashDotDot' +``` + +## `BORDER_MEDIUMDASHED` + +```python +BORDER_MEDIUMDASHED = 'mediumDashed' +``` + +## `BORDER_NONE` + +```python +BORDER_NONE = None +``` + +## `BORDER_SLANTDASHDOT` + +```python +BORDER_SLANTDASHDOT = 'slantDashDot' +``` + +## `BORDER_THICK` + +```python +BORDER_THICK = 'thick' +``` + +## `BORDER_THIN` + +```python +BORDER_THIN = 'thin' +``` + +## `Border` + +```python +Border(left = None, right = None, top = None, bottom = None, diagonal = None, diagonal_direction = None, vertical = None, horizontal = None, diagonalUp = False, diagonalDown = False, outline = True, start = None, end = None) +``` + +Bases: `Serialisable` + +Border positioning for use in styles. + +### `bottom` + +```python +bottom = bottom +``` + +### `diagonal` + +```python +diagonal = diagonal +``` + +### `diagonalDown` + +```python +diagonalDown = diagonalDown +``` + +### `diagonalUp` + +```python +diagonalUp = diagonalUp +``` + +### `diagonal_direction` + +```python +diagonal_direction = diagonal_direction +``` + +### `end` + +```python +end = end +``` + +### `horizontal` + +```python +horizontal = horizontal +``` + +### `left` + +```python +left = left +``` + +### `outline` + +```python +outline = outline +``` + +### `right` + +```python +right = right +``` + +### `start` + +```python +start = start +``` + +### `tagname` + +```python +tagname = 'border' +``` + +### `top` + +```python +top = top +``` + +### `vertical` + +```python +vertical = vertical +``` + +## `DEFAULT_BORDER` + +```python +DEFAULT_BORDER = Border(left=Side(), right=Side(), top=Side(), bottom=Side(), diagonal=Side()) +``` + +## `Side` + +```python +Side(style = None, color = None, border_style = None) +``` + +Bases: `Serialisable` + +Border options for use in styles. +Caution: if you do not specify a border_style, other attributes will +have no effect ! + +### `border_style` + +```python +border_style = Alias('style') +``` + +### `color` + +```python +color = color +``` + +### `style` + +```python +style = style +``` + + + + + +# `openpyxl.styles.builtins` + +## `accent_1` + +```python +accent_1 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_1_20` + +```python +accent_1_20 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_1_40` + +```python +accent_1_40 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_1_60` + +```python +accent_1_60 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_2` + +```python +accent_2 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ' +``` + +## `accent_2_20` + +```python +accent_2_20 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ' +``` + +## `accent_2_40` + +```python +accent_2_40 = '\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ' +``` + +## `accent_2_60` + +```python +accent_2_60 = '\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ' +``` + +## `accent_3` + +```python +accent_3 = '\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ' +``` + +## `accent_3_20` + +```python +accent_3_20 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ' +``` + +## `accent_3_40` + +```python +accent_3_40 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_3_60` + +```python +accent_3_60 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_4` + +```python +accent_4 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_4_20` + +```python +accent_4_20 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_4_40` + +```python +accent_4_40 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_4_60` + +```python +accent_4_60 = '\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_5` + +```python +accent_5 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_5_20` + +```python +accent_5_20 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_5_40` + +```python +accent_5_40 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_5_60` + +```python +accent_5_60 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_6` + +```python +accent_6 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_6_20` + +```python +accent_6_20 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_6_40` + +```python +accent_6_40 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `accent_6_60` + +```python +accent_6_60 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `bad` + +```python +bad = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `calculation` + +```python +calculation = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `check_cell` + +```python +check_cell = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `comma` + +```python +comma = '\n \n \n _-* #,##0.00\\ _$_-;\\-* #,##0.00\\ _$_-;_-* "-"??\\ _$_-;_-@_-\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `comma_0` + +```python +comma_0 = '\n \n \n _-* #,##0\\ _$_-;\\-* #,##0\\ _$_-;_-* "-"\\ _$_-;_-@_-\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `currency` + +```python +currency = '\n \n \n _-* #,##0.00\\ "$"_-;\\-* #,##0.00\\ "$"_-;_-* "-"??\\ "$"_-;_-@_-\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `currency_0` + +```python +currency_0 = '\n \n \n _-* #,##0\\ "$"_-;\\-* #,##0\\ "$"_-;_-* "-"\\ "$"_-;_-@_-\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `explanatory` + +```python +explanatory = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `followed_hyperlink` + +```python +followed_hyperlink = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ' +``` + +## `good` + +```python +good = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `headline_1` + +```python +headline_1 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `headline_2` + +```python +headline_2 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `headline_3` + +```python +headline_3 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n' +``` + +## `headline_4` + +```python +headline_4 = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `hyperlink` + +```python +hyperlink = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ' +``` + +## `input` + +```python +input = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `linked_cell` + +```python +linked_cell = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `neutral` + +```python +neutral = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `normal` + +```python +normal = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `note` + +```python +note = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `output` + +```python +output = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `pandas_highlight` + +```python +pandas_highlight = '\n \n' +``` + +## `percent` + +```python +percent = '\n \n \n 0%\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `styles` + +```python +styles = dict([('Normal', NamedStyle.from_tree(fromstring(normal))), ('Comma', NamedStyle.from_tree(fromstring(comma))), ('Currency', NamedStyle.from_tree(fromstring(currency))), ('Percent', NamedStyle.from_tree(fromstring(percent))), ('Comma [0]', NamedStyle.from_tree(fromstring(comma_0))), ('Currency [0]', NamedStyle.from_tree(fromstring(currency_0))), ('Hyperlink', NamedStyle.from_tree(fromstring(hyperlink))), ('Followed Hyperlink', NamedStyle.from_tree(fromstring(followed_hyperlink))), ('Note', NamedStyle.from_tree(fromstring(note))), ('Warning Text', NamedStyle.from_tree(fromstring(warning))), ('Title', NamedStyle.from_tree(fromstring(title))), ('Headline 1', NamedStyle.from_tree(fromstring(headline_1))), ('Headline 2', NamedStyle.from_tree(fromstring(headline_2))), ('Headline 3', NamedStyle.from_tree(fromstring(headline_3))), ('Headline 4', NamedStyle.from_tree(fromstring(headline_4))), ('Input', NamedStyle.from_tree(fromstring(input))), ('Output', NamedStyle.from_tree(fromstring(output))), ('Calculation', NamedStyle.from_tree(fromstring(calculation))), ('Check Cell', NamedStyle.from_tree(fromstring(check_cell))), ('Linked Cell', NamedStyle.from_tree(fromstring(linked_cell))), ('Total', NamedStyle.from_tree(fromstring(total))), ('Good', NamedStyle.from_tree(fromstring(good))), ('Bad', NamedStyle.from_tree(fromstring(bad))), ('Neutral', NamedStyle.from_tree(fromstring(neutral))), ('Accent1', NamedStyle.from_tree(fromstring(accent_1))), ('20 % - Accent1', NamedStyle.from_tree(fromstring(accent_1_20))), ('40 % - Accent1', NamedStyle.from_tree(fromstring(accent_1_40))), ('60 % - Accent1', NamedStyle.from_tree(fromstring(accent_1_60))), ('Accent2', NamedStyle.from_tree(fromstring(accent_2))), ('20 % - Accent2', NamedStyle.from_tree(fromstring(accent_2_20))), ('40 % - Accent2', NamedStyle.from_tree(fromstring(accent_2_40))), ('60 % - Accent2', NamedStyle.from_tree(fromstring(accent_2_60))), ('Accent3', NamedStyle.from_tree(fromstring(accent_3))), ('20 % - Accent3', NamedStyle.from_tree(fromstring(accent_3_20))), ('40 % - Accent3', NamedStyle.from_tree(fromstring(accent_3_40))), ('60 % - Accent3', NamedStyle.from_tree(fromstring(accent_3_60))), ('Accent4', NamedStyle.from_tree(fromstring(accent_4))), ('20 % - Accent4', NamedStyle.from_tree(fromstring(accent_4_20))), ('40 % - Accent4', NamedStyle.from_tree(fromstring(accent_4_40))), ('60 % - Accent4', NamedStyle.from_tree(fromstring(accent_4_60))), ('Accent5', NamedStyle.from_tree(fromstring(accent_5))), ('20 % - Accent5', NamedStyle.from_tree(fromstring(accent_5_20))), ('40 % - Accent5', NamedStyle.from_tree(fromstring(accent_5_40))), ('60 % - Accent5', NamedStyle.from_tree(fromstring(accent_5_60))), ('Accent6', NamedStyle.from_tree(fromstring(accent_6))), ('20 % - Accent6', NamedStyle.from_tree(fromstring(accent_6_20))), ('40 % - Accent6', NamedStyle.from_tree(fromstring(accent_6_40))), ('60 % - Accent6', NamedStyle.from_tree(fromstring(accent_6_60))), ('Explanatory Text', NamedStyle.from_tree(fromstring(explanatory))), ('Pandas', NamedStyle.from_tree(fromstring(pandas_highlight)))]) +``` + +## `title` + +```python +title = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `total` + +```python +total = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + +## `warning` + +```python +warning = '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n' +``` + + + + + +# `openpyxl.styles.cell_style` + +## `ArrayDescriptor` + +```python +ArrayDescriptor(key) +``` + +### `key` + +```python +key = key +``` + +## `CellStyle` + +```python +CellStyle(numFmtId = 0, fontId = 0, fillId = 0, borderId = 0, xfId = None, quotePrefix = None, pivotButton = None, applyNumberFormat = None, applyFont = None, applyFill = None, applyBorder = None, applyAlignment = None, applyProtection = None, alignment = None, protection = None, extLst = None) +``` + +Bases: `Serialisable` + +### `alignment` + +```python +alignment = alignment +``` + +### `applyAlignment` + +```python +applyAlignment +``` + +### `applyBorder` + +```python +applyBorder = applyBorder +``` + +### `applyFill` + +```python +applyFill = applyFill +``` + +### `applyFont` + +```python +applyFont = applyFont +``` + +### `applyNumberFormat` + +```python +applyNumberFormat = applyNumberFormat +``` + +### `applyProtection` + +```python +applyProtection +``` + +### `borderId` + +```python +borderId = borderId +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `fillId` + +```python +fillId = fillId +``` + +### `fontId` + +```python +fontId = fontId +``` + +### `from_array` + +```python +from_array(style) +``` + +Convert from StyleArray + +### `numFmtId` + +```python +numFmtId = numFmtId +``` + +### `pivotButton` + +```python +pivotButton = pivotButton +``` + +### `protection` + +```python +protection = protection +``` + +### `quotePrefix` + +```python +quotePrefix = quotePrefix +``` + +### `tagname` + +```python +tagname = 'xf' +``` + +### `to_array` + +```python +to_array() +``` + +Convert to StyleArray + +### `xfId` + +```python +xfId = xfId +``` + +## `CellStyleList` + +```python +CellStyleList(count = None, xf = ()) +``` + +Bases: `Serialisable` + +### `alignment` + +```python +alignment = Sequence(expected_type=Alignment) +``` + +### `count` + +```python +count +``` + +### `protection` + +```python +protection = Sequence(expected_type=Protection) +``` + +### `tagname` + +```python +tagname = 'cellXfs' +``` + +### `xf` + +```python +xf = xf +``` + +## `StyleArray` + +Bases: `array` + +Simplified named tuple with an array + +### `alignmentId` + +```python +alignmentId = ArrayDescriptor(5) +``` + +### `borderId` + +```python +borderId = ArrayDescriptor(2) +``` + +### `fillId` + +```python +fillId = ArrayDescriptor(1) +``` + +### `fontId` + +```python +fontId = ArrayDescriptor(0) +``` + +### `numFmtId` + +```python +numFmtId = ArrayDescriptor(3) +``` + +### `pivotButton` + +```python +pivotButton = ArrayDescriptor(6) +``` + +### `protectionId` + +```python +protectionId = ArrayDescriptor(4) +``` + +### `quotePrefix` + +```python +quotePrefix = ArrayDescriptor(7) +``` + +### `tagname` + +```python +tagname = 'xf' +``` + +### `xfId` + +```python +xfId = ArrayDescriptor(8) +``` + + + + + +# `openpyxl.styles.colors` + +## `BLACK` + +```python +BLACK = COLOR_INDEX[0] +``` + +## `BLUE` + +```python +BLUE = COLOR_INDEX[4] +``` + +## `COLOR_INDEX` + +```python +COLOR_INDEX = ('00000000', '00FFFFFF', '00FF0000', '0000FF00', '000000FF', '00FFFF00', '00FF00FF', '0000FFFF', '00000000', '00FFFFFF', '00FF0000', '0000FF00', '000000FF', '00FFFF00', '00FF00FF', '0000FFFF', '00800000', '00008000', '00000080', '00808000', '00800080', '00008080', '00C0C0C0', '00808080', '009999FF', '00993366', '00FFFFCC', '00CCFFFF', '00660066', '00FF8080', '000066CC', '00CCCCFF', '00000080', '00FF00FF', '00FFFF00', '0000FFFF', '00800080', '00800000', '00008080', '000000FF', '0000CCFF', '00CCFFFF', '00CCFFCC', '00FFFF99', '0099CCFF', '00FF99CC', '00CC99FF', '00FFCC99', '003366FF', '0033CCCC', '0099CC00', '00FFCC00', '00FF9900', '00FF6600', '00666699', '00969696', '00003366', '00339966', '00003300', '00333300', '00993300', '00993366', '00333399', '00333333') +``` + +## `Color` + +```python +Color(rgb = BLACK, indexed = None, auto = None, theme = None, tint = 0.0, index = None, type = 'rgb') +``` + +Bases: `Serialisable` + +Named colors for use in styles. + +### `auto` + +```python +auto = Bool() +``` + +### `index` + +```python +index +``` + +### `indexed` + +```python +indexed = Integer() +``` + +### `rgb` + +```python +rgb = RGB() +``` + +### `tagname` + +```python +tagname = 'color' +``` + +### `theme` + +```python +theme = Integer() +``` + +### `tint` + +```python +tint = tint +``` + +### `type` + +```python +type = String() +``` + +### `value` + +```python +value +``` + +## `ColorDescriptor` + +Bases: `Typed` + +### `expected_type` + +```python +expected_type = Color +``` + +## `ColorList` + +```python +ColorList(indexedColors = (), mruColors = ()) +``` + +Bases: `Serialisable` + +### `index` + +```python +index +``` + +### `indexedColors` + +```python +indexedColors = indexedColors +``` + +### `mruColors` + +```python +mruColors = mruColors +``` + +### `tagname` + +```python +tagname = 'colors' +``` + +## `RGB` + +Bases: `Typed` + +Descriptor for aRGB values +If not supplied alpha is 00 + +### `expected_type` + +```python +expected_type = str +``` + +## `RgbColor` + +```python +RgbColor(rgb = None) +``` + +Bases: `Serialisable` + +### `rgb` + +```python +rgb = rgb +``` + +### `tagname` + +```python +tagname = 'rgbColor' +``` + +## `WHITE` + +```python +WHITE = COLOR_INDEX[1] +``` + +## `aRGB_REGEX` + +```python +aRGB_REGEX = re.compile('^([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6})$') +``` + + + + + +# `openpyxl.styles.differential` + +## `DifferentialStyle` + +```python +DifferentialStyle(font = None, numFmt = None, fill = None, alignment = None, border = None, protection = None, extLst = None) +``` + +Bases: `Serialisable` + +### `alignment` + +```python +alignment = alignment +``` + +### `border` + +```python +border = border +``` + +### `extLst` + +```python +extLst = extLst +``` + +### `fill` + +```python +fill = fill +``` + +### `font` + +```python +font = font +``` + +### `numFmt` + +```python +numFmt = numFmt +``` + +### `protection` + +```python +protection = protection +``` + +### `tagname` + +```python +tagname = 'dxf' +``` + +## `DifferentialStyleList` + +```python +DifferentialStyleList(dxf = (), count = None) +``` + +Bases: `Serialisable` + +Dedupable container for differential styles. + +### `add` + +```python +add(dxf) +``` + +Add a differential style and return its index + +### `append` + +```python +append(dxf) +``` + +Check to see whether style already exists and append it if does not. + +### `count` + +```python +count +``` + +### `dxf` + +```python +dxf = dxf +``` + +### `styles` + +```python +styles = Alias('dxf') +``` + +### `tagname` + +```python +tagname = 'dxfs' +``` + + + + + +# `openpyxl.styles.fills` + +## `DEFAULT_EMPTY_FILL` + +```python +DEFAULT_EMPTY_FILL = PatternFill() +``` + +## `DEFAULT_GRAY_FILL` + +```python +DEFAULT_GRAY_FILL = PatternFill(patternType='gray125') +``` + +## `FILL_NONE` + +```python +FILL_NONE = 'none' +``` + +## `FILL_PATTERN_DARKDOWN` + +```python +FILL_PATTERN_DARKDOWN = 'darkDown' +``` + +## `FILL_PATTERN_DARKGRAY` + +```python +FILL_PATTERN_DARKGRAY = 'darkGray' +``` + +## `FILL_PATTERN_DARKGRID` + +```python +FILL_PATTERN_DARKGRID = 'darkGrid' +``` + +## `FILL_PATTERN_DARKHORIZONTAL` + +```python +FILL_PATTERN_DARKHORIZONTAL = 'darkHorizontal' +``` + +## `FILL_PATTERN_DARKTRELLIS` + +```python +FILL_PATTERN_DARKTRELLIS = 'darkTrellis' +``` + +## `FILL_PATTERN_DARKUP` + +```python +FILL_PATTERN_DARKUP = 'darkUp' +``` + +## `FILL_PATTERN_DARKVERTICAL` + +```python +FILL_PATTERN_DARKVERTICAL = 'darkVertical' +``` + +## `FILL_PATTERN_GRAY0625` + +```python +FILL_PATTERN_GRAY0625 = 'gray0625' +``` + +## `FILL_PATTERN_GRAY125` + +```python +FILL_PATTERN_GRAY125 = 'gray125' +``` + +## `FILL_PATTERN_LIGHTDOWN` + +```python +FILL_PATTERN_LIGHTDOWN = 'lightDown' +``` + +## `FILL_PATTERN_LIGHTGRAY` + +```python +FILL_PATTERN_LIGHTGRAY = 'lightGray' +``` + +## `FILL_PATTERN_LIGHTGRID` + +```python +FILL_PATTERN_LIGHTGRID = 'lightGrid' +``` + +## `FILL_PATTERN_LIGHTHORIZONTAL` + +```python +FILL_PATTERN_LIGHTHORIZONTAL = 'lightHorizontal' +``` + +## `FILL_PATTERN_LIGHTTRELLIS` + +```python +FILL_PATTERN_LIGHTTRELLIS = 'lightTrellis' +``` + +## `FILL_PATTERN_LIGHTUP` + +```python +FILL_PATTERN_LIGHTUP = 'lightUp' +``` + +## `FILL_PATTERN_LIGHTVERTICAL` + +```python +FILL_PATTERN_LIGHTVERTICAL = 'lightVertical' +``` + +## `FILL_PATTERN_MEDIUMGRAY` + +```python +FILL_PATTERN_MEDIUMGRAY = 'mediumGray' +``` + +## `FILL_SOLID` + +```python +FILL_SOLID = 'solid' +``` + +## `Fill` + +Bases: `Serialisable` + +Base class + +### `from_tree` + +```python +from_tree(el) +``` + +### `tagname` + +```python +tagname = 'fill' +``` + +## `GradientFill` + +```python +GradientFill(type = 'linear', degree = 0, left = 0, right = 0, top = 0, bottom = 0, stop = ()) +``` + +Bases: `Fill` + +Fill areas with gradient + +Two types of gradient fill are supported: + + - A type='linear' gradient interpolates colours between + a set of specified Stops, across the length of an area. + The gradient is left-to-right by default, but this + orientation can be modified with the degree + attribute. A list of Colors can be provided instead + and they will be positioned with equal distance between them. + + - A type='path' gradient applies a linear gradient from each + edge of the area. Attributes top, right, bottom, left specify + the extent of fill from the respective borders. Thus top="0.2" + will fill the top 20% of the cell. + +### `bottom` + +```python +bottom = bottom +``` + +### `degree` + +```python +degree = degree +``` + +### `fill_type` + +```python +fill_type = Alias('type') +``` + +### `left` + +```python +left = left +``` + +### `right` + +```python +right = right +``` + +### `stop` + +```python +stop = stop +``` + +### `tagname` + +```python +tagname = 'gradientFill' +``` + +### `to_tree` + +```python +to_tree(tagname = None, namespace = None, idx = None) +``` + +### `top` + +```python +top = top +``` + +### `type` + +```python +type = type +``` + +## `PatternFill` + +```python +PatternFill(patternType = None, fgColor = Color(), bgColor = Color(), fill_type = None, start_color = None, end_color = None) +``` + +Bases: `Fill` + +Area fill patterns for use in styles. +Caution: if you do not specify a fill_type, other attributes will have +no effect ! + +### `bgColor` + +```python +bgColor = bgColor +``` + +### `end_color` + +```python +end_color = Alias('bgColor') +``` + +### `fgColor` + +```python +fgColor = fgColor +``` + +### `fill_type` + +```python +fill_type = Alias('patternType') +``` + +### `patternType` + +```python +patternType = patternType +``` + +### `start_color` + +```python +start_color = Alias('fgColor') +``` + +### `tagname` + +```python +tagname = 'patternFill' +``` + +### `to_tree` + +```python +to_tree(tagname = None, idx = None) +``` + +## `Stop` + +```python +Stop(color, position) +``` + +Bases: `Serialisable` + +### `color` + +```python +color = color +``` + +### `position` + +```python +position = position +``` + +### `tagname` + +```python +tagname = 'stop' +``` + +## `StopList` + +Bases: `Sequence` + +### `expected_type` + +```python +expected_type = Stop +``` + +## `fills` + +```python +fills = (FILL_SOLID, FILL_PATTERN_DARKDOWN, FILL_PATTERN_DARKGRAY, FILL_PATTERN_DARKGRID, FILL_PATTERN_DARKHORIZONTAL, FILL_PATTERN_DARKTRELLIS, FILL_PATTERN_DARKUP, FILL_PATTERN_DARKVERTICAL, FILL_PATTERN_GRAY0625, FILL_PATTERN_GRAY125, FILL_PATTERN_LIGHTDOWN, FILL_PATTERN_LIGHTGRAY, FILL_PATTERN_LIGHTGRID, FILL_PATTERN_LIGHTHORIZONTAL, FILL_PATTERN_LIGHTTRELLIS, FILL_PATTERN_LIGHTUP, FILL_PATTERN_LIGHTVERTICAL, FILL_PATTERN_MEDIUMGRAY) +``` + + + + + +# `openpyxl.styles.fonts` + +## `DEFAULT_FONT` + +```python +DEFAULT_FONT = Font(name='Calibri', sz=11, family=2, b=False, i=False, color=Color(theme=1), scheme='minor') +``` + +## `Font` + +```python +Font(name = None, sz = None, b = None, i = None, charset = None, u = None, strike = None, color = None, scheme = None, family = None, size = None, bold = None, italic = None, strikethrough = None, underline = None, vertAlign = None, outline = None, shadow = None, condense = None, extend = None) +``` + +Bases: `Serialisable` + +Font options used in styles. + +### `UNDERLINE_DOUBLE` + +```python +UNDERLINE_DOUBLE = 'double' +``` + +### `UNDERLINE_DOUBLE_ACCOUNTING` + +```python +UNDERLINE_DOUBLE_ACCOUNTING = 'doubleAccounting' +``` + +### `UNDERLINE_SINGLE` + +```python +UNDERLINE_SINGLE = 'single' +``` + +### `UNDERLINE_SINGLE_ACCOUNTING` + +```python +UNDERLINE_SINGLE_ACCOUNTING = 'singleAccounting' +``` + +### `b` + +```python +b = b +``` + +### `bold` + +```python +bold = Alias('b') +``` + +### `charset` + +```python +charset = charset +``` + +### `color` + +```python +color = color +``` + +### `condense` + +```python +condense = condense +``` + +### `extend` + +```python +extend = extend +``` + +### `family` + +```python +family = family +``` + +### `from_tree` + +```python +from_tree(node) +``` + +Set default value for underline if child element is present + +### `i` + +```python +i = i +``` + +### `italic` + +```python +italic = Alias('i') +``` + +### `name` + +```python +name = name +``` + +### `outline` + +```python +outline = outline +``` + +### `scheme` + +```python +scheme = scheme +``` + +### `shadow` + +```python +shadow = shadow +``` + +### `size` + +```python +size = Alias('sz') +``` + +### `strike` + +```python +strike = strike +``` + +### `strikethrough` + +```python +strikethrough = Alias('strike') +``` + +### `sz` + +```python +sz = sz +``` + +### `tagname` + +```python +tagname = 'font' +``` + +### `u` + +```python +u = u +``` + +### `underline` + +```python +underline = Alias('u') +``` + +### `vertAlign` + +```python +vertAlign = vertAlign +``` + + + + + +# `openpyxl.styles.named_styles` + +## `NamedStyle` + +```python +NamedStyle(name = 'Normal', font = None, fill = None, border = None, alignment = None, number_format = None, protection = None, builtinId = None, hidden = False) +``` + +Bases: `Serialisable` + +Named and editable styles + +### `alignment` + +```python +alignment = alignment or Alignment() +``` + +### `as_name` + +```python +as_name() +``` + +Return relevant named style + +### `as_tuple` + +```python +as_tuple() +``` + +Return a style array representing the current style + +### `as_xf` + +```python +as_xf() +``` + +Return equivalent XfStyle + +### `bind` + +```python +bind(wb) +``` + +Bind a named style to a workbook + +### `border` + +```python +border = border or Border() +``` + +### `builtinId` + +```python +builtinId = builtinId +``` + +### `fill` + +```python +fill = fill or PatternFill() +``` + +### `font` + +```python +font = font or Font() +``` + +### `hidden` + +```python +hidden = hidden +``` + +### `name` + +```python +name = name +``` + +### `number_format` + +```python +number_format = number_format +``` + +### `protection` + +```python +protection = protection or Protection() +``` + +## `NamedStyleList` + +```python +NamedStyleList(iterable = ()) +``` + +Bases: `list` + +Named styles are editable and can be applied to multiple objects + +As only the index is stored in referencing objects the order mus +be preserved. + +Returns a list of NamedStyles + +Allow a list of named styles to be passed in and index them. + +### `append` + +```python +append(style) +``` + +### `names` + +```python +names +``` + + + + + +# `openpyxl.styles.numbers` + +## `BUILTIN_FORMATS` + +```python +BUILTIN_FORMATS = {0: 'General', 1: '0', 2: '0.00', 3: '#,##0', 4: '#,##0.00', 5: '"$"#,##0_);("$"#,##0)', 6: '"$"#,##0_);[Red]("$"#,##0)', 7: '"$"#,##0.00_);("$"#,##0.00)', 8: '"$"#,##0.00_);[Red]("$"#,##0.00)', 9: '0%', 10: '0.00%', 11: '0.00E+00', 12: '# ?/?', 13: '# ??/??', 14: 'mm-dd-yy', 15: 'd-mmm-yy', 16: 'd-mmm', 17: 'mmm-yy', 18: 'h:mm AM/PM', 19: 'h:mm:ss AM/PM', 20: 'h:mm', 21: 'h:mm:ss', 22: 'm/d/yy h:mm', 37: '#,##0_);(#,##0)', 38: '#,##0_);Red', 39: '#,##0.00_);(#,##0.00)', 40: '#,##0.00_);Red', 41: '_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)', 42: '_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)', 43: '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)', 44: '_("$"* #,##0.00_)_("$"* \\(#,##0.00\\)_("$"* "-"??_)_(@_)', 45: 'mm:ss', 46: '[h]:mm:ss', 47: 'mmss.0', 48: '##0.0E+0', 49: '@'} +``` + +## `BUILTIN_FORMATS_MAX_SIZE` + +```python +BUILTIN_FORMATS_MAX_SIZE = 164 +``` + +## `BUILTIN_FORMATS_REVERSE` + +```python +BUILTIN_FORMATS_REVERSE = dict([(value, key) for key, value in BUILTIN_FORMATS.items()]) +``` + +## `COLORS` + +```python +COLORS = '\\[(BLACK`BLUE`CYAN`GREEN`MAGENTA`RED`WHITE|YELLOW)\\]' +``` + +## `FORMAT_CURRENCY_EUR_SIMPLE` + +```python +FORMAT_CURRENCY_EUR_SIMPLE = '[$EUR ]#,##0.00_-' +``` + +## `FORMAT_CURRENCY_USD` + +```python +FORMAT_CURRENCY_USD = '$#,##0_-' +``` + +## `FORMAT_CURRENCY_USD_SIMPLE` + +```python +FORMAT_CURRENCY_USD_SIMPLE = '"$"#,##0.00_-' +``` + +## `FORMAT_DATE_DATETIME` + +```python +FORMAT_DATE_DATETIME = 'yyyy-mm-dd h:mm:ss' +``` + +## `FORMAT_DATE_DDMMYY` + +```python +FORMAT_DATE_DDMMYY = 'dd/mm/yy' +``` + +## `FORMAT_DATE_DMMINUS` + +```python +FORMAT_DATE_DMMINUS = 'd-m' +``` + +## `FORMAT_DATE_DMYMINUS` + +```python +FORMAT_DATE_DMYMINUS = 'd-m-y' +``` + +## `FORMAT_DATE_DMYSLASH` + +```python +FORMAT_DATE_DMYSLASH = 'd/m/y' +``` + +## `FORMAT_DATE_MYMINUS` + +```python +FORMAT_DATE_MYMINUS = 'm-y' +``` + +## `FORMAT_DATE_TIME1` + +```python +FORMAT_DATE_TIME1 = BUILTIN_FORMATS[18] +``` + +## `FORMAT_DATE_TIME2` + +```python +FORMAT_DATE_TIME2 = BUILTIN_FORMATS[19] +``` + +## `FORMAT_DATE_TIME3` + +```python +FORMAT_DATE_TIME3 = BUILTIN_FORMATS[20] +``` + +## `FORMAT_DATE_TIME4` + +```python +FORMAT_DATE_TIME4 = BUILTIN_FORMATS[21] +``` + +## `FORMAT_DATE_TIME5` + +```python +FORMAT_DATE_TIME5 = BUILTIN_FORMATS[45] +``` + +## `FORMAT_DATE_TIME6` + +```python +FORMAT_DATE_TIME6 = BUILTIN_FORMATS[21] +``` + +## `FORMAT_DATE_TIME7` + +```python +FORMAT_DATE_TIME7 = 'i:s.S' +``` + +## `FORMAT_DATE_TIME8` + +```python +FORMAT_DATE_TIME8 = 'h:mm:ss@' +``` + +## `FORMAT_DATE_TIMEDELTA` + +```python +FORMAT_DATE_TIMEDELTA = '[hh]:mm:ss' +``` + +## `FORMAT_DATE_XLSX14` + +```python +FORMAT_DATE_XLSX14 = BUILTIN_FORMATS[14] +``` + +## `FORMAT_DATE_XLSX15` + +```python +FORMAT_DATE_XLSX15 = BUILTIN_FORMATS[15] +``` + +## `FORMAT_DATE_XLSX16` + +```python +FORMAT_DATE_XLSX16 = BUILTIN_FORMATS[16] +``` + +## `FORMAT_DATE_XLSX17` + +```python +FORMAT_DATE_XLSX17 = BUILTIN_FORMATS[17] +``` + +## `FORMAT_DATE_XLSX22` + +```python +FORMAT_DATE_XLSX22 = BUILTIN_FORMATS[22] +``` + +## `FORMAT_DATE_YYMMDD` + +```python +FORMAT_DATE_YYMMDD = 'yy-mm-dd' +``` + +## `FORMAT_DATE_YYMMDDSLASH` + +```python +FORMAT_DATE_YYMMDDSLASH = 'yy/mm/dd@' +``` + +## `FORMAT_DATE_YYYYMMDD2` + +```python +FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd' +``` + +## `FORMAT_GENERAL` + +```python +FORMAT_GENERAL = BUILTIN_FORMATS[0] +``` + +## `FORMAT_NUMBER` + +```python +FORMAT_NUMBER = BUILTIN_FORMATS[1] +``` + +## `FORMAT_NUMBER_00` + +```python +FORMAT_NUMBER_00 = BUILTIN_FORMATS[2] +``` + +## `FORMAT_NUMBER_COMMA_SEPARATED1` + +```python +FORMAT_NUMBER_COMMA_SEPARATED1 = BUILTIN_FORMATS[4] +``` + +## `FORMAT_NUMBER_COMMA_SEPARATED2` + +```python +FORMAT_NUMBER_COMMA_SEPARATED2 = '#,##0.00_-' +``` + +## `FORMAT_PERCENTAGE` + +```python +FORMAT_PERCENTAGE = BUILTIN_FORMATS[9] +``` + +## `FORMAT_PERCENTAGE_00` + +```python +FORMAT_PERCENTAGE_00 = BUILTIN_FORMATS[10] +``` + +## `FORMAT_TEXT` + +```python +FORMAT_TEXT = BUILTIN_FORMATS[49] +``` + +## `LITERAL_GROUP` + +```python +LITERAL_GROUP = '".*?"' +``` + +## `LOCALE_GROUP` + +```python +LOCALE_GROUP = '\\[(?!hh?\\]|mm?\\]|ss?\\])[^\\]]*\\]' +``` + +## `NumberFormat` + +```python +NumberFormat(numFmtId = None, formatCode = None) +``` + +Bases: `Serialisable` + +### `formatCode` + +```python +formatCode = formatCode +``` + +### `numFmtId` + +```python +numFmtId = numFmtId +``` + +## `NumberFormatDescriptor` + +Bases: `String` + +## `NumberFormatList` + +```python +NumberFormatList(count = None, numFmt = ()) +``` + +Bases: `Serialisable` + +### `count` + +```python +count +``` + +### `numFmt` + +```python +numFmt = numFmt +``` + +## `STRIP_RE` + +```python +STRIP_RE = re.compile(f'{LITERAL_GROUP}|{LOCALE_GROUP}') +``` + +## `TIMEDELTA_RE` + +```python +TIMEDELTA_RE = re.compile('\\[hh?\\](:mm(:ss(\\.0*)?)?)?|\\[mm?\\](:ss(\\.0*)?)?|\\[ss?\\](\\.0*)?', re.I) +``` + +## `builtin_format_code` + +```python +builtin_format_code(index) +``` + +Return one of the standard format codes by index. + +## `builtin_format_id` + +```python +builtin_format_id(fmt) +``` + +Return the id of a standard style. + +## `is_builtin` + +```python +is_builtin(fmt) +``` + +## `is_date_format` + +```python +is_date_format(fmt) +``` + +## `is_datetime` + +```python +is_datetime(fmt) +``` + +Return date, time or datetime + +## `is_timedelta_format` + +```python +is_timedelta_format(fmt) +``` + + + + + +# `openpyxl.styles.protection` + +## `Protection` + +```python +Protection(locked = True, hidden = False) +``` + +Bases: `Serialisable` + +Protection options for use in styles. + +### `hidden` + +```python +hidden = hidden +``` + +### `locked` + +```python +locked = locked +``` + +### `tagname` + +```python +tagname = 'protection' +``` + + + + + +# `openpyxl.styles.proxy` + +## `StyleProxy` + +```python +StyleProxy(target) +``` + +Proxy formatting objects so that they cannot be altered + +### `copy` + +```python +copy(**kw) +``` + +Return a copy of the proxied object. Keyword args will be passed through + + + + + +# `openpyxl.styles.styleable` + +## `NamedStyleDescriptor` + +### `collection` + +```python +collection = '_named_styles' +``` + +### `key` + +```python +key = 'xfId' +``` + +## `NumberFormatDescriptor` + +### `collection` + +```python +collection = '_number_formats' +``` + +### `key` + +```python +key = 'numFmtId' +``` + +## `StyleArrayDescriptor` + +```python +StyleArrayDescriptor(key) +``` + +### `key` + +```python +key = key +``` + +## `StyleDescriptor` + +```python +StyleDescriptor(collection, key) +``` + +### `collection` + +```python +collection = collection +``` + +### `key` + +```python +key = key +``` + +## `StyleableObject` + +```python +StyleableObject(sheet, style_array = None) +``` + +Base class for styleble objects implementing proxy and lookup functions + +### `alignment` + +```python +alignment = StyleDescriptor('_alignments', 'alignmentId') +``` + +### `border` + +```python +border = StyleDescriptor('_borders', 'borderId') +``` + +### `fill` + +```python +fill = StyleDescriptor('_fills', 'fillId') +``` + +### `font` + +```python +font = StyleDescriptor('_fonts', 'fontId') +``` + +### `has_style` + +```python +has_style +``` + +### `number_format` + +```python +number_format = NumberFormatDescriptor() +``` + +### `parent` + +```python +parent = sheet +``` + +### `pivotButton` + +```python +pivotButton = StyleArrayDescriptor('pivotButton') +``` + +### `protection` + +```python +protection = StyleDescriptor('_protections', 'protectionId') +``` + +### `quotePrefix` + +```python +quotePrefix = StyleArrayDescriptor('quotePrefix') +``` + +### `style` + +```python +style = NamedStyleDescriptor() +``` + +### `style_id` + +```python +style_id +``` + + + + + +# `openpyxl.styles.stylesheet` + +## `Stylesheet` + +```python +Stylesheet(numFmts = None, fonts = (), fills = (), borders = (), cellStyleXfs = None, cellXfs = None, cellStyles = None, dxfs = (), tableStyles = None, colors = None, extLst = None) +``` + +Bases: `Serialisable` + +### `alignments` + +```python +alignments = self.cellXfs.alignments +``` + +### `borders` + +```python +borders = borders +``` + +### `cellStyleXfs` + +```python +cellStyleXfs = cellStyleXfs +``` + +### `cellStyles` + +```python +cellStyles = cellStyles +``` + +### `cellXfs` + +```python +cellXfs = cellXfs +``` + +### `cell_styles` + +```python +cell_styles = self.cellXfs._to_array() +``` + +### `colors` + +```python +colors = colors +``` + +### `custom_formats` + +```python +custom_formats +``` + +### `dxfs` + +```python +dxfs = dxfs +``` + +### `extLst` + +```python +extLst = Typed(expected_type=ExtensionList, allow_none=True) +``` + +### `fills` + +```python +fills = fills +``` + +### `fonts` + +```python +fonts = fonts +``` + +### `from_tree` + +```python +from_tree(node) +``` + +### `named_styles` + +```python +named_styles = self._merge_named_styles() +``` + +### `numFmts` + +```python +numFmts = numFmts +``` + +### `number_formats` + +```python +number_formats = IndexedList() +``` + +### `protections` + +```python +protections = self.cellXfs.prots +``` + +### `tableStyles` + +```python +tableStyles = tableStyles +``` + +### `tagname` + +```python +tagname = 'styleSheet' +``` + +### `to_tree` + +```python +to_tree(tagname = None, idx = None, namespace = None) +``` + +## `apply_stylesheet` + +```python +apply_stylesheet(archive, wb) +``` + +Add styles to workbook if present + +## `write_stylesheet` + +```python +write_stylesheet(wb) +``` + + + + + +# `openpyxl.styles.table` + +## `TableStyle` + +```python +TableStyle(name = None, pivot = None, table = None, count = None, tableStyleElement = ()) +``` + +Bases: `Serialisable` + +### `count` + +```python +count = count +``` + +### `name` + +```python +name = name +``` + +### `pivot` + +```python +pivot = pivot +``` + +### `table` + +```python +table = table +``` + +### `tableStyleElement` + +```python +tableStyleElement = tableStyleElement +``` + +### `tagname` + +```python +tagname = 'tableStyle' +``` + +## `TableStyleElement` + +```python +TableStyleElement(type = None, size = None, dxfId = None) +``` + +Bases: `Serialisable` + +### `dxfId` + +```python +dxfId = dxfId +``` + +### `size` + +```python +size = size +``` + +### `tagname` + +```python +tagname = 'tableStyleElement' +``` + +### `type` + +```python +type = type +``` + +## `TableStyleList` + +```python +TableStyleList(count = None, defaultTableStyle = 'TableStyleMedium9', defaultPivotStyle = 'PivotStyleLight16', tableStyle = ()) +``` + +Bases: `Serialisable` + +### `count` + +```python +count +``` + +### `defaultPivotStyle` + +```python +defaultPivotStyle = defaultPivotStyle +``` + +### `defaultTableStyle` + +```python +defaultTableStyle = defaultTableStyle +``` + +### `tableStyle` + +```python +tableStyle = tableStyle +``` + +### `tagname` + +```python +tagname = 'tableStyles' +``` + + + + + +# `openpyxl.utils.bound_dictionary` + +## `BoundDictionary` + +```python +BoundDictionary(reference = None, *args, **kw) +``` + +Bases: `defaultdict` + +A default dictionary where elements are tightly coupled. + +The factory method is responsible for binding the parent object to the child. + +If a reference attribute is assigned then child objects will have the key assigned to this. + +Otherwise it's just a defaultdict. + +### `reference` + +```python +reference = reference +``` + + + + + +# `openpyxl.utils.cell` + +Collection of utilities used within the package and also available for client code + +## `ABSOLUTE_RE` + +```python +ABSOLUTE_RE = re.compile('^' + RANGE_EXPR + '$', re.VERBOSE) +``` + +## `COL_RANGE` + +```python +COL_RANGE = '[A-Z]{1,3}:[A-Z]{1,3}:' +``` + +## `COORD_RE` + +```python +COORD_RE = re.compile('^[$]?([A-Za-z]{1,3})[$]?(\\d+)$') +``` + +## `RANGE_EXPR` + +```python +RANGE_EXPR = '\n[$]?(?P[A-Za-z]{1,3})?\n[$]?(?P\\d+)?\n(:[$]?(?P[A-Za-z]{1,3})?\n[$]?(?P\\d+)?)?\n' +``` + +## `ROW_RANGE` + +```python +ROW_RANGE = '\\d+:\\d+:' +``` + +## `SHEETRANGE_RE` + +```python +SHEETRANGE_RE = re.compile('{0}(?P{1})(?=,?)'.format(SHEET_TITLE, RANGE_EXPR), re.VERBOSE) +``` + +## `SHEET_TITLE` + +```python +SHEET_TITLE = "\n(('(?P([^']|'')*)')|(?P[^'^ ^!]*))!" +``` + +## `absolute_coordinate` + +```python +absolute_coordinate(coord_string) +``` + +Convert a coordinate to an absolute coordinate string (B12 -> $B$12) + +## `cols_from_range` + +```python +cols_from_range(range_string) +``` + +Get individual addresses for every cell in a range. +Yields one row at a time. + +## `column_index_from_string` + +```python +column_index_from_string(col) +``` + +Convert ASCII column name (base 26) to decimal with 1-based index + +Characters represent descending multiples of powers of 26 + +"AFZ" == 26 * pow(26, 0) + 6 * pow(26, 1) + 1 * pow(26, 2) + +## `coordinate_from_string` + +```python +coordinate_from_string(coord_string) +``` + +Convert a coordinate string like 'B12' to a tuple ('B', 12) + +## `coordinate_to_tuple` + +```python +coordinate_to_tuple(coordinate) +``` + +Convert an Excel style coordinate to (row, column) tuple + +## `get_column_interval` + +```python +get_column_interval(start, end) +``` + +Given the start and end columns, return all the columns in the series. + +The start and end columns can be either column letters or 1-based +indexes. + +## `get_column_letter` + +```python +get_column_letter(col_idx) +``` + +Convert decimal column position to its ASCII (base 26) form. + +Because column indices are 1-based, strides are actually pow(26, n) + 26 +Hence, a correction is applied between pow(26, n) and pow(26, 2) + 26 to +prevent and additional column letter being prepended + +"A" == 1 == pow(26, 0) +"Z" == 26 == pow(26, 0) + 26 // decimal equivalent 10 +"AA" == 27 == pow(26, 1) + 1 +"ZZ" == 702 == pow(26, 2) + 26 // decimal equivalent 100 + +## `quote_sheetname` + +```python +quote_sheetname(sheetname) +``` + +Add quotes around sheetnames if they contain spaces. + +## `range_boundaries` + +```python +range_boundaries(range_string) +``` + +Convert a range string into a tuple of boundaries: +(min_col, min_row, max_col, max_row) +Cell coordinates will be converted into a range with the cell at both end + +## `range_to_tuple` + +```python +range_to_tuple(range_string) +``` + +Convert a worksheet range to the sheetname and maximum and minimum +coordinate indices + +## `rows_from_range` + +```python +rows_from_range(range_string) +``` + +Get individual addresses for every cell in a range. +Yields one row at a time. + + + + + +# `openpyxl.utils.dataframe` + +## `dataframe_to_rows` + +```python +dataframe_to_rows(df, index = True, header = True) +``` + +Convert a Pandas dataframe into something suitable for passing into a worksheet. +If index is True then the index will be included, starting one row below the header. +If header is True then column headers will be included starting one column to the right. +Formatting should be done by client code. + +## `expand_index` + +```python +expand_index(index, header = False) +``` + +Expand axis or column Multiindex +For columns use header = True +For axes use header = False (default) + + + + + +# `openpyxl.utils.datetime` + +Manage Excel date weirdness. + +## `CALENDAR_MAC_1904` + +```python +CALENDAR_MAC_1904 = MAC_EPOCH +``` + +## `CALENDAR_WINDOWS_1900` + +```python +CALENDAR_WINDOWS_1900 = WINDOWS_EPOCH +``` + +## `ISO_DURATION` + +```python +ISO_DURATION = re.compile('PT((?P\\d+)H)?((?P\\d+)M)?((?P\\d+(\\.\\d{1,3})?)S)?') +``` + +## `ISO_FORMAT` + +```python +ISO_FORMAT = '%Y-%m-%dT%H:%M:%SZ' +``` + +## `ISO_REGEX` + +```python +ISO_REGEX = re.compile('\n(?P(?P\\d{4})-(?P\\d{2})-(?P\\d{2}))?T?\n(?P