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

Function recognize_package_data

src/packagedcode/recognize.py:45–68  ·  view source on GitHub ↗

Return a list of Package objects if any package_data were recognized for this `location`, or None if there were no Packages found. Raises Exceptions on errors. Include ``application`` packages (such as pypi) and/or ``system`` packages. Default to use application packages

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

Source from the content-addressed store, hash-verified

43
44
45def recognize_package_data(
46 location,
47 application=True,
48 system=False,
49 compiled=False,
50 package_only=False,
51):
52 """
53 Return a list of Package objects if any package_data were recognized for
54 this `location`, or None if there were no Packages found. Raises Exceptions
55 on errors.
56 Include ``application`` packages (such as pypi) and/or ``system`` packages.
57 Default to use application packages
58 """
59 if not filetype.is_file(location):
60 return []
61
62 return list(_parse(
63 location=location,
64 application=application,
65 system=system,
66 compiled=compiled,
67 package_only=package_only,
68 ))
69
70
71def _parse(

Calls 1

_parseFunction · 0.70