Skip to content

Instantly share code, notes, and snippets.

@iizukak
Created September 15, 2020 01:04
Show Gist options
  • Save iizukak/cdbdb1a5ddd5b306fbe051b568d642ca to your computer and use it in GitHub Desktop.
Save iizukak/cdbdb1a5ddd5b306fbe051b568d642ca to your computer and use it in GitHub Desktop.
genosslist.py
import os
import csv
import requests
with open("./requirements.txt") as f:
osslist = [s.strip() for s in f.readlines()]
for oss in osslist:
name, var = oss.split("==")
url = "https://pypi.org/pypi/{0}/{1}/json".format(name, var)
json = requests.get(url).json()
print(json["info"]["name"] + "," +
json["info"]["version"] + "," +
json["info"]["home_page"] + "," +
json["info"]["license"] + "," +
json["info"]["license"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment