0

I'd like to collect some information about the properties for an excel file, such as:

The Author, Last saved and Last printed.

Here is the code I used to get access time, modified time, change time and size. print('Access time :', time.ctime(os.path.getatime(file)))

print('Modified time:', time.ctime(os.path.getmtime(__file__)))

print('Change time  :', time.ctime(os.path.getctime(__file__)))

print('Size         :', os.path.getsize(__file__))

information like: author, last saved, last printed

I was looking through these but nothing helpful: https://docs.python.org/2/library/os.path.html

I have the difference between the original date and time of creation/modification (originally) and the date/time of download.

1 Answer 1

1

what about (after pip install openpyxl):

from openpyxl import load_workbook
wb = load_workbook('foo.xlsx')
wb.properties

Parameters: creator='openpyxl', title=None, description=None, subject=None, identifier=None, language=None, created=datetime.datetime(2018, 3, 11, 14, 47, 30, 624845), modified=datetime.datetime(2018, 3, 11, 14, 47, 30, 624851), lastModifiedBy=None, category=None, contentStatus=None, version=None, revision=None, keywords=None, lastPrinted=None

Sign up to request clarification or add additional context in comments.

1 Comment

openpyxl is working only with .xlsx format and I need those properties for .xls format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.