Extract Metadata from Documents

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Parser MCP server lets your agent work with files on your machine; they are never uploaded. It runs in Docker: replace /path/to/documents with the folder it may use.

claude mcp add groupdocs-parser -- docker run --rm -i -v /path/to/documents:/data ghcr.io/groupdocs-parser/parser-net-mcp:latest
Folders, licensing and more →

GroupDocs.Parser extracts metadata such as author, title, creation date, and custom properties from supported formats (see supported formats).

Extract metadata

from groupdocs.parser import Parser

with Parser("./sample.pdf") as parser:
    metadata_items = parser.get_metadata()
    if metadata_items is None:
        print("Metadata extraction is not supported for this format.")
    else:
        for item in metadata_items:
            print(f"{item.name}: {item.value}")

The following sample file is used in this example: sample.pdf

title: Harbor Lane Provisions - Annual Report 2025
subject: Annual report and financial summary
keywords: annual report, wholesale, Autumn Harvest, revenue, logistics
author: Amara Osei
application: Aspose Pty Ltd.
last-saved-time: 02/16/2026 11:00:00

Download full output

Steps

  1. Create a Parser for the target document.
  2. Call get_metadata() to receive a collection of metadata items.
  3. Iterate through name and value pairs and process them as needed.

For deeper parsing (attachments, text, images), combine metadata extraction with other basic usage topics.