Skip to content

Commit 4c7b293

Browse files
committed
Adding license command documentation.
1 parent a3fa52e commit 4c7b293

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ History
99
* Added README information about Python 2.7 workaround
1010
* Adjusted some pricing information
1111
* Fixed MacOS binary build through AppVeyor
12+
* Added the ability to check packages licenses
1213

1314
1.9.0 (2020-04-27)
1415
------------------

README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,111 @@ safety review --file report.json --bare
430430
```
431431
django
432432
```
433+
434+
___
435+
436+
# License
437+
438+
Display packages licenses information (requires an api-key)
439+
440+
## Options
441+
442+
### `--key` (REQUIRED)
443+
444+
*API Key for pyup.io's licenses database. Can be set as `SAFETY_API_KEY` environment variable.*
445+
446+
**Example**
447+
```bash
448+
safety license --key=12345-ABCDEFGH
449+
```
450+
*Shows the license of each package in the current environment*
451+
452+
453+
```
454+
+==============================================================================+
455+
| |
456+
| /$$$$$$ /$$ |
457+
| /$$__ $$ | $$ |
458+
| /$$$$$$$ /$$$$$$ | $$ \__//$$$$$$ /$$$$$$ /$$ /$$ |
459+
| /$$_____/ |____ $$| $$$$ /$$__ $$|_ $$_/ | $$ | $$ |
460+
| | $$$$$$ /$$$$$$$| $$_/ | $$$$$$$$ | $$ | $$ | $$ |
461+
| \____ $$ /$$__ $$| $$ | $$_____/ | $$ /$$| $$ | $$ |
462+
| /$$$$$$$/| $$$$$$$| $$ | $$$$$$$ | $$$$/| $$$$$$$ |
463+
| |_______/ \_______/|__/ \_______/ \___/ \____ $$ |
464+
| /$$ | $$ |
465+
| | $$$$$$/ |
466+
| by pyup.io \______/ |
467+
| |
468+
+==============================================================================+
469+
| Packages licenses |
470+
+=============================================+===========+====================+
471+
| package | version | license |
472+
+=============================================+===========+====================+
473+
| requests | 2.25.0 | Apache-2.0 |
474+
|------------------------------------------------------------------------------|
475+
| click | 7.1.2 | BSD-3-Clause |
476+
|------------------------------------------------------------------------------|
477+
| safety | 1.10.0.de | MIT |
478+
+==============================================================================+
479+
```
480+
481+
___
482+
483+
### `--db`
484+
485+
*Path to a directory with a local licenses database `licenses.json`*
486+
487+
**Example**
488+
```bash
489+
safety license --key=12345-ABCDEFGH --db=/home/safety-db/data
490+
```
491+
___
492+
493+
### `--no-cache`
494+
495+
*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.*
496+
497+
**Example**
498+
```bash
499+
safety license --key=12345-ABCDEFGH --no-cache
500+
```
501+
___
502+
503+
### `--file`, `-r`
504+
505+
*Read input from one (or multiple) requirement files.*
506+
507+
**Example**
508+
```bash
509+
safety license --key=12345-ABCDEFGH -r requirements.txt
510+
```
511+
```bash
512+
safety license --key=12345-ABCDEFGH --file=requirements.txt
513+
```
514+
```bash
515+
safety license --key=12345-ABCDEFGH -r req_dev.txt -r req_prod.txt
516+
```
517+
518+
___
519+
520+
521+
### `--proxy-host`, `-ph`
522+
523+
*Proxy host IP or DNS*
524+
525+
### `--proxy-port`, `-pp`
526+
527+
*Proxy port number*
528+
529+
### `--proxy-protocol`, `-pr`
530+
531+
*Proxy protocol (https or http)*
532+
533+
**Example**
534+
```bash
535+
safety license --key=12345-ABCDEFGH -ph 127.0.0.1 -pp 8080 -pr https
536+
```
537+
433538
___
434539

435540
# Python 2.7

0 commit comments

Comments
 (0)