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

Function get_classifiers

src/packagedcode/pypi.py:1974–1996  ·  view source on GitHub ↗

Return a two tuple of lists of (license_classifiers, other_classifiers) found in a ``metainfo`` object or mapping.

(metainfo)

Source from the content-addressed store, hash-verified

1972
1973
1974def get_classifiers(metainfo):
1975 """
1976 Return a two tuple of lists of (license_classifiers, other_classifiers)
1977 found in a ``metainfo`` object or mapping.
1978 """
1979
1980 classifiers = (
1981 get_attribute(metainfo, 'Classifier', multiple=True)
1982 or get_attribute(metainfo, 'Classifiers', multiple=True)
1983 or get_attribute(metainfo, 'classifiers', multiple=True)
1984 )
1985 if not classifiers:
1986 return [], []
1987
1988 license_classifiers = []
1989 other_classifiers = []
1990 for classifier in classifiers:
1991 if classifier:
1992 if classifier.startswith('License'):
1993 license_classifiers.append(classifier)
1994 else:
1995 other_classifiers.append(classifier)
1996 return license_classifiers, other_classifiers
1997
1998
1999def get_keywords(metainfo):

Callers 2

get_declared_licenseFunction · 0.85
get_keywordsFunction · 0.85

Calls 2

get_attributeFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected