Sid
Sid

Reputation: 1144

How to access file metadata with Python?

I'm trying to write a program in python that retrieves and updates file metadata on windows. I've tried searching on Google regarding what modules to use but I haven't found anything very concrete or useful.

Some people suggested the stat module which can give you info such as file access and last modification. But I'm looking to retrieve other types of metadata available on Windows. For example tags, author, rating, artists etc.

How can I retrieve this information for a file using Python?

Thanks

Upvotes: 4

Views: 8526

Answers (1)

Alex Martelli
Alex Martelli

Reputation: 881635

Essentially as I said here less than an hour ago,

Apparently, you need to use the Windows Search API looking for System.Keywords -- you can access the API directly via ctypes, or indirectly (needing win32 extensions) through the API's COM Interop assembly. Sorry, I have no vista installation on which to check, but I hope these links are useful!

Links don't preserve across copy and paste, please just visit the other SO questions for them;-).

Upvotes: 2

Related Questions