MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / get_license_symbols

Function get_license_symbols

src/packagedcode/alpine.py:1438–1458  ·  view source on GitHub ↗

Return a mapping of {lowercased key: LicenseSymbolLike} where LicenseSymbolLike wraps a License object. This is a combo of the SPDX licenses keys and the Alpine-specific extra symbols.

(extra_licenses)

Source from the content-addressed store, hash-verified

1436
1437
1438def get_license_symbols(extra_licenses):
1439 """
1440 Return a mapping of {lowercased key: LicenseSymbolLike} where
1441 LicenseSymbolLike wraps a License object. This is a combo of the SPDX
1442 licenses keys and the Alpine-specific extra symbols.
1443 """
1444 from licensedcode.cache import get_spdx_symbols
1445 from licensedcode.cache import get_licenses_db
1446
1447 # make a copy
1448 symbols = dict(get_spdx_symbols())
1449 ref_licenses = get_licenses_db()
1450
1451 for alpine_key, license_key in extra_licenses.items():
1452 # check that there are no dupe keys
1453 assert alpine_key not in symbols
1454
1455 lic = ref_licenses[license_key]
1456 symbols[alpine_key] = LicenseSymbolLike(lic)
1457
1458 return symbols
1459
1460
1461def normalize_and_cleanup_declared_license(declared):

Callers 1

Calls 2

get_spdx_symbolsFunction · 0.90
get_licenses_dbFunction · 0.90

Tested by

no test coverage detected