mirror of
https://github.com/euantorano/spdx_licenses.nim
synced 2026-01-03 01:44:37 +00:00
No description
| .circleci | ||
| docs | ||
| src | ||
| tests | ||
| .editorconfig | ||
| .gitignore | ||
| .travis.yml | ||
| LICENSE | ||
| README.md | ||
| spdx_licenses.nimble | ||
spdx_licenses

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