Help us understand the problem. What is going on with this article?

GitHubのOSSライセンスシェアの調査結果

More than 1 year has passed since last update.

概要

調査の結果は以下の通り。ほぼMIT系とGPL系で8割を占める。

Gitub License Share

注) MIT系はMIT,ISC、GPL系はagpl-3.0, gpl, gpl-2.0, gpl-3.0, lgpl, lgpl-2.1, lgpl-3.0

調査方法

以下の流れでシェアを取得する。

  1. GitHub公式検索APIで各ライセンスを含むリポジトリを検索し、検索結果のJSONを取得。
  2. JSONをjqコマンドでパースして件数を取得。
  3. ライセンス名と件数をcsvファイルに格納。

上記の手順を実行するスクリプトは以下。

search.sh
#!/bin/bash

LICENSE_FILE=license.dat
RESULT_FILE=license.csv

rm -rf $RESULT_FILE
for line in `cat $LICENSE_FILE`
do
  license=$line
  count=`curl https://api.github.com/search/repositories?q=license:$license | jq '.total_count'`
  echo $license,$count >> $RESULT_FILE
  sleep 5s
done
license.dat
afl-3.0
apache-2.0
artistic-2.0
bsl-1.0
bsd-2-clause
bsd-3-clause
bsd-3-clause-clear
cc
cc0-1.0
cc-by-4.0
cc-by-sa-4.0
wtfpl
ecl-2.0
epl-1.0
eupl-1.1
agpl-3.0
gpl
gpl-2.0
gpl-3.0
lgpl
lgpl-2.1
lgpl-3.0
isc
lppl-1.3c
ms-pl
mit
mpl-2.0
osl-3.0
postgresql
ofl-1.1
ncsa
unlicense
zlib

調査結果

前述のスクリプトの実行結果を以下に示す。

license.csv
afl-3.0,524
apache-2.0,1054686
artistic-2.0,9821
bsl-1.0,2936
bsd-2-clause,49442
bsd-3-clause,138909
bsd-3-clause-clear,350
cc,51178
cc0-1.0,37751
cc-by-4.0,7120
cc-by-sa-4.0,6307
wtfpl,13963
ecl-2.0,376
epl-1.0,37935
eupl-1.1,677
agpl-3.0,72216
gpl,1311057
gpl-2.0,377582
gpl-3.0,926225
lgpl,95372
lgpl-2.1,25430
lgpl-3.0,69943
isc,28624
lppl-1.3c,390
ms-pl,1467
mit,3799119
mpl-2.0,37123
osl-3.0,2409
postgresql,60
ofl-1.1,2774
ncsa,9
unlicense,107055
zlib,3162
kannkyo
Full stack software engineer. UX Design, frontend, backend and infrastructures etc...
https://kannkyo.hatenablog.com/about
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした