title: Is there a more reliable drop-in replacement for mimetypes.guess_extension()?
body: <p>I'm up against the following (Python 2.7.10 on Ubuntu Trusty):</p>
  
  <pre><code>&gt;&gt;&gt; from mimetypes import guess_extension
  &gt;&gt;&gt; guess_extension('text/html')
  '.html'
  &gt;&gt;&gt; guess_extension('application/json')
  '.json'
  &gt;&gt;&gt; guess_extension('text/plain')
  '.ksh'
  &gt;&gt;&gt; guess_extension('audio/mp3')
  &gt;&gt;&gt;
  </code></pre>
  
  <p>It got text/html and application/json right, made a bad guess for text/plain, and gave me nothing for audio/mp3. (Interestingly, changing the last one to audio/mpeg returns <code>'.mp3'</code> as expected, but that's not what my data source uses.)</p>
  
  <p>Is there a more reliable alternative to this module that would return <code>'.txt'</code> and <code>'.mp3'</code> in my last two cases? I looked into python-magic, but based on everything I saw it looks like it needs to read the actual file data to function. In my case, all I have is the MIME type as a string.</p>