Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将JSON解析为Google电子表格Python_Python_Json_Google Apps Script_Google Sheets - Fatal编程技术网

将JSON解析为Google电子表格Python

将JSON解析为Google电子表格Python,python,json,google-apps-script,google-sheets,Python,Json,Google Apps Script,Google Sheets,我正在尝试将ShapeShift API中的Pairs信息调用到Google电子表格中 我呼吁: 它应该返回类似以下内容的JSON: [ { "rate": "787.32227488", "limit": 0.74761076, "pair": "BTC_ICN", "maxLimit": 0.93451345, "min": 0.0004924, "minerFee": 0.2 }, { "rate": "0.00122699",

我正在尝试将ShapeShift API中的Pairs信息调用到Google电子表格中

我呼吁:

它应该返回类似以下内容的JSON:

[
{
    "rate": "787.32227488",
    "limit": 0.74761076,
    "pair": "BTC_ICN",
    "maxLimit": 0.93451345,
    "min": 0.0004924,
    "minerFee": 0.2
},
{
    "rate": "0.00122699",
    "limit": 607.31986909,
    "pair": "ICN_BTC",
    "maxLimit": 759.14983636,
    "min": 3.15955766,
    "minerFee": 0.002
},
{
    "rate": "57.83625391",
    "limit": 0.74761076,
    "pair": "BTC_MLN",
    "maxLimit": 0.93451345,
    "min": 0.000102,
    "minerFee": 0.003
}
我希望数据以这种方式填充我的电子表格:

费率限制对maxLimit min Miner费用 ... ... ... .... ... ...

以下是我迄今为止的情况:

类数据(ShapeShiftAPI): def初始化(自身):

如果我这样做:打印(self.return\u shapeshift\u pairs\u info())

它返回所有可用的变形硬币和符号

但我可以将其更新到我的谷歌电子表格中。我需要帮助如何把数据送到正确的单元格

谢谢大家!

    ShapeShiftAPI.__init__(self)

    scope = ['https://spreadsheets.google.com/feeds']
    credentials = ServiceAccountCredentials.from_json_keyfile_name('config.json', scope)
    gc = gspread.authorize(credentials)

    wks = gc.open("data_test").sheet1

    cell_list = wks.range('A1')
    data = self.return_shapeshift_pairs_info()
    obj = json.loads(data)

    for cell in cell_list:
        cell.value = data
    wks.update_cells(cell_list)

 if __name__ == '__main__':
     app = Data()