3

Fusion テーブル 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()
4

2 に答える 2

1

最終的に問題を修正しました。コードは次のリンクにあります。 https://github.com/childnotfound/parser/blob/master/uploader.py

于 2012-12-28T16:35:45.533 に答える