reuse.download module#

Functions for downloading license files from spdx/license-data-list.

reuse.download.add_arguments(parser)[source]#

Add arguments to parser.

Return type:

None

reuse.download.download_license(spdx_identifier)[source]#

Download the license text from the SPDX repository.

Parameters:

spdx_identifier (str) – SPDX identifier of the license.

Raises:

URLError – if the license could not be downloaded.

Return type:

str

Returns:

The license text.

reuse.download.put_license_in_file(spdx_identifier, destination)[source]#

Download a license and put it in the destination file.

This function exists solely for convenience.

Parameters:
  • spdx_identifier (str) – SPDX License Identifier of the license.

  • destination (Union[str, PathLike]) – Where to put the license.

Raises:
  • URLError – if the license could not be downloaded.

  • FileExistsError – if the license file already exists.

Return type:

None

reuse.download.run(args, project, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]#

Download license and place it in the LICENSES/ directory.

Return type:

int