safir.metadata.get_project_url(meta, label)#

Get a specific URL from a package’s project_urls metadata.

  • meta (Message) – The package metadata, as returned by the importlib.metadata.metadata function.

  • label (str) –

    The URL’s label. Consider the follow snippet of a pyproject.toml file:

    Homepage = ""
    Source = ""

    To get the URL, the label is Source.

    Packages using setup.cfg use a different syntax but a similar approach.

    project_urls =
        Change log =
        Source code =
        Issue tracker =

    To get the URL, the label is Source code.


The URL. If the label is not found, the function returns None.

Return type:

str or None


>>> from importlib_metadata import metadata
>>> meta = metadata("safir")
>>> get_project_url(meta, "Source")