Skip to content

Instantly share code, notes, and snippets.

@volgorean
Created March 17, 2020 23:25
Show Gist options
  • Save volgorean/51c9eac60aff9aa9a037ec958a32cff9 to your computer and use it in GitHub Desktop.
Save volgorean/51c9eac60aff9aa9a037ec958a32cff9 to your computer and use it in GitHub Desktop.
search pypi.org for packages
from bs4 import BeautifulSoup
import requests
search = "boto3"
r = requests.get(f"https://pypi.org/search/?q={search}")
print(r.status_code)
soup = BeautifulSoup(r.text, 'html.parser')
packages = soup.find_all("h3", class_="package-snippet__title")
for pkg in packages:
name = pkg.find("span", class_="package-snippet__name")
version = pkg.find("span", class_="package-snippet__version")
print(f"{name.get_text()} ~> {version.get_text()}")
200
boto ~> 2.49.0
boto3 ~> 1.12.23
boto_utils ~> 0.3
krux-boto ~> 0.0.4
boto3_retry ~> 0.1.2
boto-scripts ~> 0.0.1
boto3-meiqia ~> 1.4.5
flake8-boto3 ~> 0.3.0
CloeePy-Boto ~> 0.0.0
boto3_paste ~> 0.1
boto3helper ~> 0.1.4
boto-mws ~> 2.46.2
boto-mangrove ~> 0.0.1
boto3facade ~> 0.5.9
boto_rsync ~> 0.8.1
boto3_policygen ~> 0.2
boto-patch ~> 2.38.0
boto3-python3 ~> 1.9.139
boto3-utils ~> 0.2.1
pyramid_boto3 ~> 0.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment