[okfn-labs] File type detection in python-magic, MS Office files

Thomas Kluyver takowl at gmail.com
Tue Apr 16 16:35:28 UTC 2013


On 16 April 2013 13:55, Marian Steinbach <marian at sendung.de> wrote:

> Is it possible to use one magic file accross different platforms? I've had
> bad luck with a magic and magic.mgc file copied from Ubuntu. Both create
> error messages.


You might look at PyXDG as an alternative. It uses the MIME database
specified by freedesktop.org (
http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html).
That will only exist on Linux systems, but if you copy the files, or load
the data you want to use yourself, the code should work on any platform.

PyXDG has been around for years, but I've taken over maintenance of it, and
I hope to get a version 1.0 out soon, with some substantial improvements to
the Mime module. It's documented here:
http://pyxdg.readthedocs.org/en/latest/mime.html

Best wishes,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/okfn-labs/attachments/20130416/3d02fa41/attachment-0002.html>


More information about the okfn-labs mailing list