The ``docProps/app.xml`` part carries application-level metadata (Application, AppVersion, Company, Manager, PresentationFormat, HyperlinkBase, Template). Each case isolates one field, so each XPath assertion proves that particular field round-trips via python-pptx's Presentation.extended_properties API.
| Library | Pass | Fail | Pending |
|---|---|---|---|
python-pptx | 0 | 0 | 7 |
pptxjs | 0 | 0 | 7 |
field (7 values): application, app-version, company, manager, presentation-format, hyperlink-base, templatescripts/gen_extended_properties_basic_pptx.py — runs with --arg_template --field {field.id} --value "{field.value}" --out fixtures/pptx/extended-properties-basic--{field.id}.pptx
#!/usr/bin/env python3
"""Generate ``fixtures/pptx/extended-properties-basic--<field>.pptx`` fixtures.
Parameterised generator; mirror of the docx / xlsx counterparts. Drives
``features/pptx/extended-properties-basic.json``.
"""
from __future__ import annotations
import argparse
import datetime as _dt
from pathlib import Path
from pptx import Presentation
_REPO_ROOT = Path(__file__).resolve().parent.parent
_REPRODUCIBLE_DT = _dt.datetime(2000, 1, 1, 0, 0, 0)
_PINNED_CREATED = _dt.datetime(2026, 1, 1, 0, 0, 0, tzinfo=_dt.timezone.utc)
_PINNED_MODIFIED = _dt.datetime(2026, 1, 2, 0, 0, 0, tzinfo=_dt.timezone.utc)
def _apply(prs, field: str, value: str) -> None:
ep = prs.extended_properties
if field == "application":
ep.application = value
elif field == "app-version":
ep.app_version = value
elif field == "company":
ep.company = value
elif field == "manager":
ep.manager = value
elif field == "presentation-format":
ep.presentation_format = value
elif field == "hyperlink-base":
ep.hyperlink_base = value
elif field == "template":
ep.template = value
else:
raise SystemExit(f"Unknown field id: {field!r}")
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("--field", required=True)
parser.add_argument("--value", required=True)
parser.add_argument(
"--out",
default=str(_REPO_ROOT / "fixtures" / "pptx" / "extended-properties-basic.pptx"),
)
args = parser.parse_args()
out_path = Path(args.out)
if not out_path.is_absolute():
out_path = _REPO_ROOT / out_path
prs = Presentation()
prs.slides.add_slide(prs.slide_layouts[6])
# Pin core-props timestamps so only app.xml varies per case.
prs.core_properties.created = _PINNED_CREATED
prs.core_properties.modified = _PINNED_MODIFIED
_apply(prs, args.field, args.value)
out_path.parent.mkdir(parents=True, exist_ok=True)
prs.save(out_path, zip_date_time=_REPRODUCIBLE_DT)
print(out_path)
return 0
if __name__ == "__main__":
raise SystemExit(main())
{
"$schema": "../manifest.schema.json",
"id": "pptx/extended-properties-basic",
"kind": "parameterised",
"title": "Extended (app) properties: common scalar fields",
"format": "pptx",
"category": "metadata",
"summary": "The ``docProps/app.xml`` part carries application-level metadata (Application, AppVersion, Company, Manager, PresentationFormat, HyperlinkBase, Template). Each case isolates one field, so each XPath assertion proves that particular field round-trips via python-pptx's Presentation.extended_properties API.",
"spec": {
"source": "ecma-376-5-part-4",
"clause": "22.2",
"notes": "ECMA-376 Part 4 / ISO 29500-4 section 22.2 defines the extended-properties part (``docProps/app.xml``). python-pptx exposes the scalar subset (Application, AppVersion, Company, Manager, HyperlinkBase, PresentationFormat, Template); the Slides count is auto-synced from the slide list at save-time (see python-pptx issue #131) so it is not included in this family. DocSecurity is not exposed by python-pptx and is omitted from this manifest."
},
"fixtures": {
"machine": "pptx/extended-properties-basic"
},
"generator": {
"python": "scripts/gen_extended_properties_basic_pptx.py",
"arg_template": "--field {field.id} --value \"{field.value}\" --out fixtures/pptx/extended-properties-basic--{field.id}.pptx"
},
"parameters": {
"field": [
{
"id": "application",
"value": "Loadfix python-pptx",
"xpath": "//ep:Application"
},
{
"id": "app-version",
"value": "16.0000",
"xpath": "//ep:AppVersion"
},
{
"id": "company",
"value": "Loadfix Inc.",
"xpath": "//ep:Company"
},
{
"id": "manager",
"value": "Eve Manager",
"xpath": "//ep:Manager"
},
{
"id": "presentation-format",
"value": "Widescreen",
"xpath": "//ep:PresentationFormat"
},
{
"id": "hyperlink-base",
"value": "https://example.com/",
"xpath": "//ep:HyperlinkBase"
},
{
"id": "template",
"value": "Blank.potx",
"xpath": "//ep:Template"
}
]
},
"assertions_template": [
{
"id": "ext-{field.id}-present",
"part": "docProps/app.xml",
"namespaces": {
"ep": "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
},
"xpath": "{field.xpath}",
"must": "exist",
"description": "The {field.id} element must be present in docProps/app.xml."
},
{
"id": "ext-{field.id}-value",
"part": "docProps/app.xml",
"namespaces": {
"ep": "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
},
"xpath": "{field.xpath}",
"must": "equal",
"value": "{field.value}",
"description": "The {field.id} element's text must equal the supplied value."
}
]
}