uswid.component

class uswid.component.uSwidComponent(tag_id: str | None = None, tag_version: int = 0, software_name: str | None = None, software_version: str | None = None, generator: str | None = 'uSWID')

Represents a SWID component

__init__(tag_id: str | None = None, tag_version: int = 0, software_name: str | None = None, software_version: str | None = None, generator: str | None = 'uSWID')

Initializes uSwidComponent

activation_status: str | None

List of components used to derive this component

add_entity(entity: uSwidEntity) None

Add the latest entity

add_evidence(evidence: uSwidEvidence) None

Add the evidence

Add the deduplicated link

add_patch(patch: uSwidPatch) None

Add the patch

add_payload(payload: uSwidPayload) None

Add the payload

add_source_filename(source_file: str) None

Adds a source filename, i.e. what file helped created this component

add_vex_statement(vex_statement: uSwidVexStatement) None

Adds a relevant VEX statement tp the component

ancestors: List[uSwidComponent]

List of patches

colloquial_version: str | None

Colloquial version, usually the source hash

cpe: str | None

Common Platform Enumeration tag

edition: str | None

Edition, usually the tree hash

property entities: List[uSwidEntity]

Returns all the added entities

evidences: List[uSwidEvidence]

List of evidences

generator

Generator, normally uSWID

property generator_href: str | None

Returns the generator URL, if known

get_entity_by_name(name: str) uSwidEntity | None

Get the entity

get_entity_by_role(role: uSwidEntityRole) uSwidEntity | None

Get the entity

Get the link

get_payload_by_name(name: str) uSwidPayload | None

Get the payload

lang: str | None

Language code

Returns all the added links

merge(component_new: uSwidComponent) None

Add new things from the new component into the current one

payloads: List[uSwidPayload]

List of payloads

persistent_id: str | None

Persistent AppStream ID

problems() List[uSwidProblem]

Checks the component for common problems

product: str | None

Product

Remove the link

revision: str | None

Revision

property software_name: str | None

Returns the software name

software_version: str | None

Software version

source_dir: str | None

Status, with specific terms and conditions for its use, e.g. ‘DO NOT SHIP’

source_filenames: List[str]

Top-level source directory for the project

summary: str | None

One line summary

property tag_id: str | None

Returns the tag ID

tag_version: int

Tag version

type: uSwidComponentType

Type

version_scheme: uSwidVersionScheme | None

Version scheme

vex_statements: List[uSwidVexStatement]

Top-level source files used construct the component

class uswid.component.uSwidComponentType(value)

Represents the component type

APPLICATION = 'application'
FIRMWARE = 'firmware'
LIBRARY = 'library'
static from_str(value: str) uSwidComponentType

converts a lowercase component type to a uSwidComponentType