title: Python package dependency tree
body: <p>I would like to analyze the dependency tree of Python packages.  How can I obtain this data?</p>
  
  <p>Things I already know</p>
  
  <ol>
  <li><code>setup.py</code> sometimes contains a <code>requires</code> field that lists package dependencies</li>
  <li>PyPi is an online repository of Python packages</li>
  <li>PyPi has an API</li>
  </ol>
  
  <p>Things that I don't know</p>
  
  <ol>
  <li>Very few projects (around 10%) on PyPi explicitly list dependencies in the <code>requires</code> field but <code>pip/easy_install</code> still manage to download the correct packages.  What am I missing?  For example the popular library for statistical computing, <code>pandas</code>, doesn't list <code>requires</code> but still manages to install <code>numpy</code>, <code>pytz</code>, etc.... Is there a better way to automatically collect the full list of dependencies?</li>
  <li>Is there a pre-existing database somewhere?  Am I repeating existing work?</li>
  <li>Do similar, easily accessible, databases exist for other languages with distribution systems (R, Clojure, etc...?)</li>
  </ol>