diff --git a/HISTORY.rst b/HISTORY.rst index 7d92423a..a7fd5fe8 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,6 +9,7 @@ History * Added README information about Python 2.7 workaround * Adjusted some pricing information * Fixed MacOS binary build through AppVeyor +* Added the ability to check packages licenses 1.9.0 (2020-04-27) ------------------ diff --git a/README.md b/README.md index 8152fc36..6dfbcfe1 100644 --- a/README.md +++ b/README.md @@ -430,6 +430,111 @@ safety review --file report.json --bare ``` django ``` + +___ + +# License + +Display packages licenses information (requires an api-key) + +## Options + +### `--key` (REQUIRED) + +*API Key for pyup.io's licenses database. Can be set as `SAFETY_API_KEY` environment variable.* + +**Example** +```bash +safety license --key=12345-ABCDEFGH +``` +*Shows the license of each package in the current environment* + + +``` ++==============================================================================+ +| | +| /$$$$$$ /$$ | +| /$$__ $$ | $$ | +| /$$$$$$$ /$$$$$$ | $$ \__//$$$$$$ /$$$$$$ /$$ /$$ | +| /$$_____/ |____ $$| $$$$ /$$__ $$|_ $$_/ | $$ | $$ | +| | $$$$$$ /$$$$$$$| $$_/ | $$$$$$$$ | $$ | $$ | $$ | +| \____ $$ /$$__ $$| $$ | $$_____/ | $$ /$$| $$ | $$ | +| /$$$$$$$/| $$$$$$$| $$ | $$$$$$$ | $$$$/| $$$$$$$ | +| |_______/ \_______/|__/ \_______/ \___/ \____ $$ | +| /$$ | $$ | +| | $$$$$$/ | +| by pyup.io \______/ | +| | ++==============================================================================+ +| Packages licenses | ++=============================================+===========+====================+ +| package | version | license | ++=============================================+===========+====================+ +| requests | 2.25.0 | Apache-2.0 | +|------------------------------------------------------------------------------| +| click | 7.1.2 | BSD-3-Clause | +|------------------------------------------------------------------------------| +| safety | 1.10.0.de | MIT | ++==============================================================================+ +``` + +___ + +### `--db` + +*Path to a directory with a local licenses database `licenses.json`* + +**Example** +```bash +safety license --key=12345-ABCDEFGH --db=/home/safety-db/data +``` +___ + +### `--no-cache` + +*Since PyUp.io licenses DB is updated once a week, the licenses database is cached locally for 7 days. You can use `--no-cache` to download it once again.* + +**Example** +```bash +safety license --key=12345-ABCDEFGH --no-cache +``` +___ + +### `--file`, `-r` + +*Read input from one (or multiple) requirement files.* + +**Example** +```bash +safety license --key=12345-ABCDEFGH -r requirements.txt +``` +```bash +safety license --key=12345-ABCDEFGH --file=requirements.txt +``` +```bash +safety license --key=12345-ABCDEFGH -r req_dev.txt -r req_prod.txt +``` + +___ + + +### `--proxy-host`, `-ph` + +*Proxy host IP or DNS* + +### `--proxy-port`, `-pp` + +*Proxy port number* + +### `--proxy-protocol`, `-pr` + +*Proxy protocol (https or http)* + +**Example** +```bash +safety license --key=12345-ABCDEFGH -ph 127.0.0.1 -pp 8080 -pr https +``` + ___ # Python 2.7