def format_pkg_data(master_package_data: list):
    """ Format and parse the reponse from pypi.org so we can build a dictionary of needed data for
    each package. Example response string (pkg_data variable below) looks like this:
    b'    <a href="https://files.pythonhosted.org/packages/9f/a5/eec74d8d1016e6c2042ba31ca6fba3bb
    a520e27d8a061e82bccd36bd64ef/docker-4.4.1-py2.py3-none-any.whl#sha256=e455fa49aabd4f22da9f4e1
    c1f9d16308286adc60abaf64bf3e1feafaed81d06" data-requires-python="&gt;=2.7, !=3.0.*, !=3.1.*,
    !=3.2.*, !=3.3.*, !=3.4.*">docker-4.4.1-py2.py3-none-any.whl</a><br/>' """
    formatted_package_data = []
    for pkg_dict in master_package_data:
        filename = pkg_dict['filename']
        pkg_data = pkg_dict['pkg_data']

        pkg_url_and_sha = pkg_data.split('"')[1]
        pkg_sha_with_extra_characters = pkg_url_and_sha.split('#')[1]

        pkg_sha = pkg_sha_with_extra_characters.split('=')[1]
        pkg_url = pkg_url_and_sha.split('#')[0]
        sha_type = "sha256"
        formatted_pkg = {
            'pkg_filename': filename,
            'pkg_url': pkg_url,
            'pkg_sha': pkg_sha,
            'sha_type': sha_type
        }
        formatted_package_data.append(formatted_pkg)
    return formatted_package_data