# cyclonedx.contrib.license.factories

License related factories

## Classes

`LicenseFactory` | Factory for `cyclonedx.model.license.License`.

## Module Contents

class cyclonedx.contrib.license.factories.LicenseFactory

  Factory for `cyclonedx.model.license.License`.

  make_from_string(value: str, *, license_text: cyclonedx.model.AttachedText | None = None, license_url: cyclonedx.model.XsUri | None = None, license_acknowledgement: cyclonedx.model.license.LicenseAcknowledgement | None = None) → cyclonedx.model.license.License

    Make a `cyclonedx.model.license.License` from a string.

  make_with_expression(expression: str, *, acknowledgement: cyclonedx.model.license.LicenseAcknowledgement | None = None) → cyclonedx.model.license.LicenseExpression

    Make a `cyclonedx.model.license.LicenseExpression` with a compound expression.

    Utilizes `cyclonedx.spdx.is_expression()`.

    Raises:

      InvalidLicenseExpressionException – if param value is not known/supported license expression

  make_with_id(spdx_id: str, *, text: cyclonedx.model.AttachedText | None = None, url: cyclonedx.model.XsUri | None = None, acknowledgement: cyclonedx.model.license.LicenseAcknowledgement | None = None) → cyclonedx.model.license.DisjunctiveLicense

    Make a `cyclonedx.model.license.DisjunctiveLicense` from an SPDX-ID.

    Raises:

      InvalidSpdxLicenseException – if param spdx_id was not known/supported SPDX-ID

  make_with_name(name: str, *, text: cyclonedx.model.AttachedText | None = None, url: cyclonedx.model.XsUri | None = None, acknowledgement: cyclonedx.model.license.LicenseAcknowledgement | None = None) → cyclonedx.model.license.DisjunctiveLicense

    Make a `cyclonedx.model.license.DisjunctiveLicense` with a name.