# cyclonedx.model.definition

## Classes

`CreId` | Helper class that allows us to perform validation on data strings that must conform to
`Requirement` | A requirement comprising a standard.
`Level` | Level of compliance for a standard.
`Standard` | A standard of regulations, industry or organizational-specific standards, maturity models, best practices,
`Definitions` | The repository for definitions

## Module Contents

class cyclonedx.model.definition.CreId(id: str)

  Bases: `py_serializable.helpers.BaseHelper`

  Helper class that allows us to perform validation on data strings that must conform to Common Requirements Enumeration (CRE) identifier(s).

  property id: str
  classmethod serialize(o: Any) → str

    general purpose serializer

  classmethod deserialize(o: Any) → _T_CreId

    general purpose deserializer

  classmethod json_normalize(o: Any, *, view: Type[py_serializable.ViewType] | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any | None

    json specific normalizer

  classmethod json_serialize(o: Any) → str | Any

    json specific serializer

  classmethod json_denormalize(o: Any, *, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any

    json specific denormalizer

    Parameters:

      - tCls – the class that was desired to denormalize to

      - pCls – tha prent class - as context

  classmethod json_deserialize(o: Any) → Any

    json specific deserializer

  classmethod xml_normalize(o: Any, *, element_name: str, view: Type[py_serializable.ViewType] | None, xmlns: str | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → xml.etree.ElementTree.Element | Any | None

    xml specific normalizer

  classmethod xml_serialize(o: Any) → str | Any

    xml specific serializer

  classmethod xml_denormalize(o: xml.etree.ElementTree.Element, *, default_ns: str | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any

    xml specific denormalizer

  classmethod xml_deserialize(o: str | Any) → Any

    xml specific deserializer

class cyclonedx.model.definition.Requirement(*, bom_ref: str | cyclonedx.model.bom_ref.BomRef | None = None, identifier: str | None = None, title: str | None = None, text: str | None = None, descriptions: collections.abc.Iterable[str] | None = None, open_cre: collections.abc.Iterable[CreId] | None = None, parent: str | cyclonedx.model.bom_ref.BomRef | None = None, properties: collections.abc.Iterable[cyclonedx.model.Property] | None = None, external_references: collections.abc.Iterable[cyclonedx.model.ExternalReference] | None = None)

  A requirement comprising a standard.

  Note

  See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.7/json/#definitions_standards_items_requirements

  property identifier: str | None
    Returns:

      The identifier of the requirement.

  property title: str | None
    Returns:

      The title of the requirement.

  property text: str | None
    Returns:

      The text of the requirement.

  property descriptions: SortedSet[str]
    Returns:

      A SortedSet of descriptions of the requirement.

  property open_cre: SortedSet[CreId]

    CRE is a structured and standardized framework for uniting security standards and guidelines. CRE links each section of a resource to a shared topic identifier (a Common Requirement). Through this shared topic link, all resources map to each other. Use of CRE promotes clear and unambiguous communication among stakeholders.

    Returns:

      The Common Requirements Enumeration (CRE) identifier(s). CREs must match regular expression: ^CRE:[0-9]+-[0-9]+$

  property parent: cyclonedx.model.bom_ref.BomRef | None
    Returns:

      The optional bom-ref to a parent requirement. This establishes a hierarchy of requirements. Top-level requirements must not define a parent. Only child requirements should define parents.

  property properties: SortedSet[Property]

    Provides the ability to document properties in a key/value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions.

    Return:

      Set of Property

  property external_references: SortedSet[ExternalReference]

    Provides the ability to document external references related to the component or to the project the component describes.

    Returns:

      Set of ExternalReference

  property bom_ref: cyclonedx.model.bom_ref.BomRef

    An optional identifier which can be used to reference the requirement elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.

    Returns:

      BomRef

class cyclonedx.model.definition.Level(*, bom_ref: str | cyclonedx.model.bom_ref.BomRef | None = None, identifier: str | None = None, title: str | None = None, description: str | None = None, requirements: collections.abc.Iterable[str | cyclonedx.model.bom_ref.BomRef] | None = None)

  Level of compliance for a standard.

  Note

  See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.7/json/#definitions_standards_items_levels

  property identifier: str | None
    Returns:

      The identifier of the level.

  property title: str | None
    Returns:

      The title of the level.

  property description: str | None
    Returns:

      The description of the level.

  property requirements: SortedSet[BomRef]
    Returns:

      A SortedSet of requirements associated with the level.

  property bom_ref: cyclonedx.model.bom_ref.BomRef

    An optional identifier which can be used to reference the level elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.

    Returns:

      BomRef

class cyclonedx.model.definition.Standard(*, bom_ref: str | cyclonedx.model.bom_ref.BomRef | None = None, name: str | None = None, version: str | None = None, description: str | None = None, owner: str | None = None, requirements: collections.abc.Iterable[Requirement] | None = None, levels: collections.abc.Iterable[Level] | None = None, external_references: collections.abc.Iterable[cyclonedx.model.ExternalReference] | None = None)

  A standard of regulations, industry or organizational-specific standards, maturity models, best practices, or any other requirements.

  Note

  See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.7/xml/#type_standard

  property name: str | None
    Returns:

      The name of the standard

  property version: str | None
    Returns:

      The version of the standard

  property description: str | None
    Returns:

      The description of the standard

  property owner: str | None
    Returns:

      The owner of the standard, often the entity responsible for its release.

  property requirements: SortedSet[Requirement]
    Returns:

      A SortedSet of requirements comprising the standard.

  property levels: SortedSet[Level]
    Returns:

      A SortedSet of levels associated with the standard. Some standards have different levels of compliance.

  property external_references: SortedSet[ExternalReference]
    Returns:

      A SortedSet of external references associated with the standard.

  property bom_ref: cyclonedx.model.bom_ref.BomRef

    An optional identifier which can be used to reference the standard elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.

    Returns:

      BomRef

class cyclonedx.model.definition.Definitions(*, standards: collections.abc.Iterable[Standard] | None = None)

  The repository for definitions

  Note

  See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.7/xml/#type_definitionsType

  property standards: SortedSet[Standard]
    Returns:

      A SortedSet of Standards