Which python libraries can be used to get detailed file attributes on a MacOSX file system? I have a hunch that it uses the os
module, but I've been unable to gain access to these attributes through python.
The most important attribute I want to access would be file 'kind'. Note that I'm not talking about the extension, but rather the 4th column from the screenshot below (taken from this SuperUser question). For example, when I loop through these files in this directory, how can I get "Plain text document" as the kind for license.txt? My application is a file-handling script that should discern directories from keynote/pages/numbers package files.
A note on duplication:
Also note that I have seen this particular SO question, which is in respect to general *nix file systems. My question is a subset of this question for MacOS file systems which may have some idiosyncrasies not discussed in that question. If a user can supply an example of HOW python-magic
can be used to get the file kind, then this will provide a more useful solution than the aforementioned article.