【问题标题】:service = build("fusiontables", "v1", http=http) cannot get to workservice = build("fusiontables", "v1", http=http) 无法开始工作
【发布时间】: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


    【解决方案1】:

    http://code.google.com/p/fusion-tables-client-python/有一个更简单的专门Fusion Table Client python代码我已经成功使用了。

    【讨论】:

    • 谢谢。我后来发现了这个库,然后是 google-api-python-client,所以我决定让 google-api 工作。)但似乎我毕竟会使用 fusion-tables-client。
    • 我试过那个库。它不是很好,因为它缺乏服务帐户的支持。(
    猜你喜欢
    • 1970-01-01
    • 2016-06-21
    • 2018-10-29
    • 2011-10-27
    • 2016-05-06
    • 2016-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多