title: Get All Functions, Classes, datatypes from Python
body: <p>I am developing a small python learning app. where student simply searches for keywords like, <code>list</code>, <code>date</code> my app gives output as help text for keyword.</p>
  
  <p>first i want to extract all python builtins, classes help text using help() into json file.
  I tried:</p>
  
  <pre><code>&gt;&gt;&gt; import sys
  &gt;&gt;&gt; sys.modules.keys()
  ['__future__', 'copy_reg', 'sre_compile', '_hashlib', '_sre', 'encodings', 'site', '__builtin__', 'datetime', '__main__', 'encodings.encodings', 'hashlib', 'abc', 'posixpath', '_random', '_weakrefset', 'errno', 'binascii', 'encodings.codecs', 'sre_constants', 're', '_abcoll', 'types', '_codecs', '_warnings', 'math', 'genericpath', 'stat', 'zipimport', 'encodings.__builtin__', 'warnings', 'UserDict', 'encodings.utf_8', 'sys', 'codecs', 'readline', 'os.path', '_locale', 'sitecustomize', 'signal', 'random', 'linecache', 'posix', 'encodings.aliases', 'exceptions', 'sre_parse', 'os', '_weakref']
  </code></pre>
  
  <p>with above result i can extract </p>
  
  <pre><code>&gt;&gt;&gt; bi = sys.modules.get('__builtin__')
  &gt;&gt;&gt; help(bi.list.append) (or)
  &gt;&gt;&gt; bi.list.append.__doc__
  'L.append(object) -- append object to end'  # goes to json file
  </code></pre>
  
  <p><code>sys.modules</code> gives <code>re</code>, <code>random</code>,etc. but <strong>i didn't find <code>datetime</code></strong> in above list of modules. how to find all available functions, data types, classes etc from python?</p>
  
  <p>Note: my goal is to extract help text as much as possible from python. not only sys.modules any method can be appreciated.</p>
  
  <p>Edit: there is no datetime at first.</p>
  
  <pre><code>&gt;&gt;&gt; import sys
  &gt;&gt;&gt; sys.modules.keys()
  ['copy_reg', 'encodings', 'site', '__builtin__', '__main__', 'encodings.encodings', 'abc', 'posixpath', '_weakrefset', 'errno', 'encodings.codecs', '_abcoll', 'types', '_codecs', '_warnings', 'genericpath', 'stat', 'zipimport', 'encodings.__builtin__', 'warnings', 'UserDict', 'encodings.utf_8', 'sys', 'codecs', 'readline', 'os.path', 'sitecustomize', 'signal', 'linecache', 'posix', 'encodings.aliases', 'exceptions', 'os', '_weakref']
  </code></pre>
  
  <p>After importing datetime sys.modules</p>
  
  <pre><code>&gt;&gt;&gt; import datetime
  &gt;&gt;&gt; sys.modules.keys()
  ['copy_reg', 'encodings', 'site', '__builtin__', 'datetime', '__main__', 'encodings.encodings', 'abc', 'posixpath', '_weakrefset', 'errno', 'encodings.codecs', '_abcoll', 'types', '_codecs', '_warnings', 'genericpath', 'stat', 'zipimport', 'encodings.__builtin__', 'warnings', 'UserDict', 'encodings.utf_8', 'sys', 'codecs', 'readline', 'os.path', 'sitecustomize', 'signal', 'linecache', 'posix', 'encodings.aliases', 'exceptions', 'os', '_weakref']
  &gt;&gt;&gt; 
  </code></pre>