title: How to calculate lines of code, comments and docstrings for a Python module?
body: <p>Is there a tool or snippet that produces the following output in some form:</p>
  
  <pre><code>lines_of_code = 98
  lines_of_comments = 24
  lines_of_documentation = 11
  </code></pre>
  
  <p><strong>NOTE 1</strong>: I will then try to feed this data to <a href="http://jenkins-ci.org/" rel="nofollow">Jenkins</a> to graph.</p>
  
  <p><strong>NOTE 2</strong>: I am aware that <a href="http://cloc.sourceforge.net/" rel="nofollow">CLOC</a> counts comments but I would like to separately count comments and docstrings.</p>