【发布时间】:2012-06-23 01:09:56
【问题描述】:
我正在使用普通的google-api-python-client 来访问 Fusion Tables API,但无法用它做任何有用的事情。
好吧,我已经阅读了函数的帮助:
service = build("fusiontables", "v1")
help(service)
得到了这个:
class Resource(__builtin__.object)
| A class for interacting with a resource.
|
| Methods defined here:
|
| __init__(self)
|
| column = methodResource(self)
| A collection resource.
|
| query = methodResource(self)
| A collection resource.
|
| style = methodResource(self)
| A collection resource.
|
| table = methodResource(self)
| A collection resource.
|
| template = methodResource(self)
| A collection resource.
但它仍然没有给我任何东西。
我试过sample的代码
f = file('key.p12', 'rb')
key = f.read()
f.close()
credentials = SignedJwtAssertionCredentials(
'...',
key,
scope='https://www.googleapis.com/auth/fusiontables')
http = httplib2.Http()
http = credentials.authorize(http)
service = build("fusiontables", "v1", http=http)
print(service.table().list().execute())
它给了我“{u'kind': u'fusiontables#tableList'}”。
但我仍然不知道如何运行 SQL 查询,如何向表中插入行? 你能解释一下那个时刻吗?
【问题讨论】:
标签: python google-fusion-tables google-api-python-client