Skip to content

Commit 59a8d20

Browse files
committed
add ds_get_dict
this function gets a data set from domo and returns it as a list of dictionaries.
1 parent 89e018b commit 59a8d20

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pydomo/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from io import StringIO
1818
import logging
1919
import json
20+
import csv
2021

2122
DOMO = """####################################################################################################
2223
####################################################################################################
@@ -205,6 +206,12 @@ def ds_get(self, dataset_id):
205206
pass
206207

207208
return df
209+
210+
def ds_get_dict(self,ds_id):
211+
my_data = self.datasets.data_export(ds_id,True)
212+
dr = csv.DictReader(StringIO(my_data))
213+
data_list = list(dr)
214+
return(data_list)
208215

209216
def ds_create(self, df_up, name, description='',
210217
update_method='REPLACE', key_column_names=[]):

0 commit comments

Comments
 (0)