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

Function get_keywords

src/packagedcode/pypi.py:1999–2018  ·  view source on GitHub ↗

Return a list of keywords found in a ``metainfo`` object or mapping.

(metainfo)

Source from the content-addressed store, hash-verified

1997
1998
1999def get_keywords(metainfo):
2000 """
2001 Return a list of keywords found in a ``metainfo`` object or mapping.
2002 """
2003 keywords = []
2004 kws = get_attribute(metainfo, 'Keywords') or []
2005 if kws:
2006 if isinstance(kws, str):
2007 kws = kws.split(',')
2008 elif isinstance(kws, (list, tuple)):
2009 pass
2010 else:
2011 kws = [repr(kws)]
2012 kws = [k.strip() for k in kws if k and k.strip()]
2013 keywords.extend(kws)
2014
2015 # we are calling this again and ignoring licenses
2016 _, other_classifiers = get_classifiers(metainfo)
2017 keywords.extend(other_classifiers)
2018 return keywords
2019
2020
2021def get_parties(

Callers 6

parseMethod · 0.85
parseMethod · 0.85
parseMethod · 0.85
parse_metadataFunction · 0.85
parseMethod · 0.85
parseMethod · 0.85

Calls 3

get_attributeFunction · 0.85
get_classifiersFunction · 0.85
splitMethod · 0.45

Tested by

no test coverage detected