基于json表模式描述符生成bigquery表,加载和提取数据。

tableschema-bigquer的Python项目详细描述


table schema bigquery py
===


工作服
pypi
gitter

基于"table
schema<;http://specs.frictionlessdata.io/table schema/>生成并加载bigquery表;`_描述符。

features
--


-实现``tableschema.storage``接口

这意味着主要的版本可能会包含破坏性的更改。强烈建议在"设置/要求"文件中指定"包"
版本范围,例如
"包">;=1.0,<;2.0`。

代码::bash

pip安装tableschema bigquery


开始使用google bigquery服务:

-创建新项目-
`link<;https://console.developers.google.com/home/dashboard>;`\br/>-创建服务密钥-
`link<;https://console.developers.google.com/api/credentials>;`您可以在
`examples<;https://github.com/frictionlessdata/tableschema bigquery py/tree/master/examples>;``uuuu
目录中看到更多示例。

代码::python

import io
import os
import json
from tableschema import table
from apiclient.discovery import build
from oauth2client.client import googlecredentials

os.environ['google_application_credentials']='.credentials.json'
credentials=googlecredentials.get_application_default()
service=build('bigquery','v2',credentials=credentials)
project=json.load(io.open('.credentials.json',encoding='utf-8'))['project_id']

#将表加载并保存到bigquery
table=table('data.csv',schema='schema.json')
table.save('data',storage='bigquery',service=service,project=project,dataset='dataset')

文档
----

并遵循
语义版本控制规则。本自述文件之外的所有内容都是私有的
API,可以在不通知任何新版本的情况下进行更改。

~`_
接口(请参阅链接上的完整文档):

前缀="")``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

-``服务(对象)```服务``对象
-``项目(str)``-bigquery项目名称
-``数据集(str)`-bigquery数据集名称
-``前缀(str)`-所有前缀bucket

贡献
----


项目遵循"开放知识国际编码
标准<;https://github.com/okfn/coding standards>;`_.

建议开始的方法是创建并激活项目
虚拟环境。
将包和开发依赖项安装到活动
环境:






$make install

使用linting和coverage运行测试:

。代码:bash

$make test

在这个
阶段,它已经
安装到您的环境中,可以与文档中描述的更多
细粒度控制单独使用-
https://pylama.readthedocs.io/en/latest/


例如,按错误类型对结果排序:

。代码::bash

$pylama--sort<;path>;

已使用。
它已经安装到您的环境中,可以单独使用
并具有文档中所述的更细粒度控制
-https://testrun.org/tox/latest/

详细。
`--``之后的所有位置参数和选项都将传递给
``py.test`:

…代码::bash

tox-e py27--v tests/<;path>;

此软件包仅在tox
环境中可用。此处仅描述了中断和最重要的更改。所有已发布版本的完整
更改日志和文档可以在
格式良好的"提交
历史记录"中找到;https://github.com/frictionlessdata/tableschema bigquery py/commits/master>;` `。

~~~~


初始驱动程序实现。

| travis图像::https://img.shields.io/travis/friectionlessdata/tableschema bigquery py/master.svg
:目标:https://travis ci.org/friectionlessdata/tableschema bigquery py
。|工作服图片:http://img.shields.io/covertalls/frictionlessdata/tableschema-bigquery-py.svg?branch=master
:目标:https://coveralls.io/r/frictionlessdata/tableschema-bigquery-py?分支=主
…| pypi image::https://img.shields.io/pypi/v/tableschema bigquery.svg
:目标:https://pypi.python.org/pypi/tableschema bigquery
。| gitter图像::https://img.shields.io/gitter/room/friectionlessdata/chat.svg
:目标:https://gitter.im/friectionlessdata/chat
。|存储图像::https://i.imgur.com/rqgrxqp.png

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java从类对象访问静态变量   java无法在三星A5上使用Toast(2016年)   java处理阻止图像在选择其他图像时消失   java Install4j Linux应用程序   swing在jpanel form java上具有暂停/恢复按钮   java Log4J登录年份文件夹   java XmlPullParser资源管理   JavaGoogleCloudEndpoints方法总是导致NullPointerException,为什么?   java JSON到带有POJO和Enum的Spring控制器   java制作自定义名称生成器?   java仅在设备屏幕的特定部分显示google地图多段线   java图像没有重新绘制,只是相乘   java如何将格式化字符串转换为浮点?   java无法提前很长时间安排TimerTask   当引用函数::和时,java Intellij IDEA无法解析“和”函数接口方法   java结束了dowhile循环   java Spring路径变量绑定   log4j API中FileAppender中的java问题   java使用QMessageBox从选项列表中进行选择