有人使用过fusion table API中的importRows()函数吗? 作为以下API参考, https://developers.google.com/fusiontables/docs/v1/reference/table/importRows 我必须在请求正文中提供CSV数据。 但是对于html主体我该怎么做呢?在
我的代码:
http = getAuthorizedHttp()
DISCOVERYURL = 'https://www.googleapis.com/discovery/v1/apis/{api}/{apiVersion}/rest'
ftable = build('fusiontables', 'v1', discoveryServiceUrl=DISCOVERYURL, http=http)
body = create_ft(CSVFILE,"title here") # the function to load csv file and create the table with columns from csv file.
result = ftable.table().insert(body=body).execute()
print result["tableId"] # good, I have got the id for new created table
# I have no idea how to go on here..
f = ftable.table().importRows(tableId=result["tableId"])
f.body = ?????????????
f.execute()
我终于解决了我的问题,我的代码可以在下面的链接中找到。 https://github.com/childnotfound/parser/blob/master/uploader.py
我这样解决了这个问题:
相关问题 更多 >
编程相关推荐