Tar
Tar

Reputation: 9015

How to get PyPi link, license, code and homepage of Python/Pip packages?

When running pip list or pip freeze, is there a way to emit additional details for each package?

Further details:

In our project, we must report the packages we're using, their origin and their license. What I'm trying to retrieve would be similar to e.g.:

Package       Version PyPi Link                       License                   
------------- ------- ------------------------------- --------------------------
Flask         1.1.2   https://pypi.org/project/Flask/ BSD License (BSD-3-Clause)
Others...     1.2.3   ...                             ...

Entries I'm trying to find besides PyPi Link:

Upvotes: 2

Views: 1250

Answers (1)

Kieran Wood
Kieran Wood

Reputation: 1447

If you run pip show <name> (documentation) it would give you more details including the license, and I believe any additional link metadata within the package. If you have a requirements.txt file in your project you can do a bash(linux/mac) or PowerShell(windows) script to run the command for each dependency if doing it one at a time is too much hassle.

You can also use the--verbose to get even more details like classifiers etc.

Upvotes: 3

Related Questions