licensetools {tools}R Documentation

License Tools

Description

Tools for computing on license specifications.

Usage

analyze_license(x)

Arguments

x

a character string.

Details

R packages use the ‘⁠License⁠’ field in their ‘DESCRIPTION’ file to specify their license in a standardized form described in section ‘Licenses’ of the ‘Writing R Extensions’ manual. This uses alternatives of individual specifications (‘components’) which can use version restrictions or give pointers to ‘LICENSE’ (or ‘LICENCE’) files either restricting the base license or giving a full license.

Function analyze_license() checks if a given character string provides such a standardized license spec (or something recognized as a historic exception which can be transformed to a standardized spec). If standardizable, it extracts the individual components and where these give version ranges the corresponding expansions into components with fixed versions. It also indicates whether the license can be verified to be FOSS (https://en.wikipedia.org/wiki/Free_and_open-source_software) licenses.

Value

a list with elements including

is_canonical

a logical indicating whether the given string is a standardized license spec.

is_standardizable

a logical indicating whether the given string is a standardized license spec, or can be transformed to one.

standardization

a character string giving the standardized license spec corresponding to the given string if this is standardizable.

components

the components of the standardized license spec.

expansions

the expansions of the components of the standardized license spec.

is_verified

a logical indicating whether the given string can be verified to specify a FOSS license.

Examples

## Examples from section 'Licenses' of 'Writing R Extensions':
analyze_license("GPL-2")
analyze_license("LGPL (>= 2.0, < 3) | Mozilla Public License")
analyze_license("GPL-2 | file LICENCE")
analyze_license("GPL (>= 2) | BSD_3_clause + file LICENSE")
analyze_license("Artistic-2.0 | AGPL-3 + file LICENSE")

[Package tools version 4.6.0 Index]