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

Function fetch_dejacode_packages

etc/scripts/utils_dejacode.py:40–55  ·  view source on GitHub ↗

Return a list of package data mappings calling the package API with using `params` or an empty list.

(params)

Source from the content-addressed store, hash-verified

38
39
40def fetch_dejacode_packages(params):
41 """
42 Return a list of package data mappings calling the package API with using
43 `params` or an empty list.
44 """
45 if not can_do_api_calls():
46 return []
47
48 response = requests.get(
49 DEJACODE_API_URL_PACKAGES,
50 params=params,
51 headers=DEJACODE_API_HEADERS,
52 timeout=10,
53 )
54
55 return response.json()["results"]
56
57
58def get_package_data(distribution):

Callers 2

get_package_dataFunction · 0.85

Calls 2

can_do_api_callsFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected