watermark
watermark copied to clipboard
Feature to auto-pull info of all imported packages
I think a new flag, e.g.,
--pull_pkginfo
or so could be useful to list all unique packages used in a notebook and the respective version numbers. Right now, we have
-p --packages
which is useful to display the version numbers of a list of packages, which can be useful to limit the scope of packages that should be displayed. For example.
%watermark -p numpy,scipy
numpy 1.9.2
scipy 0.15.1
The --pull_pkginfo
would preferably be run at the end of an IPython notebook so that a user don't have to worry about specifying packages "manually." It should scan an collect unique import
s in the notebook and list all the packages, e.g.,
%watermark --pull_pkginfo
numpy 1.9.2
scipy 0.15.1
...
Maybe excluding packages from the standard lib since we already have a -v
flag to show the Python version number.
@rasbt You thinks solution might lead the way? https://stackoverflow.com/questions/40428931/package-for-listing-version-of-packages-used-in-a-jupyter-notebook
The idea is to pkg_resources
library and pulling the packages + version numbers from that. Let me try next year and see what happens
Yeah, the use of pkg_resources
sounds fine to me. (Also see the related discussion at #41)
Yes this would be a valuable feature; it certainly beats having to manually specifying each package. Often the user just wants the version of all packages imported in the Jupyter notebook.
Btw I forgot that we have a
%watermark -iv
E.g.,
![screen shot 2019-02-21 at 12 00 57 pm](https://user-images.githubusercontent.com/5618407/53191011-64ac6480-35d0-11e9-8b1d-223bfdf65067.png)