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

Function get_parties

src/packagedcode/pypi.py:2021–2056  ·  view source on GitHub ↗

Return a list of parties found in a ``metainfo`` object or mapping. Uses the provided keys with a default to key names used in METADATA. setup.py and setup.cfg use lower case valid Python identifiers instead.

(
    metainfo,
    author_key='Author',
    author_email_key='Author-email',
    maintainer_key='Maintainer',
    maintainer_email_key='Maintainer-email',
)

Source from the content-addressed store, hash-verified

2019
2020
2021def get_parties(
2022 metainfo,
2023 author_key='Author',
2024 author_email_key='Author-email',
2025 maintainer_key='Maintainer',
2026 maintainer_email_key='Maintainer-email',
2027):
2028 """
2029 Return a list of parties found in a ``metainfo`` object or mapping.
2030 Uses the provided keys with a default to key names used in METADATA.
2031 setup.py and setup.cfg use lower case valid Python identifiers instead.
2032 """
2033 parties = []
2034
2035 author = get_attribute(metainfo, author_key)
2036
2037 author_email = get_attribute(metainfo, author_email_key)
2038 if author or author_email:
2039 parties.append(models.Party(
2040 type=models.party_person,
2041 name=author or None,
2042 role='author',
2043 email=author_email or None,
2044 ))
2045
2046 maintainer = get_attribute(metainfo, maintainer_key)
2047 maintainer_email = get_attribute(metainfo, maintainer_email_key)
2048 if maintainer or maintainer_email:
2049 parties.append(models.Party(
2050 type=models.party_person,
2051 name=maintainer or None,
2052 role='maintainer',
2053 email=maintainer_email or None,
2054 ))
2055
2056 return parties
2057
2058
2059def get_setup_parties(setup_kwargs):

Callers 3

parse_metadataFunction · 0.70
parseMethod · 0.70
get_setup_partiesFunction · 0.70

Calls 2

get_attributeFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected