生成ckan数据存储表,根据表模式描述符加载和提取数据。

tableschema-ckan-datastore的Python项目详细描述


ckan数据存储ckan数据存储库py
==
=






特拉维斯



br/>/>表架构/>;``描述符。


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

代码::bash

pip install tableschema ckan datastore


examples
~~~~~~~~~

本自述文件中的代码示例需要python 3.3+解释器。您可以在
examples<;https://github.com/frictionlessdata/tableschema ckan datastore py/tree/master/examples>;` `docs.io/en/latest/maintaining/datastore.html\ckanext.datastore.logic.action.datastore\u upsert>;`\uu
使用"upsert"方法。这需要由"表架构主键"属性lt;https://specs.frictionlessdata.io/table schema/"主键"属性定义的数据中的唯一键
。如果数据有主键,则可以使用"table.save"方法:

。代码::python


from tableschema import table

/>
table=table('data.csv',schema='schema.json')\data.csv有主键
table.save(resource戥id,
storage='ckan戥u datastore',
base戥url=base戥url,
dataset戥id=dataset戥id,
api戥key=api戥key)

d要定义用于将数据保存到数据存储的方法,可以直接创建"tableschema.storage"对象,并指定要使用的
方法参数:

。代码::python

import io
import json
from tabletor import stream
from tableschema import storage

taset_id='测试数据集-010203'
api_key='我的ckan用户api key'

data=stream('data.csv',headers=1)。open()

storage=storage.connect('ckan_datastore',
base_url=基本URL,
数据集ID=数据集ID,
API密钥=API密钥
存储。创建(资源ID,架构,强制=真))
存储。写入(资源ID,数据,方法='insert');指定数据存储的upsert方法

文档
——

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

~~~~~~~


package实现"tabular
storage<;https://github.com/frictionlessdata/tableschema py\storage>;``uu
接口(请参阅完整文档链接上的地址:






>这个驱动程序提供了一个附加的api:

``存储(基库URL,数据集ID=none,API密钥=none)` ` ` `
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^对于ckan实例
(e.g.http://demo.ckan.org)。
-``数据集id(str)``-我们希望使用
作为bucket源的ckan数据集的id或名称。如果缺少,则使用数据存储中的所有表。
-``api_key(str)``-ckan user api key,或者,如果格式为
``env:ckan_api_key_name```,则使用定义api key的env var。

kfn/编码标准>;``创建并激活项目


代码:bash

$make test

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


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

。代码::bash

$pylama--sort<;path>;

针对python 2环境的测试,
详细程度增加。
`--``之后的所有位置参数和选项都将传递给
``py.test`:

代码::bash

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

此软件包仅在tox
环境中可用。此处仅描述了中断和最重要的更改。所有已发布版本的完整
更改日志和文档可以在
格式良好的"提交
历史记录"中找到,https://github.com/frictionlessdata/tableschema ckan datastore py/commits/master>;` `| travis image::https://img.shields.io/travis/friectionlessdata/tableschema ckan datastore py/master.svg
:目标:https://travis ci.org/friectionlessdata/tableschema ckan datastore py
。|工作服图片::http://img.shields.io/covertalls/frictionlessdata/tableschema ckan datastore py/master.svg
:目标:https://covertalls.io/r/frictionlessdata/tableschema-ckan-datastore-py?分支=主
…| pypi image::https://img.shields.io/pypi/v/tableschema ckan datastore.svg
:目标:https://pypi.python.org/pypi/tableschema ckan datastore
。| 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第三方库


热门话题
ByteArrayOutputStream的java解码属性   java S3 SDK在上载时更新单个对象,而不是创建新文件   java hibernate:无法从eclipse连接到DB   java如何在强制转换JComboBox之前检查其类型?   http从Java中的GETPOST请求方法捕获URI、资源名称,如开发人员工具中所示   java在Spring@Bean方法中返回接口的局限性   Java中的Web服务和客户端(使用Eclipse Apache Axis 2自底向上服务)某些代码会引发异常   java spring安全+rest不起作用   java将LinkedList添加到包含LinkedList的LinkedList并更改添加的LinkedList   java是否临时删除对象的属性?   java使用AnimatedGifEncoder类创建的gif图像的部分帧是不透明的   java如何高效地处理maven3时间戳快照?   java向集合对象添加另一项   java如何将动态参数传递给jquery函数   java使用libGdx桌面端口作为Android GLES20的仿真器