betty.license.licenses module - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.license.licenses module

Provide `betty.license.License` plugins.

class betty.license.licenses.AllRightsReserved

  Bases: `ShorthandPluginBase`, `License`

  A license that does not permit the public any rights.

  property summary: Localizable

    The license summary.

  property text: Localizable

    The full license text.

class betty.license.licenses.PublicDomain

  Bases: `ShorthandPluginBase`, `License`

  A work is in the public domain <https://en.wikipedia.org/wiki/Public_domain>.

  property summary: Localizable

    The license summary.

  property text: Localizable

    The full license text.

class betty.license.licenses.SpdxLicenseRepository

  Bases: `PluginRepository`[`License`]

  Provide licenses from the SPDX License List.

  This is thread-safe, which means you can safely use this between different threads.

  SPDX_VERSION = '3.25.0'
  URL = 'https://github.com/spdx/license-list-data/archive/refs/tags/v3.25.0.tar.gz'
  __init__(*, fetcher: Fetcher, localizer: Localizer, binary_file_cache: BinaryFileCache, process_pool: Executor, factory: Factory | None = None, manager: SyncManager | None = None)
  async get(plugin_id: str) → type[License]

    Get a single plugin by its ID.

    Raises:

      PluginNotFound – if no plugin can be found for the given ID.

  async license_id_to_spdx_license_id(license_id: str) → str

    Get the SPDX license ID for the given Betty license plugin ID.

betty.license.licenses.spdx_license_id_to_license_id(spdx_license_id: str) → str

  Get the Betty license plugin ID for the given SPDX license ID.