import json


def get_pkg_name(index_json):
    """ Return a conda package name from a index.json file. """
    with open(index_json, 'rb') as f:
        info = json.load(f)
    pkg_name = '{name}-{version}-{build}.tar.bz2'.format(**info)
    return pkg_name