bridge.services.spdx.spdx_ingestor module

bridge.services.spdx.spdx_ingestor module#

Async client for the SPDX license list. Fetches a license by SPDX identifier and returns the full JSON payload, including the canonical license text.

class bridge.services.spdx.spdx_ingestor.SPDXLicenseIngestor(spdx_id)[source]#

Bases: Ingestor

Ingest license metadata from the SPDX license list by SPDX identifier.

This client fetches the JSON representation of a single license from the SPDX license list, which includes the canonical license text (licenseText), name, and other metadata.

Parameters:

spdx_id (str) – SPDX license identifier (e.g. "MIT", "GPL-3.0-only").

async fetch()[source]#

Fetch the SPDX license record for the specified SPDX identifier.

Returns:

JSON metadata for the SPDX license, including at least licenseId, name, and licenseText fields.

Return type:

dict

Raises:
  • SPDXLicenseNotFoundError – If the SPDX service does not return a valid license record.

  • httpx.RequestError, httpx.HTTPStatusError – For network/HTTP issues.

exception bridge.services.spdx.spdx_ingestor.SPDXLicenseNotFoundError[source]#

Bases: Exception

Raised when no SPDX license matches the given SPDX identifier.