spdx_licenses is an OCaml library aiming to provide an up-to-date and strict SPDX License Expression parser.
It implements the format described in: https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/
To install it simply call:
$ opam install spdx_licenses