Public
Edited
Sep 25, 2022
Insert cell
Insert cell
Insert cell
Insert cell
pyPackages[0]['download_count']
Insert cell
getDataLibraries = async (apiLink)=>{
const rawData = await d3.json(apiLink)
rawData.
console.log(rawData)
const tempDict = {};
const dataArry =['name','dependent_repos_count','dependents_count','description','forks','keywords','stars','rank','repository_url','versions']
for (let key of dataArry){
console.log(rawData[key])
tempDict[key] = rawData[key]
}
return tempDict
}
Insert cell
getDataLibraries('https://libraries.io/api/Pypi/boto3?api_key=598f29e15e3a1e7ac5df0b0b43b67711')
Insert cell
allData = {
const libraryData =[];
pyPackages.forEach(d =>{
const libraryDetail
Insert cell
for index,project in enumerate(libraries[:2]):
makeUrl = f'https://libraries.io/api/Pypi/{project["project"]}?api_key=598f29e15e3a1e7ac5df0b0b43b67711'

print(f'url : {makeUrl}')
tempData = requests.get(makeUrl).json()
tempDict = {};
dataArry = ['name','dependent_repos_count','dependents_count','description','forks','keywords','stars','rank','repository_url','versions']
for key in dataArry:
tempDict[key] = tempData.get(key)
print(tempDict)

with open('myDataRev01.json','a') as outFile:
json.dump(tempDict,outFile)

print(f'the Index is {index} and project is {project}')

time.sleep(2)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
keyWordNoChek = {
const keys = [];
mydatarev04.forEach(d => {
const obj = Object.assign(d.keywords) //There are around 128 repos with keywords as null
keys.push(obj)
})
return keys
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
rolledupData = d3.rollup(mydatarev04, g => d3.sum(g, x => x.dependent_repos_count), d => d.rank, d => d.name)
Insert cell
Insert cell
hierarchizeData.sum(d => d[1])
Insert cell
circlePack = d3.pack()
.size([800,800])
Insert cell
circlePackData= circlePack(hierarchizeData)
Insert cell
Insert cell
scaleColorRank = d3.scaleOrdinal() // Choosing point, since the force directed circles needs a reference point
.domain(d3.range(1,33))
.range(d3.schemeTableau10)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more