With GroupDocs.Metadata, adding metadata to EPUB files in Python apps is straightforward. Just follow these steps.
- Open the EPUB file you want to update.
- Define the metadata key and value to add.
- Apply the changes.
- Save the updated file.
With GroupDocs.Metadata, adding metadata to EPUB files in Python apps is straightforward. Just follow these steps.
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")
Our API simplifies handling metadata. View, change, and organize document properties to improve file management and search.
Quickly read and analyze metadata from any file. Get info like author name, creation time, and more.
Change metadata directly—update tags to keep files well-organized and searchable.
Do more with metadata—add custom fields, remove unused info, and keep everything consistent.
This code sample shows how to insert a custom metadata tag into a TIFF image.
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")
Download GroupDocs.Metadata for free or get a trial license for full access!
Explore documentation, code samples, and community support to enhance your experience.
Add metadata to documents and images in multiple formats using GroupDocs.Metadata. Below are some commonly supported file types.