Skip to content
Snippets Groups Projects
Commit 55c790a3 authored by LouisGendron's avatar LouisGendron
Browse files

Merge branch '10-get-dataset-id-by-dataset-name-and-search-datasets-names' into 'master'

Resolve "Get dataset id by dataset name and search datasets names"

Closes #10

See merge request !9
parents 8c5ba6b3 61a0c3d0
No related branches found
No related tags found
1 merge request!9Resolve "Get dataset id by dataset name and search datasets names"
...@@ -123,6 +123,14 @@ class Client: ...@@ -123,6 +123,14 @@ class Client:
df.index.name = 'ID' df.index.name = 'ID'
return df 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 """ """ Download file according to file_id """
def dwnl_file_content(self, file_id, folder_out='', filename=''): 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) 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