spdx_licenses

A library to retrieve the list of commonly used licenses from the SPDX License List.


Keywords
spdx, license
License
BSD-3-Clause
Install
nimble install spdx_licenses

Documentation

spdx_licenses CircleCI Build Status

A library to retrieve the list of commonly used licenses from the SPDX License List.

Installation

Add to your .nimble file:

# Dependencies

requires "spdx_licenses >= 1.0.0"

Or to install it globally run:

nimble install spdx_licenses

Documentation

Usage

There are async versions of all of the exported methods. For cases where you pass in a custom AsyncHttpClient, simply call the procedures as normal. For cases when using the default HttpClient, the call is postfixed with Async (eg: getLicenseList() is getLicenseListAsync()).

  • Retrieving a list of all licenses, as a table keyed by license ID:
import spdx_licenses

# You can also pass in your own custom `HttpClient` instance if you have one you wish to re-use
let licenses = getLicenseList()

echo "Found licenses: "

for lic in licenses.keys:
  echo "- ", lic
  • Getting the license text for a specific license by license ID:
import spdx_licenses

# You can also pass in your own custom `HttpClient` instance if you have one you wish to re-use
let licenseText = getLicenseText("BSD-3-Clause")

echo licenseText