GroupDocs.Metadata for Python via .NET

Add Metadata to ODT Files in Python

Use the GroupDocs.Metadata for Python via .NET API to insert custom metadata into many types of documents, images, audio, and video formats.

How to Add Metadata to Odt in Python

With GroupDocs.Metadata, adding metadata to ODT files in Python apps is straightforward. Just follow these steps.

  1. Open the ODT file you want to update.
  2. Define the metadata key and value to add.
  3. Apply the changes.
  4. Save the updated file.
from groupdocs.metadata import Metadata
from groupdocs.metadata.common import PropertyValue
from groupdocs.metadata.tagging import Tags

def add_metadata_property():
    # Load the file using the Metadata class
    with Metadata("./input.odt") as metadata:
        # Add a metadata property with the author's name
        property_value = PropertyValue("test content author")
        # Run the metadata update
        affected = metadata.add_properties(
            lambda p: Tags.person.creator in list(p.tags), property_value
        )
        print(f"Affected properties: {affected}")
        # Save the file with the new metadata
        metadata.save("./output.odt")

if __name__ == "__main__":
    add_metadata_property()
pip install groupdocs-metadata-net
click to copy
copied
More examples Documentation

Manage Document Metadata Easily

Our API simplifies handling metadata. View, change, and organize document properties to improve file management and search.

Features for Editing Metadata

Access Metadata

Quickly read and analyze metadata from any file. Get info like author name, creation time, and more.

Edit Metadata

Change metadata directly—update tags to keep files well-organized and searchable.

Advanced Metadata Features

Do more with metadata—add custom fields, remove unused info, and keep everything consistent.

Add Custom Metadata to a TIFF File

This code sample shows how to insert a custom metadata tag into a TIFF image.

Python

from groupdocs.metadata import Metadata
from groupdocs.metadata.formats.image import TiffAsciiTag, TiffTagID
from groupdocs.metadata.standards.exif import ExifPackage

def add_exif_artist_tag():
    # Open the TIFF image
    with Metadata("./input.tiff") as metadata:
        root = metadata.get_root_package()
        if root is not None:
            if root.exif_package is None:
                root.exif_package = ExifPackage()
            # Define the metadata key and value
            data = TiffAsciiTag(TiffTagID.ARTIST, "Awesome artist")
            # Add the metadata
            root.exif_package.set(data)
            # Save the updated image
            metadata.save("./output.tiff")

if __name__ == "__main__":
    add_exif_artist_tag()

About the GroupDocs.Metadata for Python via .NET API

GroupDocs.Metadata for Python via .NET provides a powerful set of tools for working with metadata. Developers can view, edit, delete, search, compare, and export metadata from a wide range of documents and media formats—without needing third-party tools. Add metadata to PDFs, Microsoft Office files, Outlook, Visio, AutoCAD, archives, and multimedia files. Build flexible metadata features into any GroupDocs.Metadata application.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Metadata for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Supported Formats for Adding Metadata

Add metadata to documents and images in multiple formats using GroupDocs.Metadata. Below are some commonly supported file types.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English