Aspose.Slides  for Python via .NET

Edit POTX properties using Python

Build your own Python apps to modify Built-in and Custom properties in presentation files using server-side APIs.

Modify POTX Properties via Python

Using Aspose.Slides for Python via .NET, developers can access and modify the values of built-in properties as well as custom properties. Developers can use DocumentProperties property exposed by Presentation object to access the document properties of the presentation file.

Modify POTX Built-in Properties - Python

import aspose.slides as slides

# Instantiate the Presentation class that represents the Presentation
with slides.Presentation(path + "ModifyBuiltinProperties.potx") as presentation:
    # Create a reference to object associated with Presentation
    documentProperties = presentation.document_properties

    # Set the builtin properties
    documentProperties.author = "Aspose.Slides for Python"
    documentProperties.title = "Modifying Presentation Properties"
    documentProperties.subject = "Aspose Subject"
    documentProperties.comments = "Aspose Description"
    documentProperties.manager = "Aspose Manager"

    # save your presentation to a file
    presentation.save("DocumentProperties_out.potx", slides.export.SaveFormat.POTX)

Add Custom Properties to POTX - Python

import aspose.slides as slides

# Instantiate the Presentation class
with slides.Presentation() as presentation:
    # Getting Document Properties
    documentProperties = presentation.document_properties

    # Adding Custom properties
    documentProperties.set_custom_property_value("New Custom", 12)
    documentProperties.set_custom_property_value("My Nam", "Aspose Metadata Editor")
    documentProperties.set_custom_property_value("Custom", 124)

    # Getting property name at particular index
    getPropertyName = documentProperties.get_custom_property_name(2)

    # Removing selected property

    # Saving presentation
    presentation.save("CustomDocumentProperties_out.potx", slides.export.SaveFormat.POTX)

How to Extract Metadata of POTX via Python

These are the steps to Extract Metadata from POTX files.

  1. Instantiate the Presentation class with path to POTX file

  2. Get DocumentProperties object associated with Presentation

  3. Loop over the items in DocumentProperties object

  4. Access and modify custom properties

Other Supported Metadata Formats

Using Python, You can also manipulate metadata of many other formats including.