Pip Package Tree Navigation (to replace dying pipdeptree)¶
Command line integration¶
In [1]:
# packages need per pip install pandas, on 2 level of depth
!wppm -p pandas
pandas==1.4.3 ,
python-dateutil==2.8.2 (>=2.8.1),
six==1.16.0 (>=1.5)
pytz==2022.1 (>=2020.1)
numpy==1.22.4 (>=1.21.0)
In [2]:
# packages need per pip install pandas[test], on 2 level of depth
!wppm -p pandas[test]
pandas[test]==1.4.3 ,
python-dateutil==2.8.2 (>=2.8.1),
six==1.16.0 (>=1.5)
pytz==2022.1 (>=2020.1)
numpy==1.22.4 (>=1.21.0)
hypothesis==6.46.9 (>=5.5.3),
attrs==22.1.0 (>=19.2.0)
sortedcontainers==2.4.0 (<3.0.0,>=2.1.0)
pytest==7.1.1 (>=6.0),
attrs==22.1.0 (>=19.2.0)
iniconfig==1.1.1
packaging==21.3
pluggy==1.0.0 (<2.0,>=0.12)
py==1.11.0 (>=1.8.2)
tomli==2.0.1 (>=1.0.0)
atomicwrites==1.4.0 (>=1.0)
colorama==0.4.4
In [3]:
# packages need per pip install pandas[test], on 9 level of depth
!wppm -l 9 -p pandas[test]
pandas[test]==1.4.3 ,
python-dateutil==2.8.2 (>=2.8.1),
six==1.16.0 (>=1.5)
pytz==2022.1 (>=2020.1)
numpy==1.22.4 (>=1.21.0)
hypothesis==6.46.9 (>=5.5.3),
attrs==22.1.0 (>=19.2.0)
sortedcontainers==2.4.0 (<3.0.0,>=2.1.0)
pytest==7.1.1 (>=6.0),
attrs==22.1.0 (>=19.2.0)
iniconfig==1.1.1
packaging==21.3 ,
pyparsing==2.4.7 (!=3.0.5,>=2.0.2)
pluggy==1.0.0 (<2.0,>=0.12)
py==1.11.0 (>=1.8.2)
tomli==2.0.1 (>=1.0.0)
atomicwrites==1.4.0 (>=1.0)
colorama==0.4.4
In [4]:
# packages needing pytest on 2 level of depth
!wppm -r pytest
pytest==7.1.1 ,
nbval==0.9.6 [requires: pytest(>=2.8)]
In [5]:
# packages needing pytest on their [test] install on 1 level of depth
!wppm -l 1 -r pytest[test]
pytest[test]==7.1.1 ,
wheel==0.37.1 [requires: pytest(>=3.0.0)],
validators==0.18.2 [requires: pytest(>=2.2.3)],
tzlocal==4.2 [requires: pytest(>=4.3)],
typer==0.4.2 [requires: pytest>=4.4.0,<5.4.0],
traittypes==0.2.1 [requires: pytest],
traitlets==5.3.0 [requires: pytest],
tinycss2==1.1.1 [requires: pytest],
three-merge==0.1.1 [requires: pytest],
textdistance==4.2.2 [requires: pytest],
sqlite-utils==3.26 [requires: pytest],
sqlite-fts4==1.0.3 [requires: pytest],
spyder==5.4.0.dev0 [requires: pytest(<7.0)],
spyder-kernels==2.3.2 [requires: pytest],
sphinxcontrib-serializinghtml==1.1.5 [requires: pytest],
sphinxcontrib-qthelp==1.0.3 [requires: pytest],
sphinxcontrib-jsmath==1.0.1 [requires: pytest],
sphinxcontrib-htmlhelp==2.0.0 [requires: pytest],
sphinxcontrib-devhelp==1.0.2 [requires: pytest],
sphinxcontrib-applehelp==1.0.2 [requires: pytest],
sphinx==5.0.2 [requires: pytest(>=4.6)],
snuggs==1.4.7 [requires: pytest],
smart-open==5.2.1 [requires: pytest],
shapely==1.8.2 [requires: pytest],
shap==0.40.0 [requires: pytest],
scikit-image==0.19.3 [requires: pytest(>=5.2.0)],
rasterio==1.2.10 [requires: pytest(>=2.8.2)],
qtpy==2.2.0.dev0 [requires: pytest(!=7.0.0,!=7.0.1,>=6)],
qtconsole==5.3.1 [requires: pytest],
qstylizer==0.2.1 [requires: pytest(<7,>=6)],
python-lsp-server==1.5.0 [requires: pytest],
python-lsp-jsonrpc==1.0.0 [requires: pytest],
pyerfa==2.0.0.1 [requires: pytest],
pint==0.19.2 [requires: pytest],
patsy==0.5.2+dev [requires: pytest],
pathy==0.6.2 [requires: pytest],
papermill==2.3.4 [requires: pytest(>=4.1)],
pandas==1.4.3 [requires: pytest(>=6.0)],
octave-kernel==0.34.1 [requires: pytest],
oct2py==5.4.3 [requires: pytest],
notebook==6.4.12 [requires: pytest],
notebook-shim==0.1.0 [requires: pytest],
networkx==2.8.5 [requires: pytest(>=7.1)],
nbval==0.9.6 [requires: pytest(>=2.8)],
nbformat==5.4.0 [requires: pytest],
nbdime==3.1.1 [requires: pytest(>=3.6)],
nbconvert==6.5.0 [requires: pytest],
nbclient==0.6.6 [requires: pytest(>=4.1)],
nbclassic==0.4.3 [requires: pytest],
mpl-scatter-density==0.7 [requires: pytest],
moviepy==1.0.3 [requires: pytest(<4.0,>=3.0.0)],
metakernel==0.28.2 [requires: pytest],
mercantile==1.2.1 [requires: pytest],
jupyterlab==3.4.4 [requires: pytest(>=6.0)],
jupyterlab-launcher==0.13.1 [requires: pytest],
jupyter-server==1.18.1 [requires: pytest(>=6.0)],
jupyter-server-proxy==3.2.1 [requires: pytest],
jupyter-server-mathjax==0.2.6 [requires: pytest],
jupyter-packaging==0.12.2 [requires: pytest],
jupyter-core==4.11.1 [requires: pytest],
jupyter-client==7.3.4 [requires: pytest],
julia==0.5.7 [requires: pytest(>=4.4)],
ipywidgets==7.7.1 [requires: pytest(>=3.6.0)],
imageio==2.19.3 [requires: pytest],
httpie==3.2.1 [requires: pytest],
graphene==3.1 [requires: pytest(<7,>=6)],
gpytorch==1.5.1 [requires: pytest],
flask-restx==0.5.1 [requires: pytest(==5.4.1)],
fiona==1.8.21 [requires: pytest(>=3)],
fastapi==0.79.0 [requires: pytest>=6.2.4,<7.0.0],
fast-histogram==0.11 [requires: pytest],
datasette==0.61.1 [requires: pytest(<7.2.0,>=5.2.2)],
datasette-graphql==2.0.2 [requires: pytest],
dask==2022.8.0 [requires: pytest],
dask-ml==2022.5.27 [requires: pytest],
csvs-to-sqlite==1.3.1a0 [requires: pytest],
cryptography==3.4.7 [requires: pytest(>=6.0)],
botorch==0.4.0 [requires: pytest],
astropy==5.0.4 [requires: pytest(>=7.0)],
asteval==0.9.27 [requires: pytest],
asgi-csrf==0.9 [requires: pytest],
anyio==3.6.1 [requires: pytest(>=7.0)],
affine==2.3.1 [requires: pytest(>=4.6)]
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')
pandas[test]==1.4.3 ,
python-dateutil==2.8.2 (>=2.8.1),
six==1.16.0 (>=1.5)
pytz==2022.1 (>=2020.1)
numpy==1.22.4 (>=1.21.0)
hypothesis==6.46.9 (>=5.5.3),
attrs==22.1.0 (>=19.2.0)
sortedcontainers==2.4.0 (<3.0.0,>=2.1.0)
pytest==7.1.1 (>=6.0),
attrs==22.1.0 (>=19.2.0)
iniconfig==1.1.1
packaging==21.3 ,
pyparsing==2.4.7 (!=3.0.5,>=2.0.2)
pluggy==1.0.0 (<2.0,>=0.12)
py==1.11.0 (>=1.8.2)
tomli==2.0.1 (>=1.0.0)
atomicwrites==1.4.0 (>=1.0)
colorama==0.4.4
In [9]:
# data version of pipdown
pip._downraw('pandas', 'test')
Out[9]:
[['pandas[test]==1.4.3 ', ['python-dateutil==2.8.2 (>=2.8.1)', ['six==1.16.0 (>=1.5)']], ['pytz==2022.1 (>=2020.1)'], ['numpy==1.22.4 (>=1.21.0)'], ['hypothesis==6.46.9 (>=5.5.3)', ['attrs==22.1.0 (>=19.2.0)'], ['sortedcontainers==2.4.0 (<3.0.0,>=2.1.0)']], ['pytest==7.1.1 (>=6.0)', ['attrs==22.1.0 (>=19.2.0)'], ['iniconfig==1.1.1 '], ['packaging==21.3 ', ['pyparsing==2.4.7 (!=3.0.5,>=2.0.2)']], ['pluggy==1.0.0 (<2.0,>=0.12)'], ['py==1.11.0 (>=1.8.2)'], ['tomli==2.0.1 (>=1.0.0)'], ['atomicwrites==1.4.0 (>=1.0)'], ['colorama==0.4.4 ']]]]
In [10]:
# packages needing pytest on all level of depth
pip.up('pytest') # collected data for packag
pytest==7.1.1 ,
nbval==0.9.6 [requires: pytest(>=2.8)]
In [11]:
# data version of pipdown
pip._upraw('pytest')
Out[11]:
['pytest==7.1.1 ', ['nbval==0.9.6 [requires: pytest(>=2.8)]']]
In [12]:
# data details of 'sqlite-bro' package
pip.distro['sqlite-bro']
Out[12]:
{'name': 'sqlite-bro',
'version': '0.12.2',
'summary': 'a graphic SQLite Client in 1 Python file',
'requires_dist': [],
'wanted_per': [],
'description': "sqlite_bro : a graphic SQLite browser in 1 Python file\n======================================================\n\nsqlite_bro is a tool to browse SQLite databases with \nany basic python installation.\n\n\nFeatures\n--------\n\n* Tabular browsing of a SQLite database \n\n* Import/Export of .csv files with auto-detection\n\n* Import/Export of .sql script\n\n* Export of database creation .sql script\n\n* Support of sql-embedded Python functions\n\n* support supports command-line scripting if Python>=3.2 (see sqlite_bro -h), with or without Graphic User Interface\n\n* Easy to distribute : 1 Python source file, Python and PyPy3 compatible\n\n* Easy to start : just launch sqlite_bro\n\n* Easy to learn : Welcome example, minimal interface\n\n* Easy to teach : Character size, SQL + SQL result export on a click\n\nInstallation\n------------\n\nYou can install, upgrade, uninstall sqlite_bro.py with these commands::\n\n $ apt-get install python3-tk # apt-get install python-tk if you are using python2\n $ pip install sqlite_bro\n $ pip install --upgrade sqlite_bro\n $ pip uninstall sqlite_bro\n\nor just launch latest version from IPython with %load https://raw.githubusercontent.com/stonebig/sqlite_bro/master/sqlite_bro/sqlite_bro.py\nor just copy the file 'sqlite_bro.py' to any pc and type 'python sqlite_bro.py'\n\nExample usage \n-------------\n\n::\n\n $ sqlite_bro\n\n::\n\n $ sqlite_bro -h\n \nScreenshots\n-----------\n\n.. image:: https://raw.githubusercontent.com/stonebig/sqlite_bro/master/docs/sqlite_bro.GIF\n\n.. image:: https://raw.githubusercontent.com/stonebig/sqlite_bro/master/docs/sqlite_bro_command_line.GIF\n\n\nLinks\n-----\n\n* `Fork me on GitHub <http://github.com/stonebig/sqlite_bro>`_\n\n\n"}
In [13]:
# description of ipythonpackage
pip.description('ipython')
IPython provides a rich toolkit to help you make the most out of using Python interactively. Its main components are: * A powerful interactive Python shell * A `Jupyter <https://jupyter.org/>`_ kernel to work with Python code in Jupyter notebooks and other interactive frontends. The enhanced interactive Python shells have the following main features: * Comprehensive object introspection. * Input history, persistent across sessions. * Caching of output results during a session with automatically generated references. * Extensible tab completion, with support by default for completion of python variables and keywords, filenames and function keywords. * Extensible system of 'magic' commands for controlling the environment and performing many tasks related either to IPython or the operating system. * A rich configuration system with easy switching between different setups (simpler than changing $PYTHONSTARTUP environment variables every time). * Session logging and reloading. * Extensible syntax processing for special purpose situations. * Access to the system shell with user-extensible alias system. * Easily embeddable in other Python programs and GUIs. * Integrated access to the pdb debugger and the Python profiler. The latest development version is always available from IPython's `GitHub site <http://github.com/ipython>`_.
In [14]:
# equivalent of pip list datas, limited to 42 first packages
for p in pip.pip_list()[:42]:
print(*p)
adodbapi 2.6.1.3 affine 2.3.1 aiofiles 0.8.0 aiohttp 3.8.1 aiosignal 1.2.0 aiosqlite 0.17.0 alabaster 0.7.12 alembic 1.8.0 algopy 0.5.7 altair 4.2.0 altair-data-server 0.4.1 altair-transform 0.2.0 altair-widgets 0.2.2 amply 0.1.5 aniso8601 9.0.1 ansiwrap 0.8.4 anyio 3.6.1 appdirs 1.4.4 argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 arrow 1.2.2 asciitree 0.3.3 asgi-csrf 0.9 asgiref 3.5.2 asn1crypto 1.4.0 asteval 0.9.27 astor 0.8.1 astroid 2.11.5 astroml 1.0.2.post1 astropy 5.0.4 async-generator 1.10 async-timeout 4.0.2 atomicwrites 1.4.0 attrs 22.1.0 autopep8 1.6.0 babel 2.10.3 backcall 0.2.0 backports-abc 0.5 baresql 0.7.6 base58 2.1.1 bcrypt 3.2.0 beautifulsoup4 4.11.1
In [ ]: