title: How to use python-magic 5.19-1
body: <p>I need to determine MIME-types from files without suffix in python3 and I thought of python-magic as a fitting solution therefor.
  Unfortunately it does not work as described here:
  <a href="https://github.com/ahupp/python-magic/blob/master/README.md" rel="noreferrer">https://github.com/ahupp/python-magic/blob/master/README.md</a></p>
  
  <p>What happens is this:</p>
  
  <pre><code>&gt;&gt;&gt; import magic
  &gt;&gt;&gt; magic.from_file("testdata/test.pdf")
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  AttributeError: 'module' object has no attribute 'from_file'
  </code></pre>
  
  <p>So I had a look at the object, which provides me with the class <code>Magic</code> for which I found documentation here:
  <a href="http://filemagic.readthedocs.org/en/latest/guide.html" rel="noreferrer">http://filemagic.readthedocs.org/en/latest/guide.html</a></p>
  
  <p>I was surprised, that this did not work either:</p>
  
  <pre><code>&gt;&gt;&gt; with magic.Magic() as m:
  ...     pass
  ... 
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: __init__() missing 1 required positional argument: 'ms'
  &gt;&gt;&gt; m = magic.Magic()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: __init__() missing 1 required positional argument: 'ms'
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>I could not find any information about how to use the class <code>Magic</code> anywhere, so I went on doing trial and error, until I figured out, that it accepts instances of <code>LP_magic_set</code> only for <code>ms</code>.
  Some of them are returned by the module's methods
  <code>magic.magic_set()</code> and <code>magic_t()</code>.
  So I tried to instanciate <code>Magic</code> with either of them.
  When I then call the <code>file()</code> method from the instance, it will always return an empty result and the <code>errlvl()</code> method tells me error no. 22.
  So how do I use magic anyway?</p>