Paper Office
paper-pptxAPI referenceshapes.autoshape

AutoShapeType

paper-pptx 0.2.0 API reference

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.

AutoShapeType(autoshape_type_id: MSO_AUTO_SHAPE_TYPE)

Attributes

autoshape_type_id

attributeautoshape_type_idMSO_AUTO_SHAPE_TYPE

MSO_AUTO_SHAPE_TYPE enumeration member identifying this auto shape type.

basename

attributebasenamestr

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').

prst

attributeprst

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'.

Functions

default_adjustment_values

funcdefault_adjustment_values(prst: MSO_AUTO_SHAPE_TYPE) -> tuple[AdjustmentValue, ...]

Sequence of (name, value) pair adjustment value defaults for prst autoshape-type.

paramprstMSO_AUTO_SHAPE_TYPE

Returns

tuple[pptx.spec.AdjustmentValue, ...]

id_from_prst

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

paramprststr

Returns

pptx.enum.shapes.MSO_AUTO_SHAPE_TYPE

On this page