safir.metadata.get_project_url(meta: Message, label: str) → Optional[str]

Get a specific URL from the project_urls key of a package’s metadata.

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

  • label (str) –

    The URL’s label. Consider the follow snippet of a setup.cfg file:

    project_urls =
        Change log =
        Source code =
        Issue tracker =

    To get the URL, the label is Source code.


url – 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 code")