def chef_api_url(name, version, registry='https://supermarket.chef.io/api/v1'):
    """
    Return a package API data URL given a name, version and a base registry URL.

    For example:
    >>> c = chef_api_url('seven_zip', '1.0.4')
    >>> assert c == u'https://supermarket.chef.io/api/v1/cookbooks/seven_zip/versions/1.0.4'
    """
    registry = registry.rstrip('/')
    return '{registry}/cookbooks/{name}/versions/{version}'.format(**locals())
