import pkg_resources


def pkg_resources_version(package: str) -> str:
    """
    Look up version from current package. This will read from egg folder if not pip installed.
    :param package:
    :return:
    """
    # ref https://stackoverflow.com/questions/7079735/
    # how-do-i-get-the-version-of-an-installed-module-in-python-programatically

    # noinspection PyBroadException
    try:
        return pkg_resources.get_distribution(package).version
    except Exception:
        return "unknown"