Created
January 22, 2025 16:56
-
-
Save documentprocessing/fab5431047636fa12d871c8c00185621 to your computer and use it in GitHub Desktop.
Read metadata information from Excel using OpenPyXL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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