FOSSLight Source Scanner

FOSSLight Source is released under the Apache-2.0 License. Current python package version. REUSE status

FOSSLight Source Scanner uses source code scanners, ScanCode and SCANOSS. ScanCode detects copyright and license phrases contained in the file and SCANOSS searches OSS Name, OSS Version, download location, copyright and license information from OSSKB. Some files (ex- build script), binary files, directory and files in specific directories (ex-test) are excluded from the result. And removes words such as "-only" and "-old-style" from the license name to be printed. The output result is generated in spreadsheet format.

Github Repository :
License : Apache-2.0


πŸ“‹ Prerequisite

FOSSLight Source Scanner needs a Python 3.6+.
To use SCANOSS feature, Python 3.7+ is recommended.

⚠️For windows and mac m1, installation is not possible. In this case, it is recommended to install and use by using Docker.

πŸŽ‰ How to install

It can be installed using pip3. It is recommended to install it in the python 3.6 + virtualenv environment.

$ pip3 install fosslight_source

πŸš€ How to run

1. fosslight_source

After executing ScanCode, the source code scanner, print the FOSSLight Report.

$ fosslight_source [option] <arg>


    -p <source_path>               Path to analyze source

    -h                             Print help message
    -j                             Generate raw result of scanners in json format
    -m                             Print additional information for scan result on separate sheets
    -o <output_path>               Output path
                                   (If you want to generate the specific file name, add the output path with file name.)
    -f <format>                    Output file format (excel, csv, opossum)
    -s <scanner>                   Select which scanner to be run (scancode, scanoss, all)

If scanner is not specified with -s option, all scanners (ScanCode, SCANOSS) will be run and the result will be merged.


Print result to FOSSLight Report and results of ScanCode and SCANOSS in json file.

$ fosslight_source -p /home/source_path -j

2. fosslight_convert

Converts the result of executing ScanCode in json format into FOSSLight Report format.

$ fosslight_convert [option] <arg>


    -p <path_dir>                  Path of ScanCode json files

    -h                             Print help message
    -m                             Print the Matched text for each license on a separate sheet
    -o <output_path>               Output path
                                   (If you want to generate the specific file name, add the output path with file name.)
    -f <format>                    Output file format (excel, csv, opossum)


Converting scancode json result to FOSSLight report

$ fosslight_convert -p /home/jsonfile_dir

πŸ“ Result

$ tree
β”œβ”€β”€ FOSSLight-Report_20220103_154024_SRC_FL_Source.csv
β”œβ”€β”€ FOSSLight-Report_20220103_154024.xlsx
β”œβ”€β”€ fosslight_src_log_20220103_154024.txt
β”œβ”€β”€ scancode_raw_result.json
β”œβ”€β”€ scanner_output.wfp
β”œβ”€β”€ scanoss_raw_result.json
└── Opossum_input_20220103_154024.json
  • FOSSLight-Report_[datetime]_[sheet_name].csv : FOSSLight Source Scanner result in csv format.
  • FOSSLight-Report_[datetime].xlsx : FOSSLight Source Scanner result in spreadsheet format.
  • fosslight_src_log_[datetime].txt : The execution log.
  • scancode_raw_result.json : The ScanCode raw result. (Generated only when the -j option is enabled.)
  • scanner_output.wfp : The finger prints generated by SCANOSS. (Generated only when the -j option is enabled.)
  • scanoss_raw_result.json : The SCANOSS raw result. (Generated only when the -j option is enabled.)
  • Opossum_input_[datetime].json : FOSSLight Source Scanner result for OpossumUI

🐳 How to install and run using Docker

  1. Build image using Dockerfile.
    $docker build -t fosslight_source .
  2. Run with the image you built.
    ex. Output: /Users/fosslight_source_scanner/test_output, Path to be analyzed: tests/test_files
    $docker run -it -v /Users/fosslight_source_scanner/test_output:/app/output fosslight_source -p tests/test_files -o output