def parse_wheel_name(filename):
    """
    Parse the filename of a wheel and return the information as dict.
    """
    if not filename.endswith(".whl"):
        raise WheelError("PEP427 violation: wheels need to end with '.whl'")
    else:
        filename = filename[:-4]
    splitted = filename.split("-")
    distribution = splitted[0]
    version = splitted[1]
    if len(splitted) == 6:
        build_tag = splitted[2]
        python_tag = splitted[3]
        abi_tag = splitted[4]
        platform_tag = splitted[5]
    elif len(splitted) == 5:
        build_tag = None
        python_tag = splitted[2]
        abi_tag = splitted[3]
        platform_tag = splitted[4]
    else:
        raise WheelError("PEP427 violation: invalid naming schema")
    return {
        "distribution": distribution,
        "version": version,
        "build_tag": build_tag,
        "python_tag": python_tag,
        "abi_tag": abi_tag,
        "platform_tag": platform_tag,
    }

    Parse the filename of a wheel and return the information as dict.
    
lib/stashutils/wheels.py