Return a list of package data mappings calling the package API with using `params` or an empty list.
(params)
| 38 | |
| 39 | |
| 40 | def 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 | |
| 58 | def get_package_data(distribution): |
no test coverage detected