title: Looping through imported classes in python
body: <p>For a multitude of reasons I find myself in the position of importing many python modules and wanting to iterate through each of the Classes in the module.</p>
  
  <pre><code>from capacity_hdd_parser import CapacityHDDParser
  from capacity_ssd_parser import CapacitySSDParser
  from checksum_parser import ChecksumParser
  .
  .
  .
  </code></pre>
  
  <p>each parser inheritances from a base class and has a method I want to call on each parser</p>
  
  <pre><code>parsers = [CapacityHDDParser, CapacitySSDParser, ChecksumParser]
  for parser in parsers:
      parser_instance = parser()
      data_returned = parser_instance.parse(logset_path)
      # Do a bunch of post processing here.
  </code></pre>
  
  <p>My problem is that I have many parsers to go through and I feel like there has to be a way to dynamically iterate through imported class. Having to hand write each of these is not only a pain in the ass it makes the intent of my code much harder to see in the noise.</p>