from typing import Dict
import pkg_resources


def get_pip_packages() -> Dict[str, str]:
    """
    Returns a dictionary of pip packages names and their versions. Similar
    to `$ pip freeze`
    """
    return {
        package.project_name: package.version
        for package in pkg_resources.working_set
    }