Created
March 24, 2021 13:59
-
-
Save kissarat/8aeb2ec325ac66933e41c645424887f6 to your computer and use it in GitHub Desktop.
Get summary for pip packages, use . pip-summary.sh requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Get summary for pip packages | |
# . pip-summary.sh requirements.txt | |
for package in $(cat $1 | sort); do | |
if `pip3 install -q --no-deps $package`; then | |
package_name=$(echo $package | sed -e 's/==.*//g') | |
pip3 show $package_name \ | |
| awk -v name=Summary 'BEGIN { FS=":" } (name == $1) { print $2 }' \ | |
| echo "$package_name:" $(cat) | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use it for project dependencies investigation. For example