Tool to automatically detect FLOSS licenses.

license-finder needs a folder with license files (defaults to /usr/portage/licenses for easy use on Gentoo).

Usage

license-finder <directory>

Other options

usage: license-finder [-h] [--licenses-dir LICENSES_DIR]
                      [--min-ratio MIN_RATIO] [-n N]
                      files_or_dirs [files_or_dirs ...]

positional arguments:
  files_or_dirs

optional arguments:
  -h, --help            show this help message and exit
  --licenses-dir LICENSES_DIR
                        Directory to look for licenses (default:
                        /usr/portage/licenses)
  --min-ratio MIN_RATIO
                        Minimum ratio to consider the file as a match
                        (default: 0.8)
  -n N                  Show at most x matching licenses

Example output:

/tmp/license-finder/LICENSE.txt:
----------------------------------------------
  97.791 %: /usr/portage/licenses/GPL-2 (+0 -0 ~4)
  96.934 %: /usr/portage/licenses/GPL-2-with-font-exception (+0 -1 ~4)
  96.093 %: /usr/portage/licenses/GPL-2-with-linking-exception (+0 -1 ~4)
  95.954 %: /usr/portage/licenses/GPL-2-with-exceptions (+0 -1 ~4)
  86.207 %: /usr/portage/licenses/kvirc (+0 -1 ~3)

Source code