Skip to content

Instantly share code, notes, and snippets.

@henvic
Last active February 21, 2019 21:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henvic/5fa7abcf3518ed5f29a66eaa04e00ea2 to your computer and use it in GitHub Desktop.
Save henvic/5fa7abcf3518ed5f29a66eaa04e00ea2 to your computer and use it in GitHub Desktop.
Go repositories licenses on GitHub
-- https://bigquery.cloud.google.com/savedquery/1079358982054:8d259a37f0584737bc959c0153e3b262
SELECT
COUNT(rlic.license) AS total,
rlic.license
FROM
[bigquery-public-data:github_repos.licenses] AS rlic
LEFT OUTER JOIN
[bigquery-public-data:github_repos.languages] AS rlang
ON
rlic.repo_name = rlang.repo_name
WHERE
language.name == "Go"
GROUP BY
rlic.license
ORDER BY
total DESC
-- https://bigquery.cloud.google.com/savedquery/1079358982054:13c99f9b04d54414a2ac978491133f9a
SELECT
COUNT(rlic.license) AS total,
rlic.license
FROM
[bigquery-public-data:github_repos.licenses] AS rlic
GROUP BY
rlic.license
ORDER BY
total DESC
@henvic
Copy link
Author

henvic commented Oct 7, 2017

One interesting study to do would be analyzing how license affects library usage.

This could be done by visiting all Go repos on GitHub and listing their dependencies licenses (usually Go projects have a vendor directory inside with all used dependencies internally, so this should be an easy task to automate in an efficient way).

Licenses files (license*/i/gm) could be downloaded an identified and a list created with vendor address + license to correctly categorize them.

It is highly expected that the most used packages use more permissive licenses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment