title: python docker sdk; get information about dangling docker images
body: <p>I have been trying for a while to get images information trying to follow the docs:
  <a href="https://docker-py.readthedocs.io/en/stable/images.html" rel="nofollow noreferrer">This doc specifically</a></p>
  <blockquote>
  <h3>list(**kwargs)</h3>
  <p>List images on the server.</p>
  <p><strong>Parameters:</strong></p>
  <ul>
  <li><strong>name</strong> (<em>str</em>) -- Only show images belonging to the repository <code>name</code></li>
  <li><strong>all</strong> (<em>bool</em>) -- Show intermediate image layers. By default, these are filtered out.</li>
  <li><strong>filters</strong> (<em>dict</em>) -- Filters to be processed on the image list. Available filters: - <code>dangling</code> (bool) - <code>label</code> (str): format either <code>key</code> or <code>key=value</code></li>
  </ul>
  </blockquote>
  <p>Now when I try and I have tried many things I can not figure out the right syntax:</p>
  <pre><code>sh-4.2# python
  Python 2.7.5 (default, Oct 30 2018, 23:45:53)
  [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
  Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
  &gt;&gt;&gt; import docker
  &gt;&gt;&gt; client = docker.from_env()
  &gt;&gt;&gt; for image in client.images.list('dangling'):
  ...     print image.id
  ...
  &gt;&gt;&gt; for image in client.images.list('dangling=true'):
  ...     print image.id
  ...
  &gt;&gt;&gt;
  </code></pre>
  <p>I have also tried other stuff, but just can't figure out how it works.
  What I need to is essentially filter them by dangling or not.</p>