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

Function add_url

src/packagedcode/pypi.py:2598–2607  ·  view source on GitHub ↗

Add ``_url`` to ``urls`` as _``_attribute`` or to ``extra_data`` as ``_utype`` if already defined or no ``_attribute`` is provided.

(_url, _utype=None, _attribute=None)

Source from the content-addressed store, hash-verified

2596 urls = get_pypi_urls(name, version)
2597
2598 def add_url(_url, _utype=None, _attribute=None):
2599 """
2600 Add ``_url`` to ``urls`` as _``_attribute`` or to ``extra_data`` as
2601 ``_utype`` if already defined or no ``_attribute`` is provided.
2602 """
2603 if _url:
2604 if _attribute and _attribute not in urls:
2605 urls[_attribute] = _url
2606 elif _utype:
2607 extra_data[_utype] = _url
2608
2609 # get first as this is the most common one
2610 homepage_url = (

Callers 1

get_urlsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected