This package exposes some simple license-checking capabilities in Julia.
- Exports a Julia function
licensecheck
which wraps some of the functionality of the Go library licensecheck. This function takes a single string argumenttext
and returns a vector of the names of licenses (in fact, the SPDX identifiers of the licenses) matched intext
and the percent of the text covered by these matches. - Exports
is_osi_approved
, which given an SDPX 3.10 identifier, checks if the corresponding license is OSI approved. - Exports
find_license(dir)
which attempts to find the most likely license file in a directorydir
, as well asfind_licenses
,find_licenses_by_bruteforce
,find_licenses_by_list_intersection
, andfind_licenses_by_list
which offer various methods for doing so, each returning a table of possible results.
See the docstrings for more details.
Note that the licensecheck library is available under a BSD-3-Clause license (https://github.com/google/licensecheck/blob/v0.3.1/LICENSE), while the wrapping code here is MIT licensed.
julia> using LicenseCheck
julia> text = read(joinpath(pkgdir(LicenseCheck), "LICENSE"), String);
julia> result = licensecheck(text)
(licenses_found = ["MIT"], license_file_percent_covered = 98.82352941176471)
julia> all(is_osi_approved, result.licenses_found)
true
julia> is_osi_approved(result) # convenience method for the above
true
julia> find_license(pkgdir(LicenseCheck))
(license_filename = "LICENSE", licenses_found = ["MIT"], license_file_percent_covered = 98.82352941176471)
julia> is_osi_approved(find_license(pkgdir(LicenseCheck)))
true