GroupDocs.Metadata for Python via .NET

Add Metadata to EPUB 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 Epub in Python

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

  1. Open the EPUB file you want to update.
  2. Define the metadata key and value to add.
  3. Apply the changes.
  4. Save the updated file.
import groupdocs.metadata as gm

def run():

    # Load the file using the Metadata class
    with gm.Metadata("input.epub") as metadata:

        # Add a metadata property with the author's name
        specification = gm.search.ContainsTagSpecification(gm.tagging.Tags.person.creator)
        property_value = gm.common.PropertyValue("test content author")

        # Run the metadata update
        affected = metadata.add_properties(specification, property_value)
        print(f"Affected properties: {affected}")
    
        # Save the file with the new metadata
        metadata.save("output.epub")
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

import groupdocs.metadata as gm
import groupdocs.metadata.standards.exif as gmse
import groupdocs.metadata.formats.image as gmfi

def run():

    #  Open the TIFF image
    with gm.Metadata("input.tiff") as metadata:

        root = cast(gmse.IExif, metadata.get_root_package())

        if root is not None:

            if root.exif_package is None:
                root.exif_package = gmse.ExifPackage()

            # Define the metadata key and value
            data = gmfi.TiffAsciiTag(gmfi.TiffTagID.ARTIST, "Awesome artist")

            # Add the metadata
            root.exif_package.set(data)

            # Save the updated image
            metadata.save("output.tiff")

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