#!/usr/bin/env python # coding: utf-8 # # Pip Package Tree Navigation (to replace dying pipdeptree) # ## Command line integration # In[1]: # packages need per pip install pandas, on 2 level of depth get_ipython().system('wppm -p pandas') # In[2]: # packages need per pip install pandas[test], on 2 level of depth get_ipython().system('wppm -p pandas[test]') # In[3]: # packages need per pip install pandas[test], on 9 level of depth get_ipython().system('wppm -l 9 -p pandas[test]') # In[4]: # packages needing pytest on 2 level of depth get_ipython().system('wppm -r pytest') # In[5]: # packages needing pytest on their [test] install on 1 level of depth get_ipython().system('wppm -l 1 -r pytest[test]') # ## Python Code integration # In[6]: from winpython import piptree # In[7]: pip = piptree.pipdata() # In[8]: # packages need per pip install pandas[tes, on all level of depth pip.down('pandas', 'test') # In[9]: # data version of pipdown pip._downraw('pandas', 'test') # In[10]: # packages needing pytest on all level of depth pip.up('pytest') # collected data for packag # In[11]: # data version of pipdown pip._upraw('pytest') # In[12]: # data details of 'sqlite-bro' package pip.distro['sqlite-bro'] # In[13]: # description of ipythonpackage pip.description('ipython') # In[14]: # equivalent of pip list datas, limited to 42 first packages for p in pip.pip_list()[:42]: print(*p) # In[ ]: