Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save documentprocessing/fab5431047636fa12d871c8c00185621 to your computer and use it in GitHub Desktop.
Save documentprocessing/fab5431047636fa12d871c8c00185621 to your computer and use it in GitHub Desktop.
Read metadata information from Excel using OpenPyXL
from openpyxl import load_workbook
# Load the Excel workbook
file_path = "example.xlsx"
workbook = load_workbook(file_path)
# Access the workbook's metadata
properties = workbook.properties
# Print metadata information
print("Excel Metadata:")
print(f"Title: {properties.title}")
print(f"Author: {properties.author}")
print(f"Subject: {properties.subject}")
print(f"Keywords: {properties.keywords}")
print(f"Created Date: {properties.created}")
print(f"Last Modified By: {properties.lastModifiedBy}")
print(f"Modified Date: {properties.modified}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment