Paper Office
paper-pptxAPI referenceopc.packuri

PackURI

paper-pptx 0.2.0 API reference

Proxy for a pack URI (partname).

Provides utility properties the baseURI and the filename slice. Behaves as str otherwise.

Attributes

baseURI

attributebaseURIstr

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

attributeextstr

The extension portion of this pack URI.

E.g. "xml" for "/ppt/slides/slide1.xml". Note the leading period is not included.

filename

attributefilenamestr

The "filename" portion of this pack URI.

E.g. "slide1.xml" for "/ppt/slides/slide1.xml".

For the package pseudo-partname "/", filename is ''.

idx

attributeidxint | 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

attributemembernamestr

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 "/".

rels_uri

attributerels_uriPackURI

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 "/".

Functions

from_rel_ref

funcfrom_rel_ref(baseURI: str, relative_ref: str) -> PackURI

Construct an absolute pack URI formed by translating relative_ref onto baseURI.

parambaseURIstr
paramrelative_refstr

Returns

pptx.opc.packuri.PackURI

relative_ref

funcrelative_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".

parambaseURIstr

Returns

str

On this page