Logo
License
CI
Python 3.6
GitHub release
PyPI

WhiteSource Top 10 Rejected Libraries

Generate a spreadsheet listing the 10 most common libraries in your WhiteSource inventory that were rejected by policies.

Supported Operating Systems

  • Linux (Bash): CentOS, Debian, Ubuntu, RedHat
  • Windows (PowerShell): 10, 2012, 2016

Prerequisites

Python 3.6+

Installation

  1. Clone the ws-top10-rejected-libs repository to your environment:
    git clone https://github.com/whitesource-ft/ws-top10-rejected-libs.git
  2. Navigate into the created directory and install the required dependencies:
    cd ./ws-top10-rejected-libs
    pip install -r requirements.txt
  3. Navigate into the main application directory:
    cd ./ws_top10_rejected_libs
  4. Execute the application following the instructions below.
    The first execution will require a one time configuration, prompting for the following parameters, which will be saved into an automatically-generated local top10_rejected.py.config file:

    • Organization Name – your WhiteSource organization name
    • API Key – your WhiteSource API Key (organization token)
    • User Key – a WhiteSource User Key with admin permissions (this could be either an individual user or a service user)
    • Domain – the domain prefix of your WhiteSource Server Url (e.g. saas, saas-eu, app, app-eu)
    • Company Name – the display name to be used for the generated spreadsheet (defaults to the organization name, if not provided)
    • Default Period – the default period in months to generate the spreadsheet for (defaults to 3)
    • Use Header Image – whether the spreadsheet should include a header image
    • Start Date – start date for the reported period in yyyy-MM-dd format (this parameter is not part of the one time configuration, it’s part of the execution itself, and will only be prompted if not provided as a command-line argument as detailed below)

Execution

Show help and usage menu:
python top10_rejected.py --help

Interactive execution (mandatory parameters will be prompted for input):
python top10_rejected.py

Unattended execution (specifying command-line arguments):
python top10_rejected.py --argument "value"
python top10_rejected.py -arg "value"

Example:
python top10_rejected.py --start "2021-02-27"

Command-Line Arguments

The following command line arguments can be specified to override configuration set by the local top10_rejected.py.config file.
The parameters marked as Required are typically saved to the config file during the first execution and thus are not required for every execution, unless the config file is not present.

Parameter Type Required Description
‑h, ‑‑help switch No Show help and usage menu
‑s, ‑‑start string Yes Start date in format yyyy-MM-dd. Default: config file option DefaultPeriodMonths.
‑e, ‑‑end string No End date in format yyyy-MM-dd. Default: current date.
‑o, ‑‑organization string Yes WhiteSource Organization Name
‑c, ‑‑company string No Company name. If not provided, WhiteSource Organization name will be used.
‑d, ‑‑domain string Yes WhiteSource server domain prefix: https://DOMAIN.whitesourcesoftware.com (e.g: saas).
‑apiKey string Yes WhiteSource API Key (Organization Token).
‑userKey string Yes A WhiteSource User Key with admin permissions (this could be either an individual user or a service user).

GitHub

View Github