用于向googleapi进行身份验证的pydata帮助程序
pydata-google-auth的Python项目详细描述
pydata google auth是一个包,提供用于向google api进行身份验证的帮助程序。
安装
通过conda
安装最新版本$ conda install pydata-google-auth --channel conda-forge
通过pip
安装最新版本$ pip install pydata-google-auth
安装最新开发版本
$ pip install git+https://github.com/pydata/pydata-google-auth.git
用法
使用pydata_google_auth.get_user_credentials()函数 使用用户凭据对googleapi进行身份验证
importpydata_google_authcredentials=pydata_google_auth.get_user_credentials(['https://www.googleapis.com/auth/cloud-platform'],)# Use the credentials in other libraries, such as the Google BigQuery# client library.fromgoogle.cloudimportbigqueryclient=bigquery.Client(project='YOUR-PROJECT-ID',credentials=credentials)
有关详细信息,请参见pydata-google-auth documentation