Skip to content
Snippets Groups Projects
Commit 61a0c3d0 authored by Geneviève Boucher's avatar Geneviève Boucher
Browse files

Adding method to retrieve dataset id by name and to look for datasets by name

(in available datasets)
parent 8c5ba6b3
No related branches found
No related tags found
Loading
......@@ -123,6 +123,14 @@ class Client:
df.index.name = 'ID'
return df
""" Get DatasetId by name"""
def get_dataset_id_by_name(self, name):
return self.datasets.loc[self.datasets.dataset_name==name,'dataset_slug'][0]
""" Get a subset of the available datasets for which name match a given term """
def search_dataset_names(self, term):
return self.datasets.loc[self.datasets.dataset_name.str.contains(term),:]
""" Download file according to file_id """
def dwnl_file_content(self, file_id, folder_out='', filename=''):
folder_out = folder_out if folder_out and folder_out[0] == '/' else os.path.join(os.getcwd(), folder_out)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment