Load from a local disk

The following example demonstrates how to load a file from a local disk by passing its path to the Metadata constructor.

from groupdocs.metadata import Metadata


def load_from_local_disk():
    # Absolute or relative path to your document
    with Metadata("input.docx") as metadata:
        # Extract, edit or remove metadata here
        info = metadata.get_document_info()
        print(f"Loaded {info.file_type.file_format} ({info.size} bytes)")


if __name__ == "__main__":
    load_from_local_disk()

input.docx is the sample file used in this example. Click here to download it.

Loaded 3 (17952 bytes)

Download full output

See also

More resources

GitHub examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free online document metadata management App

You are welcome to view and edit metadata of PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, emails, images and more with our free online Free Online Document Metadata Viewing and Editing App.