SpdxFile

pydantic model technote.metadata.spdx.SpdxFile

Representation of a SPDX license database file as a Pydantic model.

Parameters:

data (Any)

Show JSON schema
{
   "title": "SpdxFile",
   "description": "Representation of a SPDX license database file as a Pydantic model.",
   "type": "object",
   "properties": {
      "licenseListVersion": {
         "description": "Version string of this license file.",
         "title": "Licenselistversion",
         "type": "string"
      },
      "licenses": {
         "items": {
            "$ref": "#/$defs/SpdxLicense"
         },
         "title": "Licenses",
         "type": "array"
      }
   },
   "$defs": {
      "SpdxLicense": {
         "description": "A license item as contained in a `SpdxFile`.",
         "properties": {
            "name": {
               "description": "Common human-readable name of the license.",
               "title": "Name",
               "type": "string"
            },
            "licenseId": {
               "description": "SPDX license identifier.",
               "title": "Licenseid",
               "type": "string"
            },
            "seeAlso": {
               "description": "URLs to documentation about this license.",
               "items": {
                  "format": "uri",
                  "maxLength": 2083,
                  "minLength": 1,
                  "type": "string"
               },
               "title": "Seealso",
               "type": "array"
            },
            "isOsiApproved": {
               "description": "Flag indicating if the license is approved by the OSI (Open Software Initiative) ",
               "title": "Isosiapproved",
               "type": "boolean"
            }
         },
         "required": [
            "name",
            "licenseId",
            "isOsiApproved"
         ],
         "title": "SpdxLicense",
         "type": "object"
      }
   },
   "required": [
      "licenseListVersion",
      "licenses"
   ]
}

Fields:
field license_list_version: str [Required] (alias 'licenseListVersion')

Version string of this license file.

field licenses: list[SpdxLicense] [Required]

The licenses.

classmethod load_internal()

Load an SpdxFile from Technote’s package data.

Returns:

The SpdxFile instance from the licenses.json file packaged in Lander. This file is a mirror of the canonical license database maintained at spdx/license-list-data.

Return type:

SpdxFile