title: Python equivalent to xdg-mime query filetype
body: <p>I'm looking for a python library that provides that returns exactly the same mime type for a given file as the bash command <code>xdg-mime query filetype &lt;filename&gt;</code>. The goal is to use that function to find all file in a diretory with a certain mime type (<code>application/mbox</code>)</p>
  
  <p>I'm aware of the <code>xdg</code> library, but none of its functions returns the same value as the <code>xdg-mime</code> command. </p>