Lib4SBOM is a library to parse and generate Software Bill of Materials (SBOMs). It supports SBOMs created in both
SPDX and CycloneDX formats.
It has been developed on the assumption that having a generic abstraction of SBOM regardless of the underlying format will be useful to developers.
The following facilities are provided:
Generate SPDX SBOM in TagValue, JSON and YAML formats
Generate CycloneDX SBOM in JSON format
Parse SPDX SBOM in TagValue, JSON, YAML, XML and RDF formats
Validate CycloneDX SBOM in JSON and XML format
Validate SPDX SBOM in TagValue, JSON, YAML, XML and RDF formats
Parse CycloneDX SBOM in JSON and XMLformat
Create and manipulate a SBOM file object
Create and manipulate a SBOM package object
Create and manipulate a SBOM dependency relationship object
Create and manipulate a Vulnerability object
Create and manipulate a Software Service object
Create and manipulate a Cryptography object
Generated SBOM can be output to a file or to the console
Parse a SBOM embedded in an Intoto attestaion
Parse a SPDX or CycloneDX SBOM embedded in a Protobom object
Installation
To install use the following command:
pip install lib4sbom
Alternatively, just clone the repo and install dependencies using the following command:
pip install -U -r requirements.txt
The tool requires a recent version of Python 3 (3.9+). It is recommended to use a virtual python environment especially
if you are using different versions of python. virtualenv is a tool for setting up virtual python environments which
allows you to have all the dependencies for the tool set up in a single environment, or have different environments set
up for testing using different versions of Python.
API
SBOMParser
The SBOMParser module provides methods for parsing a SBOM in either SPDX or CycloneDX format and
returns the file, package and relationship information from within the SBOM.
The focus of the implementation is on providing a common set of SBOM data regardless of the SBOM format.
SBOMs are supported in the following formats and versions
SBOM Type
Version
Format
SPDX
2.2
TagValue
SPDX
2.2
JSON
SPDX
2.2
YAML
SPDX
2.2
RDF
SPDX
2.2
XML
SPDX
2.3
TagValue
SPDX
2.3
JSON
SPDX
2.3
YAML
SPDX
2.3
RDF
SPDX
2.3
XML
SPDX
3.0
JSON-LD
CycloneDX
1.4
JSON
CycloneDX
1.4
XML
CycloneDX
1.5
JSON
CycloneDX
1.5
XML
CycloneDX
1.6
JSON
CycloneDX
1.6
XML
CycloneDX
1.7
JSON
CycloneDX
1.7
XML
Note that support for SPDX RDF and XML formats is limited to a few package attributes.
Note support for parsing SBOMs embedded as In-Toto statements is supported for SPDX documents.
classSBOMParser(sbom_type='auto')
This creates a simple SBOM Parser object. A single optional parameter, sbom_type, can be specified
which represents the type of SBOM (either spdx, cyclonedx or auto). The default is auto in
which case the parser will automatically work out the SBOM type using the
following filename conventions.
SBOM
Format
Filename extension
SPDX
TagValue
.spdx
SPDX
JSON
.spdx.json
SPDX
JSON-LD
.jsonld
SPDX
YAML
.spdx.yaml
SPDX
YAML
.spdx.yml
SPDX
RDF
.spdx.rdf
SPDX
XML
.spdx.xml
CycloneDX
JSON
.json
CycloneDX
JSON
.cdx.json
CycloneDX
JSON
.bom.json
CycloneDX
XML
.xml
CycloneDX
XML
.cdx.xml
CycloneDX
XML
.bom.xml
The parser will check that the correct JSON files is being processed by the correct parser.
A SPDX JSON file submitted to the CycloneDX parser will result in no data being processed.
Note SPDX files with an extension of .json will be checked for JSON-LD and JSON formats.
If the filename does not follow one of the filename conventions above, the SBOM format and
type are identified from the file's content (SBOM data which is not identified from the
filename is detected from its content using JSON, JSON-LD, XML, RDF, YAML and TagValue
processing).
Errors in the parsing process will result in the exception SBOMParserException being raised.
This also applies when SBOM data cannot be identified from the content of a file with an
unrecognised filename extension.
Methods
parse_file(filename)
Parses the SBOM file. If the file does not exist, a FileNotFoundError exception is raised.
If the filename does not follow the filename conventions, the SBOM format and type are
identified from the file's content.
If an error occurs during the parsing of the file, a SBOMParserException exception is raised.
parse_string(sbom_string)
Parses the SBOM content from sbom_string.
If an error occurs during the parsing of the file, a SBOMParserException exception is raised.
get_files()
Returns a list of file elements from within a parsed SBOM
get_packages()
Returns a list of packages elements from within a parsed SBOM
get_relationships()
Returns the relationship elements from within a parsed SBOM
get_vulnerabilities()
Returns the vulnerability elements from within a parsed SBOM
get_services()
Returns the software service elements from within a parsed SBOM
get_type()
Returns the type of SBOM (either spdx or cyclonedx)
Example
A test SBOM file (test_sbom.spdx) is used in the following example.
The optional parameter, sbom_type, can be specified
which represents the type of SBOM (either spdx, cyclonedx or auto). The default is auto in
which case the parser will automatically work out the SBOM type using the
following filename conventions.
SBOM
Format
Filename extension
SPDX
TagValue
.spdx
SPDX
JSON
.spdx.json
SPDX
JSON-LD
.jsonld
SPDX
YAML
.spdx.yaml
SPDX
YAML
.spdx.yml
SPDX
RDF
.spdx.rdf
SPDX
XML
.spdx.xml
CycloneDX
JSON
.json
CycloneDX
JSON
.cdx.json
CycloneDX
JSON
.bom.json
CycloneDX
XML
.xml
CycloneDX
XML
.cdx.xml
CycloneDX
XML
.bom.xml
The optional parameter, version, can be used to specify a single version of the SBOM to be validated against e.g. "1.6".
The optional parameter, debug, can be used to generate debug output.
Note To validate a SPDX SBOM in version 3.0 format, the version must be explictedly specified,
Methods
validate_file(filename)
Validates the SBOM file. If the file does not exist, a FileNotFoundError exception is raised.
The validator will check that the correct JSON files is being processed by the correct parser.
A SPDX JSON file submitted to the CycloneDX parser will result in no data being processed.
If an error occurs during the validation of the file, a SBOMValidatorException exception is raised.
The return value is a dictionary representing the type of SBOM and the version. e.g. {"SPDX" : 2.3}.
If the SBOM fails to validate the return value is the type of SBOM and a boolean value e.g. e.g. {"SPDX" : False}.
If the SBOM cannot be validated the return value is the type of SBOM and "Unknown" i.e. {"SPDX" : "Unknown"}.
Validation rules:
The validation for SPDX JSON and YAML files is against the SPDX JSON schema.
The validation for SPDX TagValue, RDF and XML files is simply vaerification that a valid version of the SDPX specification is detected.
The validation for CycloneDX JSON files is against the CycloneDX JSON schema.
The validation for CycloneDX XML files is against the CycloneDX XML schema.
SBOMGenerator
The SBOMGenerator module provides methods for generating a SBOM in either SPDX or CycloneDX format.
The focus of the implementation is on providing a single interface regardless of the SBOM type and format.
SBOMs can be generated in the following formats
SBOM Type
Version
Format
SPDX
2.2
Tag
SPDX
2.2
JSON
SPDX
2.2
YAML
SPDX
2.3
Tag
SPDX
2.3
JSON
SPDX
2.3
YAML
SPDX
3.0
JSON-LD
CycloneDX
1.4
JSON
CycloneDX
1.5
JSON
CycloneDX
1.6
JSON
CycloneDX
1.7
JSON
The default version for CycloneDX is version 1.7. However, the version can be overridden by setting the environment variable LIB4SBOM_CYCLONEDX_VERSION to "1.4", "1.5" or "1.6" as required.
The default version for SPDX is version 2.3. However, the version can be overridden by setting the environment variable LIB4SBOM_SPDX_VERSION to "SPDX-2.2" if required.
Note To generate a SPDX SBOM in 3.0 format, the enviornment variable LIB4SBOM_SPDX3 must be set.
Note Top preserve existing SBOM metadata, e.g. the creation time, the environment variable LIB4SBOM_PRESERVE must be set.
The organization creating the SBOM can be set be setting the environment variable SBOM_ORGANIZATION. This can be overriden by setting the value of the Metadata_Supplier attribute within the SBOM Document.
This creates a simple SBOM Generator object. The following optional parameters can be specified:
validate_license indicates if license information is validated against the set of SPDX license identifiers. This option only applies for SPDX SBOMs
as this is mandatory for CycloneDX SBOMs.
sbom_type indicates the type of SBOM to be generated. Valid options are spdx or cyclonedx. Support for SPDX3 is currently experimental but can be enabled by setting the sbom_type to spdx3.
format indicates the format that the SBOM is to be generated in. Valid options are Tag, JSON or YAML. If an invalid format is specified,
a default format of JSON will be assumed. If an unsupported format is specified for the type of SBOM (e.g. Tag or YAML for CycloneDX), a default
format is assumed (Tag for SPDX, JSON for CycloneDX)
application and version specify the name and version of the tool which created the SBOM. If these are not specified, the application name is 'lib4sbom' and the version is '0.1'
The method generates the SBOM file. The parameters are
project_name specifies the name of the project
sbom_data contain the SBOM data to be used in the generation. It contains details of the packages, files and relationships to be included in the SBOM.
filename is the name of the file to be generated. The default is for the output to be generated to a console.
send_to_output indicates if the output is to be sent to the filename.
get_sbom()
Returns the generated SBOM in the requested format
get_type()
Returns the type of the generated SBOM (either spdx or cyclonedx)
get_format()
Returns the format of the generated SBOM (one of tag, json or yaml)
Example
The following code sample shows the use of the SBOMGenerator module being used
in the conversion of a SBOM from the Tag Value format to YAML format. The output is sent ot the console.
This creates a simple SBOM Output object. The following optional parameters can be specified:
filename indicates the output destination of the SBOM to be generated. If a valid filename path is provided and a file can be created, then the output will be to a file otherwise
it will be output to the console.
output_format indicates the format that the SBOM is to be generated in. Valid options are Tag, JSON or YAML. If an invalid format is specified,
a default format of Tag will be assumed.
Methods
generate_output(dataset) Outputs a SBOM file. The parameters are
dataset contains SBOM data in the output format. If the SBOM data is NOT in the format specified by the output_format parameter, no output will be generated.
NOTE A valid dataset will normally be generated by the SBOMGenerator class and obtained by a call to the get_sbom() method.
get_type()
Return the destination of the generated SBOM. Either file or console
get_format()
Return the format of the generated SBOM. One of Tag, JSON or YAML.
Example
The following code sample shows the use of the SBOMOutput module.
This creates a simple SBOM object. This object contains all the items to be contained within the SBOM including
components and relationships. It is left to the application manipulating the SBOM object to apply validation as appropriate
for the presence of each attribute.
Methods
Setter Methods
For the following attributes, a method set_attribute(value) is provided. Note that the attribute name is always in lowercase.
e.g. set_type(). Unless indicated, the method just takes a single parameter for the value. Where indicated, multiple instances of the attribute may be defined.
Attribute
Multiple
Note
Version
No
(1)
Type
No
(2)
Uuid
No
(3)
Bom_Version
No
Note
This relates to the version of the specification of SBOM specified by the type atrribute. e.g. 1.4 for CycloneDX, SPDX-2.3 for SPDX.
This refers to the type of SBOM either SPDX or CycloneDX.
This relates to the unique identifier for the SBOM.
Getter Methods
get_sbom()
Returns the SBOM object as a dictionary.
This creates a simple SBOMDocument object. This object contains the values of the attributes
that can be associated with a SBOM. This includes attributes such as name, identifier, type of file,
checksum and licence information. As each of the attributes are optional, it is left to the application manipulating the
SBOMFile object to apply validation as appropriate for the presence of each attribute.
Methods
Setter Methods
For the following attributes, a method set_attribute(value) is provided. Note that the attribute name is always in lowercase.
e.g. set_filetype(). The attribute names are aligned with the attributes of the File Object in the SPDX Specification. Unless
indicated, the method just takes a single parameter for the value. Where indicated, multiple instances of the attribute may be defined.
Attribute
Multiple
Note
Name
No
Id
No
DataLicense
No
Metadata_Type
No
(1)
Metadata_Supplier
No
Metadata_Version
No
Bom_Version
No
Note
This relates to the type of component which the SBOM is describing. This is attribute is only used for CycloneDX SBOMs.
There is an additional setter method, set_value(attribute, value) which allows the setting of any attribute.
set_value("language", "Rust")
Getter Methods
get_document()
Returns the SBOMDocument object as a list.
get_name()
Returns the name of the SBOMDocument object or a default value if the attribute does not exist within the instance of the SBOMDocument object.
get_value(attribute)
Returns the value of the attribute. A default value is returned if the attribute does not exist within the instance of the SBOMDocument object.
This creates a simple SBOM File object. This object contains the values of the attributes
that can be associated with a file artefact within an SBOM. This includes attributes such as name, identifier, type of file,
checksum and licence information. As each of the attributes are optional, it is left to the application manipulating the
SBOMFile object to apply validation as appropriate for the presence of each attribute.
Methods
Setter Methods
For the following attributes, a method set_attribute(value) is provided. Note that the attribute name is always in lowercase.
e.g. set_filetype(). The attribute names are aligned with the attributes of the File Object in the SPDX Specification. Unless
indicated, the method just takes a single parameter for the value. Where indicated, multiple instances of the attribute may be defined.
Attribute
Multiple
Note
Name
No
Id
No
FileType
Yes
Checksum
Yes
(1)
LicenseConcluded
No
LicenceInfoInFile
Yes
LicenceComment
No
CopyrightText
No
Comment
No
Notice
No
Contributor
Yes
Attribution
No
Note
The set_checksum method takes two parameters, the checksum algorithm (e.g. SHA256) and the actual checksum value (as a string)
There is an additional setter method, set_value(attribute, value) which allows the setting of any attribute.
set_value("language", "Rust")
Getter Methods
get_file()
Returns the SBOMFile object as a dictionary. The value of an attribute is returned as a string except where multiple instances of an attribute are allowed in which
case the value of the attribute is returned as a List.
get_name()
Returns the name of the SBOMFile object or None if the 'name' attribute does not exist within the instance of the SBOMFile object.
get_value(attribute)
Returns the value of the attribute. A default value is returned if the attribute does not exist within the instance of the SBOMFile object.
Utility Methods
initialise() Reinitialises a SBOMFile Object. All data associated with the object is deleted.
This creates a simple SBOM Package object. This object contains the values of the attributes
that can be associated with a package or component artefact within an SBOM. This includes attributes such as name, identifier, supplier,
version and licence information. As each of the attributes are optional, it is left to the application manipulating the
SBOMPackage object to apply validation as appropriate for the presence of each attribute.
Setter Methods
For the following attributes, a method set_attribute(value) is provided. Note that the attribute name is always in lowercase.
e.g. set_version(). The attribute names are aligned with the attributes of the Package Object in the SPDX Specification. Unless
indicated, the method just takes a single parameter for the value. Where indicated, multiple instances of the attribute may be defined.
Attribute
Multiple
Note
Name
No
Id
No
Type
No
(1)
Checksum
Yes
(2)
LicenseConcluded
No
LicenseDeclared
No
(3)
LicenceInfoInFile
Yes
LicenceComments
No
FilesAnalysis
No
CopyrightText
No
Comment
No
Originator
No
Supplier
No
Version
No
Homepage
No
Property
Yes
(4)
DownloadLocation
No
Description
No
ExternalReference
Yes
(5)
Cpe
No
Purl
No
(6)
Summary
No
SourceInfo
No
Filename
No
Note
The set_type method is used to indicate the purpose of the package (e.g. Application, Library, Operating-System).
The set_checksum method takes two parameters, the checksum algorithm (e.g. SHA256) and the actual checksum value (as a string)
The set_licensedeclared method takes an optional second parameter which is the license name. In this case the first parameter, license, is assumed to be the license text rather than the license identity.
The set_property method takes two parameters which are the property name and value.
The set_externalreference method takes three parameters which are the category (SECURITY or PACKAGE_MANAGER), type (cpe22Type, cpe23Type or purl) and the element corresponding to the tyoe.
The set_cpe takes an optional second parameter which is the CPE type (default is cpeType23).
There is an additional setter method, set_value(attribute, value) which allows the setting of any attribute.
set_value("language", "Rust")
Getter Methods
get_package()
Returns the SBOMPackage object as a dictionary. The value of an attribute is returned as a string except where multiple instances of an attribute are allowed in which
case the value of the attribute is returned as a List.
get_name()
Returns the name of the SBOMPackage object or None if the 'name' attribute does not exist within the instance of the SBOMPackage object.
get_value(attribute)
Returns the value of the attribute. A default value is returned if the attribute does not exist within the instance of the SBOMPackage object.
get_purl()
Returns the PURL identifier as a string for the package or None if no PURL element is defined.
get_cpe()
Returns the CPE identifier as a string for the package or None if no CPE element is defined.
Utility Methods
initialise() Reinitialises a SBOMPackage Object. All data associated with the object is deleted.
This creates a simple SBOMRelationship object which is used to show the relationship between two items within an SBOM.
As there are multiple types of relationships, it is left to the application manipulating the
SBOMRelationship object to apply validation as appropriate to ensure the semantics of the relationship are correct.
Setter Methods
set_relationship (source, type, target)
source and target are the unique identifiers of the components for which the relationship is being defined.
type is the type of relationship being defined.
NOTE The library does not understand the semantic meaning behind the type of the relationship. This is particularly
important when converting between SPDX and CycloneDX. A SPDX relation 'A is a BUILD_DEPENDECY_OF B' would be represented
as 'A dependsOn B' in CycloneDX which does not convey the same semantic meaning.
Getter Methods
get_relationship()
Returns the SBOMRelationship object as a dictionary.
This creates a simple vulnerability object which is used to define the details of a vulnerability typically for a component
specified within an SBOM. As there are multiple ways of specifying the status of a vulnerability, it is left to the
application manipulating the Vulnerability object to apply validation as appropriate to ensure the semantics of the vulnerability are correct.
The following optional parameter can be specified:
validation indicates that the status field is to be validated against the OpenVEX, CycloneDX or CSAF specifcaitions.
NOTE Vulnerability objects are only included in CyclonedDX SBOMs
Setter Methods
For the following attributes, a method set_attribute(value) is provided. Note that the attribute name is always in lowercase.
e.g. set_release(). Each method takes a single parameter for the value. Multiple instances of the attribute are not allowed.
Attribute
Multiple
Note
Name
No
Id
No
(1)
Release
No
Status
No
(2)
Comment
No
(3)
Description
No
(4)
Note
The set_id method is used to indicate the identity of the vulnerability e.g. CVE-2021-44228
The set_status is used to indicate the status of the vulnerability. Validation of the value of status may be optionally performed as determined by
the optional parameter validation specified in the creation of the Vulnerability object. An invalid status is indicated by a value of None.
The set_comment method is used to provide additional information to support the status value e.g. a brief justification
The set_description method is used to describe the vulnerability.
There is an additional setter method, set_value(attribute, value) which allows the setting of any attribute.
set_value("bom-ref", "rust@1.2.3")
Getter Methods
get_vulnerability()
Returns the vulnerability object as a dictionary.
This creates a simple software service object which is used to define the details of a software service.
As there are multiple ways of specifying a service, it is left to the
application manipulating the service object to apply validation as appropriate to ensure the semantics of the service are correct.
NOTE Services objects are only included in CyclonedDX SBOMs
Setter Methods
For the following attributes, a method set_attribute(value) is provided. Note that the attribute name is always in lowercase.
e.g. set_release(). Each method takes a single parameter for the value. Multiple instances of the attribute are not allowed.
Attribute
Multiple
Note
Name
No
Id
No
(1)
Version
No
Provider
No
(2)
Endpoint
Yes
Data
Yes
(3)
Property
Yes
(4)
License
Yes
Exernalreference
Yes
(5)
Description
No
Note
The set_id method is used to indicate the identity of the service. If this is not specified, an id will be automatically generated.
The set_provider is used to specify details of the service provider. There are multiple parameters which can be specified (name, url, contactname, email address and phone) at least one must be specified.
The set_data method is used to provide additional information to describe the data being exhanged. There are two mandatatory parameters flow type ("Inbound", "Outbound", "Bi-directional" or "Unknown") and classification, and two optional paramters name and description.
The set_property method takes two parameters which are the property name and value.
The set_externalreference method takes three parameters, the URL, the type of information being referenced and an optional comment.
There is an additional setter method, set_value(attribute, value) which allows the setting of any attribute.
set_value("trustzone", "Data_DMZ")
Getter Methods
get_service()
Returns the service object as a dictionary.
This creates a simple cryptograpy object which is used to define the details of a cryptogrtahiic item (an algorithm, certificate, protool or related material).
As there are multiple ways of specifying a cryptograpy object, it is left to the
application manipulating the object to apply validation as appropriate to ensure the semantics are correct. Reference
to the CycloneDX guide to CBOMs is
strongly recommended.
NOTE Cryptography objects are only included in CyclonedDX SBOMs and are attributes of a component.
Setter Methods
The set_type method must be called to define the type of cryptography object being defined. This method takes the type of object being created (one of 'a)gorithm', 'certifciate', 'protocol', or 'related-crypto-material'.
Supporting methods are provided for each type as follows:
Algorithm
set_algorithm
set_keysize
Certificate
set_certificate
set_format
set_date
set_state
set_asset
Protocol
set_version
Material
set_property
set_value
The example below provides guidance on how to use each method.
Getter Methods
get_cryptography()
Returns the cryptography object as a dictionary.
Example
from lib4sbom.data.cryptography import SBOMCryptoography
from lib4sbom.data.package import SBOMPackage
my_package = SBOMPackage()
my_crypto = SBOMCryptography()
# Include crypto with a component
my_package.initialise()
my_package.set_name("RSA-PKCS1-1.5-SHA-256-2048")
my_package.set_type("cryptographic-asset")
my_crypto.initialise()
my_crypto.set_oid("1.3.4.5.6")
my_crypto.set_type("algorithm","signature")
my_crypto.set_keysize("2048")
my_crypto.set_algorithm("RSASSA-PKCS1")
my_crypto.set_value("elipticCurve","bn/bn158")
# Add crypto element to component
my_package.set_value("crypto", my_crypto.get_cryptography())
sbom_packages[
(my_package.get_name(), my_package.get_value("version"))
] = my_package.get_package()
# Include crypto with a component
my_package.initialise()
my_package.set_name("Wikipedia-cert",)
my_package.set_type("cryptographic-asset")
my_crypto.initialise()
my_crypto.set_type("certificate")
my_crypto.set_certificate(subject = "C=US, ST=California, O=San Fransico, O=Wikipedia",
issuer='C=BE, O=GlbalSign, CN=Acme')
my_crypto.set_state("pre-activation")
my_crypto.set_date("create", "2026-02-13")
my_crypto.set_date("activate", "2026-02-14")
my_crypto.set_asset("publickey","abcd")
my_crypto.set_format("X.509")
my_package.set_value("crypto", my_crypto.get_cryptography())
sbom_packages[
(my_package.get_name(), my_package.get_value("version"))
] = my_package.get_package()
# Include crypto with a component
my_package.initialise()
my_package.set_name("Wikipedia",)
my_package.set_type("cryptographic-asset")
my_crypto.initialise()
my_crypto.set_type("protocol", "tls")
my_crypto.set_version("1.3")
my_crypto.set_asset("publickey","abcd")
my_package.set_value("crypto", my_crypto.get_cryptography())
sbom_packages[
(my_package.get_name(), my_package.get_value("version"))
] = my_package.get_package()
# Include crypto with a component
my_package.initialise()
my_package.set_name("WikipediaData",)
my_package.set_type("cryptographic-asset")
my_crypto.initialise()
my_crypto.set_type("related-crypto-material", "private-key")
my_crypto.set_state("active")
my_crypto.set_date("activate", "2026-02-16")
my_crypto.set_asset("privatekey","abcd")
my_package.set_value("crypto", my_crypto.get_cryptography())
sbom_packages[
(my_package.get_name(), my_package.get_value("version"))
] = my_package.get_package()
Examples
A number of example scripts are included in the examples subdirectory.
Implementation Notes
The following design decisions have been made in processing the SBOM files:
It is assumed that the SBOM is valid and contains syntactically valid data.
In SPDX format, the tool assumes that the name of a package preceeds the version and license of the package.
In SPDX format, the current implementation does not currently handle multi-line elements.
When processing and validating licenses, the application will use a set of synonyms to attempt to map some license identifiers to the correct SPDX License Identifiers. However, the
user of the tool is reminded that they should assert the quality of any data which is provided by the tool particularly where the license identifier has been modified.
When parsing an SBOM with multiple instances of a component with the same name and version, only one instance of the comnponent is retained. If mulitple instances are
required to be preserved, consider ensuring that the component name is unique.
When validating an SBOM in SPDX format, as there are no offocial schemas published, the validation is limited to checking for the presence for some mandatory fields.
Future Development
Support later versions of SPDX (3.0).
Enhance validation of SBOM data to check for all mandatory elements.
Implement Python typing across modules.
Migrate packaging infrastructure away from setup.py.
Utilise third-party SPDX and CycloneDX parsers and generators
This tool is meant to support software development. The usefulness of the tool is dependent on the SBOM data
which is provided to the tool. Unfortunately, the tool is unable to determine the validity or completeness of such a SBOM file; users of the tool
are therefore reminded that they should assert the quality of any data which is provided to the tool.
Parsing invalid SBOM files may lead to unpredictable results.
Feedback and Contributions
Bugs and feature requests can be made via GitHub Issues.
Alternatives
Use instead of lib4sbom: tools that do the same job, closest first.