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

Function get_package_data

etc/scripts/utils_dejacode.py:58–72  ·  view source on GitHub ↗

Return a mapping of package data or None for a Distribution `distribution`.

(distribution)

Source from the content-addressed store, hash-verified

56
57
58def get_package_data(distribution):
59 """
60 Return a mapping of package data or None for a Distribution `distribution`.
61 """
62 results = fetch_dejacode_packages(distribution.identifiers())
63
64 len_results = len(results)
65
66 if len_results == 1:
67 return results[0]
68
69 elif len_results > 1:
70 print(f"More than 1 entry exists, review at: {DEJACODE_API_URL_PACKAGES}")
71 else:
72 print("Could not find package:", distribution.download_url)
73
74
75def update_with_dejacode_data(distribution):

Callers 4

create_dejacode_packageFunction · 0.70

Calls 1

fetch_dejacode_packagesFunction · 0.85

Tested by

no test coverage detected