PPT PPTX ODP POT ppsx
Aspose.Slides  for Python via .NET
OTP

Edit OTP properties using Python

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

Modify OTP 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 OTP Built-in Properties - Python


import aspose.slides as slides

# Instantiate the Presentation class that represents the Presentation
with slides.Presentation(path + "ModifyBuiltinProperties.otp") 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.otp", slides.export.SaveFormat.OTP)

Add Custom Properties to OTP - 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
    documentProperties.remove_custom_property(getPropertyName)

    # Saving presentation
    presentation.save("CustomDocumentProperties_out.otp", slides.export.SaveFormat.OTP)

How to Extract Metadata of OTP via Python

These are the steps to Extract Metadata from OTP files.

  1. Instantiate the Presentation class with path to OTP 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.