Published
Edited
May 2, 2019
1 fork
2 stars
Insert cell
Insert cell
md`Note: Because many entries did not include a version number, I had to normalize the data by ignoring the version numbers for most of the entries. I also removed the license entries that said null or none.`
Insert cell
url = "https://api.code.gov/repos?api_key=90LWafgJ8bcxpCNHxkhA3jcxbG8TQKlQates3tJ9&size=10000"
Insert cell
Insert cell
mappings = {
return {
"AGPL-3.0": "AGPL",
"Apache License 2.0": "Apache",
"Apache 2.0": "Apache",
"Apache-2.0": "Apache",
"BSD-2-Clause": "BSD",
"BSD-3-Clause": "BSD",
"Creative Commons Zero (CC0)": "CC0",
"CC0-1.0": "CC0",
"GNU General Public License v2.0": "GPL",
"GPLv2": "GPL",
"GPL-2.0": "GPL",
"GPL-2.1": "GPL",
"GPL.v3": "GPL",
"GPL-3.0": "GPL",
"GPLV2": "GPL",
"GPLv3": "GPL",
"GPLv6": "GPL",
"LGPL-2.1": "LGPL",
"LGPL-3.0": "LGPL",
"Mozilla Public License": "MPL",
"MPL-2.0": "MPL",
"NASA Open Source": "NASA",
"NASA Open Source Agreement Version 1.3": "NASA",
"NASA Open Source v1.3": "NASA",
"NASA v3": "NASA"
};
}
Insert cell
common_licenses = repos.map(repo => {
if (repo.permissions && repo.permissions.licenses && repo.permissions.licenses.length > 0) {
let license = repo.permissions.licenses[0];
if (license.name != "Other") {
const licenseName = license.name;
if (mappings[licenseName]) {
return mappings[licenseName];
} else if (licenseName && licenseName.toLowerCase() !== "null" && ! licenseName.toLowerCase().startsWith("none")) {
return licenseName;
}
}
}
}).filter(Boolean)

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