No description
Find a file
2019-03-16 17:03:00 +00:00
.circleci Fixing travis, adding test task and adding Circle CI 2018-07-25 17:26:49 +01:00
docs Adding docs 2018-07-25 17:40:46 +01:00
src Adding travis config 2018-07-25 17:16:40 +01:00
tests Initial commit 2018-07-25 17:08:41 +01:00
.editorconfig Initial commit 2018-07-25 17:08:41 +01:00
.gitignore Initial commit 2018-07-25 17:08:41 +01:00
.travis.yml Fixing travis, adding test task and adding Circle CI 2018-07-25 17:26:49 +01:00
LICENSE Create LICENSE 2019-03-16 17:03:00 +00:00
README.md Update readme with docs link 2018-07-25 20:31:44 +01:00
spdx_licenses.nimble Adding docs 2018-07-25 17:40:46 +01:00

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