Question about available python lib for a task

Tim Roberts timr at probo.com
Sun May 15 20:50:59 EDT 2011


cesium5500 at yahoo.ca wrote:
>
>I would like to build a database of all the MS-Excel file on a LAN. I 
>would like to get the files metadata : filename, summary, location, 
>size, etc.
>
>Is there a dedicated python lib for the task?

No.  The file name, location, and size are all completely generic.  You can
do that with standard Python and the os.walk command.

The document properties (like the summary) can be accessed in a couple of
ways.  You can do it in Excel by opening the application, opening the
document, and using the BuiltinDocumentProperties collection.  Or, you can
do it without Excel, using the COM interfaces for "structured storage",
like IPropertySetStorage and IPropertyStorage.

>Is pywin32 one of the possible lib available?

You will need PyWin32 in order to use COM to launch Excel, or use the
structured storage interfaces.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list