Created
October 18, 2017 09:56
-
-
Save tuxdna/37c2b4d36f877e7db387c2fbbe668a65 to your computer and use it in GitHub Desktop.
Enlist top Go packages
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
import requests | |
import functools | |
# data = json.load(open("top-go-packages.json")) | |
r = requests.get("http://go-search.org/api?action=tops&len=100") | |
data = r.json() | |
kinds = [d for d in data if d["Name"] != "Sites"] | |
concatenated = functools.reduce(lambda x, y: x + y["Items"], kinds, []) | |
top_list = sorted(set([(x["Name"], x["Package"]) for x in concatenated])) | |
for i,d in enumerate(top_list): | |
print("%3d - %-30s\t%s"% (i+1, d[0], d[1])) | |
Author
tuxdna
commented
Oct 18, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment