Skip to content

Instantly share code, notes, and snippets.

@Alexhha
Last active July 31, 2018 10:30
Show Gist options
  • Save Alexhha/0c63dc68384d2be185a29954e7602323 to your computer and use it in GitHub Desktop.
Save Alexhha/0c63dc68384d2be185a29954e7602323 to your computer and use it in GitHub Desktop.
#!/bin/bash
for package_name in {a..z}
do
for page in {1..25}
do
curl -s "https://pypi.org/search/?q=${package_name}&page=${page}" \
| grep -o -E 'href="/project/.*' | cut -d '>' -f1 | cut -d '"' -f2 \
| sed -r 's|(.*)|https://pypi.org/\1#files|' \
| while read curr_line
do
curl -s "${curr_line}" | grep 'files.pythonhosted.org/packages' | cut -d '"' -f2
done
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment