cyclonedx.model.component

Attributes

COMPONENT_SCOPE_VERSIONS

Classes

Commit

Our internal representation of the commitType complex type.

ComponentScope

Enum object that defines the permissable 'scopes' for a Component according to the CycloneDX schema.

ComponentType

Enum object that defines the permissible 'types' for a Component according to the CycloneDX schema.

Diff

Our internal representation of the diffType complex type.

PatchClassification

Enum object that defines the permissible `patchClassification`s.

Patch

Our internal representation of the patchType complex type.

Pedigree

Our internal representation of the pedigreeType complex type.

Swid

Our internal representation of the swidType complex type.

OmniborId

Helper class that allows us to perform validation on data strings that must conform to

Swhid

Helper class that allows us to perform validation on data strings that must conform to

Component

This is our internal representation of a Component within a Bom.

Module Contents

class cyclonedx.model.component.Commit

Our internal representation of the commitType complex type.

Note

See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_commitType

uid: str | None
url: cyclonedx.model.XsUri | None
author: cyclonedx.model.IdentifiableAction | None
committer: cyclonedx.model.IdentifiableAction | None
message: str | None
class cyclonedx.model.component.ComponentScope

Bases: str, enum.Enum

Enum object that defines the permissable ‘scopes’ for a Component according to the CycloneDX schema.

Note

See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_scope

REQUIRED = 'required'
OPTIONAL = 'optional'
EXCLUDED = 'excluded'
cyclonedx.model.component.COMPONENT_SCOPE_VERSIONS: dict[ComponentScope, set[cyclonedx.schema.SchemaVersion]]
class cyclonedx.model.component.ComponentType

Bases: str, enum.Enum

Enum object that defines the permissible ‘types’ for a Component according to the CycloneDX schema.

Note

See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_classification

APPLICATION = 'application'
CONTAINER = 'container'
CRYPTOGRAPHIC_ASSET = 'cryptographic-asset'
DATA = 'data'
DEVICE = 'device'
DEVICE_DRIVER = 'device-driver'
FILE = 'file'
FIRMWARE = 'firmware'
FRAMEWORK = 'framework'
LIBRARY = 'library'
MACHINE_LEARNING_MODEL = 'machine-learning-model'
OPERATING_SYSTEM = 'operating-system'
PLATFORM = 'platform'
class cyclonedx.model.component.Diff

Our internal representation of the diffType complex type.

Note

See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_diffType

text: cyclonedx.model.AttachedText | None
url: cyclonedx.model.XsUri | None
class cyclonedx.model.component.PatchClassification

Bases: str, enum.Enum

Enum object that defines the permissible `patchClassification`s.

Note

See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_patchClassification

BACKPORT = 'backport'
CHERRY_PICK = 'cherry-pick'
MONKEY = 'monkey'
UNOFFICIAL = 'unofficial'
class cyclonedx.model.component.Patch

Our internal representation of the patchType complex type.

Note

See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_patchType

type: PatchClassification
diff: Diff | None
resolves: SortedSet[IssueType]
class cyclonedx.model.component.Pedigree

Our internal representation of the pedigreeType complex type.

Note

See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_pedigreeType

ancestors: SortedSet[Component]
descendants: SortedSet[Component]
variants: SortedSet[Component]
commits: SortedSet[Commit]
patches: SortedSet[Patch]
notes: str | None
class cyclonedx.model.component.Swid

Our internal representation of the swidType complex type.

Note

See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_swidType

tag_id: str
name: str
version: str | None
tag_version: int | None
patch: bool | None
text: cyclonedx.model.AttachedText | None
url: cyclonedx.model.XsUri | None
class cyclonedx.model.component.OmniborId(id: str)

Helper class that allows us to perform validation on data strings that must conform to https://www.iana.org/assignments/uri-schemes/prov/gitoid.

property id: str
classmethod serialize(o: Any) str
classmethod deserialize(o: Any) OmniborId
class cyclonedx.model.component.Swhid(id: str)

Helper class that allows us to perform validation on data strings that must conform to https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html.

property id: str
classmethod serialize(o: Any) str
classmethod deserialize(o: Any) Swhid
class cyclonedx.model.component.Component

Bases: cyclonedx.model.dependency.Dependable

This is our internal representation of a Component within a Bom.

Note

See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_component

name: str
type: ComponentType
bom_ref: cyclonedx.model.bom_ref.BomRef
mime_type: str | None
supplier: cyclonedx.model.contact.OrganizationalEntity | None
manufacturer: cyclonedx.model.contact.OrganizationalEntity | None
authors: SortedSet[OrganizationalContact]
author: str | None
publisher: str | None
group: str | None
version: str | None
description: str | None
scope: ComponentScope | None
hashes: SortedSet[HashType]
licenses: cyclonedx.model.license.LicenseRepository
copyright: str | None
cpe: str | None
purl: packageurl.PackageURL | None
omnibor_ids: SortedSet[OmniborId]
swhids: SortedSet[Swhid]
swid: Swid | None
modified: bool
pedigree: Pedigree | None
external_references: SortedSet[ExternalReference]
properties: SortedSet[Property]
components: SortedSet[Component]
evidence: cyclonedx.model.component_evidence.ComponentEvidence | None
release_notes: cyclonedx.model.release_note.ReleaseNotes | None
crypto_properties: cyclonedx.model.crypto.CryptoProperties | None
tags: SortedSet[str]
static for_file(absolute_file_path: str, path_for_bom: str | None) Component

Deprecated — Wrapper of cyclonedx.contrib.component.builders.ComponentBuilder.make_for_file().

get_all_nested_components(include_self: bool = False) set[Component]
get_pypi_url() str