You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/general.rst
+8-22Lines changed: 8 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,15 @@ AboutCode Toolkit Defined
9
9
10
10
AboutCode Toolkit is a tool for your software development team to document your code inside your codebase, typically in preparation for a product release, side-by-side with the actual code. ABOUT file(s) have a simple, standard format that identifies components and their associated licenses. The current AboutCode Toolkit subcommands are:
11
11
12
-
- **attrib**: Generate a Product Attribution notice document (HTML format) from your ABOUT file(s). You can also generate documents for other purposes (such as a License Reference) by varying your input control file and your template.
12
+
- **attrib**: Generate a Product Attribution notice document from your ABOUT file(s), JSON, CSV or Excel. You can also generate documents for other purposes (such as a License Reference) by varying your input control file and your template.
13
13
14
14
- **check**: A simple command to validate the ABOUT file(s) and output errors/warnings if any on the terminal.
15
15
16
16
- **collect_redist_src**: A command to collect and copy sources that have 'redistribute' flagged as 'True' in ABOUT file(s) or from an inventory.
17
17
18
-
- **gen**: Create ABOUT file(s) from a Software Inventory file (.csvor .json format) which is typically created from a software audit, and insert these AboutCode Toolkit files into your codebase. You can regenerate the AboutCode Toolkit files from a new Software Inventory file whenever you make changes.
18
+
- **gen**: Create ABOUT file(s) from a Software Inventory file (.csv, .json or .xlsx format) which is typically created from a software audit, and insert these AboutCode Toolkit files into your codebase. You can regenerate the AboutCode Toolkit files from a new Software Inventory file whenever you make changes.
19
19
20
-
- **inventory**: Generate a Software Inventory list (.csvor .json format) from your codebase based on ABOUT file(s). Note that this Software Inventory will only include components that have AboutCode Toolkit data. In another word, if you do not create AboutCode Toolkit files for your own original software components, these components will not show up in the generated inventory.
20
+
- **inventory**: Generate a Software Inventory list (.csv, .json or .xlsx format) from your codebase based on ABOUT file(s). Note that this Software Inventory will only include components that have AboutCode Toolkit data. In another word, if you do not create AboutCode Toolkit files for your own original software components, these components will not show up in the generated inventory.
21
21
22
22
- **transform**: A command to transform an input CSV/JSON/Excel by applying renaming and/or filtering and then output to a new CSV/JSON/Excel file.
23
23
@@ -217,7 +217,7 @@ For instance with this configuration, the target file will not contain the "type
217
217
Run gen to Generate ABOUT file(s)
218
218
---------------------------------
219
219
220
-
When your software inventory is ready, you can save it as a .csvor .json file, and use it as input to run gen to generate ABOUT file(s). The official gen parameters are defined here: :ref:`reference`
220
+
When your software inventory is ready, you can save it as a .csv, .json or .xlsx file, and use it as input to run gen to generate ABOUT file(s). The official gen parameters are defined here: :ref:`reference`
221
221
222
222
Here is an example of a gen command:
223
223
@@ -227,7 +227,7 @@ Here is an example of a gen command:
227
227
228
228
This gen example command does the following:
229
229
230
-
- Activates the --fetch-license option to get license information.
230
+
- Activates the --fetch-license option to get license information from ScanCode LicenseDB.
231
231
232
232
- Activates the --reference option to get license text files and notice text files that you have specified in your software inventory to be copied next to the associated .ABOUT files when those are created.
233
233
@@ -247,8 +247,9 @@ Review the generated ABOUT file(s) to determine if it meets your requirements. H
The Software Inventory that you prepared for gen most likely includes components that do not need to appear in a product attribution notice package; for example:
264
-
265
-
- Components in your codebase that are not Deployed on the final product (e.g. build tools, testing tools, internal documentation).
266
-
267
-
- Components in your codebase under licenses that do not require attribution (e.g. proprietary packages, commercial products).
268
-
269
-
There are two options here:
270
-
271
-
- Edit the jinja2 template to only include the one that have value in attribute field such as: ``{% if about_object.attribute.value %}``
272
-
273
-
- You should prepare a filtered version of your software inventory (the one that you used for gen) by removing the rows that identify components which should not be included in a product attribution notice package, and saving that filtered version as your Product BOM.
274
-
275
261
Prepare an Attribution Template to Use as Input to attrib
@@ -401,7 +387,7 @@ One of the major features of the ABOUT File specification is that the .ABOUT fil
401
387
402
388
If your organization adopts the practice of manually creating and maintaining ABOUT file(s), you can easily re-create your software inventory from your codebase using inventory. The official inventory parameters are defined here: :ref:`reference`
403
389
404
-
A successful execution of inventory will create a complete software inventory in .csv format or .json format based on defined format.
390
+
A successful execution of inventory will create a complete software inventory in .csv, .json or .xlsx format based on defined format.
gen Generate .ABOUT files from an inventory as CSV/JSON/Excel.
35
+
inventory Collect the inventory of .ABOUT files to a CSV/JSON/Excel file.
37
36
transform Transform a CSV/JSON/Excel by applying renamings, filters and checks.
38
37
39
38
attrib
@@ -46,51 +45,92 @@ Syntax
46
45
47
46
about attrib [OPTIONS] LOCATION OUTPUT
48
47
49
-
LOCATION: Path to a file, directory or .zip archive containing .ABOUT
50
-
files.
51
-
48
+
INPUT: Path to a file (.ABOUT/.csv/.json/.xlsx), directory or .zip archive containing .ABOUT files.
49
+
52
50
OUTPUT: Path where to write the attribution document.
53
51
54
52
Options
55
53
-------
56
54
57
55
.. code-block:: none
58
56
59
-
--template FILE Path to an optional custom attribution template to
60
-
generate the attribution document. If not provided
61
-
the default built-in template is used.
62
-
--vartext <key>=<value> Add variable text as key=value for use in a custom
63
-
attribution template.
64
-
-q, --quiet Do not print error or warning messages.
65
-
--verbose Show all error and warning messages.
66
-
-h, --help Show this message and exit.
57
+
--api_url URL URL to DejaCode License Library.
58
+
--api_key KEY API Key for the DejaCode License Library
59
+
--min-license-score INTEGER Attribute components that have license score
60
+
higher than the defined --min-license-score.
61
+
--scancode Indicate the input JSON file is from
62
+
scancode toolkit.
63
+
--reference DIR Path to a directory with reference files where
64
+
"license_file" and/or "notice_file" located.
65
+
--template FILE Path to an optional custom attribution template to
66
+
generate the attribution document. If not provided
67
+
the default built-in template is used.
68
+
--vartext <key>=<value> Add variable text as key=value for use in a custom
69
+
attribution template.
70
+
-q, --quiet Do not print error or warning messages.
71
+
--verbose Show all error and warning messages.
72
+
-h, --help Show this message and exit.
67
73
68
74
Purpose
69
75
-------
70
76
71
-
Generate an attribution file which contains the all license information from the LOCATION along with the license text.
77
+
Generate an attribution file which contains license information from the INPUT along with the license text.
72
78
73
79
Assume the following:
74
80
75
81
.. code-block:: none
76
82
77
-
'/home/about_files/'** contains all the ABOUT files [LOCATION]
83
+
'/home/about_files/' contains all the ABOUT files [INPUT]
84
+
'/home/project/inventory.csv' is a BOM inventory [INPUT]
85
+
'/home/project/scancode-detection.json' is a detection output from scancode-toolkit[INPUT]
86
+
'/home/project/licenses/' contains all the license/notice file references
78
87
'/home/attribution/attribution.html' is the user's output path [OUTPUT]
79
88
89
+
90
+
.. code-block:: none
91
+
80
92
$ about attrib /home/about_files/ /home/attribution/attribution.html
93
+
or
94
+
$ about attrib /home/project/inventory.csv /home/attribution/attribution.html
95
+
or
96
+
$ about attrib --scancode /home/project/scancode-detection.json /home/attribution/attribution.html
81
97
82
98
Details
83
99
^^^^^^^
84
100
85
101
.. code-block:: none
86
102
103
+
--api_url URL --api_key
104
+
105
+
This option let user to define where to get the license information such as
106
+
from DJE. If these options are not set, the tool will get the license
107
+
information from ScanCode LicenseDB by default
108
+
109
+
$ about attrib --api_url <URL> --api_key <KEY> INPUT OUTPUT
110
+
111
+
--min-license-score
112
+
113
+
This option is a filter to collect license information where the license score
114
+
in the scancode toolkit detection is greater than or equal to the defined
115
+
--min-license-score. This option is specifically design for scancode's input
116
+
and therefore --scancode is required
117
+
118
+
$ about attrib --scancode --min-license-score 85 /home/project/scancode-detection.json OUTPUT
119
+
120
+
--reference
121
+
122
+
This option is to define the reference directory where the 'license_file'
123
+
or 'notice_file' are stored
124
+
125
+
$ about attrib --reference /home/project/licenses/ /home/project/inventory.csv OUTPUT
126
+
87
127
--template
88
-
128
+
89
129
This option allows you to use your own template for attribution generation.
90
130
For instance, if you have a custom template located at:
91
131
/home/custom_template/template.html
92
132
93
-
$ about attrib --template /home/custom_template/template.html LOCATION OUTPUT
133
+
$ about attrib --template /home/custom_template/template.html INPUT OUTPUT
94
134
95
135
--vartext
96
136
@@ -110,12 +150,7 @@ Details
110
150
The following data are passed to jinja2 and, therefore, can be used for a custom template:
111
151
* about object: the about objects
112
152
* common_licenses: a common license keys list in licenses.py
113
-
* license_file_key_and_context: a dictionary with license_file_key (It's basically a license_key if it's not a custom license or license file name otherwise) as a key and license text as the value
114
-
* license_file_key_and_license_key: a dictionary with license file key as a key and license key as the value
115
-
* license_file_name_and_license_file_key: a dictionary with license file name as a key and license file key as the value
116
-
* license_key_and_license_file_name: a dictionary with license key as a key and license file name as the value
117
-
* license_key_and_license_name: a dictionary with license key as a key and license name as the value
118
-
* license_name_and_license_key: a dictionary with license name as a key and license key as the value
153
+
* licenses_list: a license object list contains all the licenses found in about objects. It contains the following attribute: key, name, filename, url, text
119
154
120
155
check
121
156
=====
@@ -245,7 +280,7 @@ Syntax
245
280
246
281
about gen [OPTIONS] LOCATION OUTPUT
247
282
248
-
LOCATION: Path to a JSON or CSV inventory file.
283
+
LOCATION: Path to a JSON/CSV/Excel inventory file.
249
284
OUTPUT: Path to a directory where ABOUT files are generated.
250
285
251
286
Options
@@ -279,7 +314,7 @@ Options
279
314
Purpose
280
315
-------
281
316
282
-
Given a CSV/JSON inventory, generate ABOUT files in the output location.
317
+
Given a CSV/JSON/Excel inventory, generate ABOUT files in the output location.
283
318
284
319
Details
285
320
^^^^^^^
@@ -348,29 +383,29 @@ Syntax
348
383
about inventory [OPTIONS] LOCATION OUTPUT
349
384
350
385
LOCATION: Path to an ABOUT file or a directory with ABOUT files.
351
-
OUTPUT: Path to the JSON or CSV inventory file to create.
386
+
OUTPUT: Path to the CSV/JSON/Excel inventory file to create.
352
387
353
388
Options
354
389
-------
355
390
356
391
.. code-block:: none
357
392
358
-
-f, --format [json|csv] Set OUTPUT file format. [default: csv]
359
-
-q, --quiet Do not print any error/warning.
360
-
--verbose Show all the errors and warning.
361
-
-h, --help Show this message and exit.
393
+
-f, --format [json|csv|excel] Set OUTPUT file format. [default: csv]
394
+
-q, --quiet Do not print any error/warning.
395
+
--verbose Show all the errors and warning.
396
+
-h, --help Show this message and exit.
362
397
363
398
Purpose
364
399
-------
365
400
366
-
Create a JSON or CSV inventory of components from ABOUT files.
401
+
Create a JSON/CSV/Excel inventory of components from ABOUT files.
0 commit comments