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

Function _get_package_data

src/scancode/api.py:259–292  ·  view source on GitHub ↗

Return a mapping of package manifest information detected in the file at ``location``. Include ``application`` packages (such as pypi) and/or ``system`` packages. Note that all exceptions are caught if there are any errors while parsing a package manifest.

(
    location,
    application=True,
    system=False,
    compiled=False,
    package_only=False, 
    **kwargs
)

Source from the content-addressed store, hash-verified

257
258
259def _get_package_data(
260 location,
261 application=True,
262 system=False,
263 compiled=False,
264 package_only=False,
265 **kwargs
266):
267 """
268 Return a mapping of package manifest information detected in the file at ``location``.
269 Include ``application`` packages (such as pypi) and/or ``system`` packages.
270 Note that all exceptions are caught if there are any errors while parsing a
271 package manifest.
272 """
273 assert application or system or compiled or package_only
274 from packagedcode.recognize import recognize_package_data
275 try:
276 return recognize_package_data(
277 location=location,
278 application=application,
279 system=system,
280 compiled=compiled,
281 package_only=package_only,
282 ) or []
283
284 except Exception as e:
285 if TRACE:
286 logger.error(f'_get_package_data: location: {location!r}: Exception: {e}')
287
288 if SCANCODE_DEBUG_PACKAGE_API:
289 raise
290 else:
291 # attention: we are swallowing ALL exceptions here!
292 pass
293
294
295def get_package_info(location, **kwargs):

Callers 2

get_package_infoFunction · 0.85
get_package_dataFunction · 0.85

Calls 2

recognize_package_dataFunction · 0.90
errorMethod · 0.45

Tested by

no test coverage detected