def get(name, vendor="pypi", functions={}, _depth=0):
    """
    Tries to find a changelog for the given package.
    :param name: str, package name
    :param vendor: str, vendor
    :param functions: dict, custom functions
    :return: dict, changelog
    """
    fns = _bootstrap_functions(name=name, vendor=vendor, functions=functions)
    session = Session()
    # get meta data for the given package and use this metadata to
    # find urls pointing to a possible changelog
    data = fns["get_metadata"](session=session, name=name)
    releases = fns["get_releases"](name=name, data=data)
    urls, repos = fns["get_urls"](
        session=session,
        name=name,
        data=data,
        releases=releases,
        find_changelogs_fn=fns["find_changelogs"]
    )

    # load the content from the given urls and parse the changelog
    content = fns["get_content"](session=session, urls=urls)
    changelog = fns["parse"](
        name=name,
        content=content,
        releases=releases,
        get_head_fn=fns["get_head"]
    )
    del fns
    if changelog:
        return changelog

    # We could not find any changelogs.
    # Check to see if we can switch vendors.
    new_vendor, new_name = check_switch_vendor(vendor, name, repos,
                                               _depth=_depth)
    if new_vendor and new_vendor != vendor:
        return get(new_name, vendor=new_vendor, functions=functions,
                   _depth=_depth+1)
    return {}
def get ( name , vendor = "pypi" , functions = { } , _depth = 0 ) : fns = _bootstrap_functions ( name = name , vendor = vendor , functions = functions ) session = Session ( ) data = fns [ "get_metadata" ] ( session = session , name = name ) releases = fns [ "get_releases" ] ( name = name , data = data ) urls , repos = fns [ "get_urls" ] ( session = session , name = name , data = data , releases = releases , find_changelogs_fn = fns [ "find_changelogs" ] ) content = fns [ "get_content" ] ( session = session , urls = urls ) changelog = fns [ "parse" ] ( name = name , content = content , releases = releases , get_head_fn = fns [ "get_head" ] ) del fns if changelog : return changelog new_vendor , new_name = check_switch_vendor ( vendor , name , repos , _depth = _depth ) if new_vendor and new_vendor != vendor : return get ( new_name , vendor = new_vendor , functions = functions , _depth = _depth + 1 ) return { }
Tries to find a changelog for the given package.
    :param name: str, package name
    :param vendor: str, vendor
    :param functions: dict, custom functions
    :return: dict, changelog