Base Dataset Engine Reference

Last Updated: January 19, 2015

All DatasetEngine object provide a minimum set of methods for interacting with datasets and resources. Specifically, the methods allow the standard CRUD operations (Create, Read, Update, Delete) for both datasets and resources.

All DatasetEngine methods return a dictionary, often called the Response dictionary. The Response dictionary contains an item named 'success' that contains a boolean indicating whether the operation was successful or not. If 'success' is True, then the the dictionary will also have an item named 'result' that contains the result of the operation. If 'success' is False, then the Response dictionary will contain an item called 'error' with information about what went wrong.

The following reference provides a summary of the base methods and properties provided by all DatasetEngine objects.

Properties

DatasetEngine. endpoint (string): URL for the dataset service API endpoint.

DatasetEngine. apikey (string, optional): API key may be used for authorization.

DatasetEngine. username (string, optional): Username key may be used for authorization.

DatasetEngine. password (string, optional): Password key may be used for authorization.

DatasetEngine. type (string, readonly): Identifies the type of DatasetEngine object.

Create Methods

abstract DatasetEngine.create_dataset(name, **kwargs)

Create a new dataset.

Parameters
  • name (string) -- Name of the dataset to create.

  • **kwargs (kwargs, optional) -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)

abstract DatasetEngine.create_resource(dataset_id, url=None, file=None, **kwargs)

Create a new resource.

Parameters
  • dataset_id (string) -- Identifier of the dataset to which the resource will be added.

  • url (string, optional) -- URL of resource to associate with resource.

  • file (string, optional) -- Path of file to upload as resource.

  • **kwargs (kwargs, optional) -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)

Read Methods

abstract DatasetEngine.get_dataset(dataset_id, **kwargs)

Retrieve a dataset object.

Parameters
  • dataset_id (string) -- Identifier of the dataset to retrieve.

  • **kwargs (kwargs, optional) -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)

abstract DatasetEngine.get_resource(resource_id, **kwargs)

Retrieve a resource object.

Parameters
  • resource_id (string) -- Identifier of the dataset to retrieve.

  • **kwargs (kwargs, optional) -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)

abstract DatasetEngine.search_datasets(query, **kwargs)

Search for datasets that match a query.

Parameters
  • query (dict) -- Key value pairs representing the fields and values of the datasets to be included.

  • **kwargs -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)

abstract DatasetEngine.search_resources(query, **kwargs)

Search for resources that match a query.

Parameters
  • query (dict) -- Key value pairs representing the fields and values of the resources to be included.

  • **kwargs (kwargs, optional) -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)

abstract DatasetEngine.list_datasets(**kwargs)

List all datasets available from the dataset service.

Parameters

**kwargs (kwargs, optional) -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)

Update Methods

abstract DatasetEngine.update_dataset(dataset_id, **kwargs)

Update an existing dataset.

Parameters
  • dataset_id (string) -- Identifier of the dataset to update.

  • **kwargs (kwargs, optional) -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)

abstract DatasetEngine.update_resource(resource_id, url=None, file=None, **kwargs)

Update an existing resource.

Parameters
  • resource_id (string) -- Identifier of the resource to update.

  • url (string) -- URL of resource to associate with resource.

  • file (string) -- Path of file to upload as resource.

  • **kwargs (kwargs, optional) -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)

Delete Methods

abstract DatasetEngine.delete_dataset(dataset_id, **kwargs)

Delete a dataset.

Parameters
  • dataset_id (string) -- Identifier of the dataset to delete.

  • **kwargs (kwargs, optional) -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)

abstract DatasetEngine.delete_resource(resource_id, **kwargs)

Delete a resource.

Parameters
  • resource_id (string) -- Identifier of the resource to delete.

  • **kwargs (kwargs, optional) -- Any number of additional keyword arguments.

Returns

Response dictionary

Return type

(dict)