def METHOD_NAME(name, optional=False):
    """
    Return module object.
    On error raises verbose exception with name and URL.
    """
    try:
        package = metadata(name)
    except PackageNotFoundError as exc:
        if optional:
            return None
        raise ImproperlyConfigured(
            f"Missing dependency {name}, please install using: pip install {name}"
        ) from exc
    url = package.get("Home-page")
    if url is None:
        for project_url in package.get_all("Project-URL"):
            name, current_url = project_url.split(",", 1)
            if name.lower().strip() == "homepage":
                url = current_url.strip()
                break
    if url is None:
        url = f"https://pypi.org/project/{name}/"
    return (
        package.get("Name"),
        url,
        package.get("Version"),
    )