Download/print path of all python packages and calculate number of packages that depend on package

I am interested in getting function call usage in the python/numfocus ecosystem. Basically I want to get results similar to Top 20 Pandas, NumPy and SciPy functions on GitHub – Alexander Galea's Blog where they compile the most commonly used numpy, scipy, pandas methods. Is there a way to download all python3Packages.* packages and print the resulting path so that I can grep the resulting files?

Additionally is there a way to compute the number of packages that depend on a certain package? For example how many packages depend on numpy.

$ nix-env -f . -qa --out-path -A python3Packages
$ nix build /nix/store/yv4pzx3lxk3lscq0pw3hqzs7k4x76xsm-python3-3.7.2
# Backward references, only within of what's in /nix/store already
$ nix-store -q --referrers /nix/store/yv4pzx3lxk3lscq0pw3hqzs7k4x76xsm-python3-3.7.2

Also the -q --graph output might be interesting for you.

1 Like