Пример #1
0
def fetchResourceData(dataset_id):
    '''
  Fetch resource information from datasets.

  '''
    #
    # Creates a dataset instance
    # and collects an array with the
    # resource ids.
    #
    d = Dataset(dataset_id)
    d.info()
    resources = d.resources()
    resource_data = []
    for resource in resources:
        data = {
            k: Resource(resource).info()[k]
            for k in _fields(config, 'resources')
        }
        resource_data.append(data)

    #
    # Selects only the fields
    # of interest from the dictionary.
    #
    return resource_data
def fetchResourceData(dataset_id):
  '''
  Fetch resource information from datasets.

  '''
  #
  # Creates a dataset instance
  # and collects an array with the
  # resource ids.
  #
  d = Dataset(dataset_id)
  d.info()
  resources = d.resources()
  resource_data = []
  for resource in resources:
    data = { k: Resource(resource).info()[k] for k in _fields(config, 'resources') }
    resource_data.append(data)

  #
  # Selects only the fields
  # of interest from the dictionary.
  #
  return resource_data