{{description}}
datapackage-pipelines-goodtables的Python项目详细描述
一个 datapackage-pipelines 用以验证表格资源的处理器 goodtables。
安装
# clone the repo and install it with pip git clone https://github.com/frictionlessdata/datapackage-pipelines-goodtables.git pip install -e .
用法
在pipeline-spec.yml配置中添加以下内容以验证 数据包中的每个资源。报告被输出到记录器。
...-run:goodtables.validateparameters:fail_on_error:True,reports_path:'path/to/datapackage/reports',# where reports will be writtendatapackage_reports_path:'reports',# relative to datapackage.jsonwrite_report:True,goodtables:<key>:<value># options passed to goodtables.validate()
- fail_on_error:用于确定 验证错误时管道应失败(默认值为True)。
- reports_path:定义goodtables位置的可选字符串 应该写入报告(默认值为reports)。
- datapackage_reports_path:定义路径的可选字符串 相对于datapackage.json(见下面的注释)。
- write_report:用于确定 goodtables验证报告应写入reports_path (默认值为True)。
- goodtables:传递给的可选对象 goodtables.validate()以自定义其行为。见 `goodtables.validate()<;https://github.com/frictionlessdata/goodtables-py/#validatesource-options>;。`_ 可供选择。
如果编写了报告,并且定义了datapackage_reports_path,则 reports属性将添加到数据包中,详细说明 每个资源的报告路径:
..."reports":[{"resource":"my-resource","reportType":"goodtables","path":"path/to/my-resource.json"}]
建议使用datapackage_reports_path来定义 相对路径,来自datapackage.json文件,表示 报告已经写好了。datapackage_reports_path未定义 报告将被写入,但有助于确保定义了正确的路径 在datapackage.json的reports属性中。当 管道以dump_to.path处理器结束。