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

Function get_license_expression

etc/scripts/utils_thirdparty.py:2284–2297  ·  view source on GitHub ↗

Return a normalized license expression or None.

(declared_licenses)

Source from the content-addressed store, hash-verified

2282
2283
2284def get_license_expression(declared_licenses):
2285 """
2286 Return a normalized license expression or None.
2287 """
2288 if not declared_licenses:
2289 return
2290 try:
2291 from packagedcode.licensing import get_only_expression_from_extracted_license
2292
2293 return get_only_expression_from_extracted_license(declared_licenses)
2294 except ImportError:
2295 # Scancode is not installed, clean and join all the licenses
2296 lics = [python_safe_name(l).lower() for l in declared_licenses]
2297 return " AND ".join(lics).lower()

Callers 1

load_pkginfo_dataMethod · 0.85

Calls 3

python_safe_nameFunction · 0.90
joinMethod · 0.45

Tested by

no test coverage detected