google_utils.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:measure 作者: okfn 项目源码 文件源码
def get_google_api_service(service_name, service_version, scopes):
    '''Use Google Client API to get a Google API Service.

    :param service_name: the name of requested service, e.g. 'sheets'
    :param service_version: the version of requested service, e.g. 'v4'
    :param scopes: the authentication requested.

    :return: googleapiclient.discovery.Resource Object, tied to google
    service API.
    '''

    try:
        return discovery.build(
            service_name,
            service_version,
            http=get_authorized_http_object(scopes)
        )
    except AttributeError:  # config variables are missing
        # todo: write as real exception
        raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号