asf-cat.api

A micro library that provides a Clojure implementation of the Apache Software
Foundation's 3rd Party License Policy (https://www.apache.org/legal/resolved.html).

categories

The set of categories, ordered by category-comparator.

category-comparator

(category-comparator l r)
A comparator for ASF category keywords, defined as being this ordering:
1. :category-a
2. :category-a-special
3. :category-b
4. :creative-commons
5. :category-x
6. :uncategorised

category-info

(category-info category)
Returns information on a category as a map with the keys :name and :url (both
strings).  :name is a human-readable name of the category and :url is a link
to the ASF's documentation on the category.

expression-category

(expression-category spdx-expr)
Given an SPDX license expression, returns the overall ASF category of that
expression.  Possible result values are as for license-category.

expressions-least-category

(expressions-least-category expressions)
Returns the lowest (best) category in the given sequence of SPDX license
expressions.

expressions-most-category

(expressions-most-category expressions)
Returns the highest (worst) category for the given sequence of SPDX license
expressions.

least-category

(least-category categories)
Returns the lowest (best) category in the given sequence of categories.

license-category

(license-category license-id)
Given an SPDX license identifier, a lice-comb LicenseRef, or 'Public Domain'
(which is not a valid SPDX identifier but is special cased by asf-cat),
returns one of:

nil                 - when license-id is nil, empty or blank
:category-a         - see https://www.apache.org/legal/resolved.html#category-a
:category-a-special - see https://www.apache.org/legal/resolved.html#handling-public-domain-licensed-works
:category-b         - see https://www.apache.org/legal/resolved.html#category-b
:creative-commons   - see https://www.apache.org/legal/resolved.html#cc-by
                      (may be any category - further manual investigation
                      required)
:category-x         - see https://www.apache.org/legal/resolved.html#category-x
:uncategorised      - the ASF category of license-id could not be determined

Note: as of v2.0, expression-category is the preferred primary API for using
asf-cat, since every SPDX license identifier is (by definition) also a valid
SPDX expression.

license-comparator

(license-comparator l r)
A comparator for SPDX license identifiers, based on their ASF categories (see
`category-comparator`).

licenses-least-category

(licenses-least-category license-ids)
Returns the lowest (best) category in the given sequence of licenses (as per
license-category).

licenses-most-category

(licenses-most-category license-ids)
Returns the highest (worst) category for the given sequence of licenses (as
per license-category).

most-category

(most-category categories)
Returns the highest (worst) category for the given sequence of categories.

policy-uri

The URI (as a string) of the Apache Software Foundation's 3rd Party License
Policy