我正在使用通用的 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.
但它仍然没有给我任何东西。
我已经尝试了示例中的代码
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 查询,如何向表中插入行?你能解释一下那一刻吗?