码迷,mamicode.com
首页 > 其他好文 > 详细

Singer 学习六 运行&&开发taps、targets (一 taps 运行说明)

时间:2019-01-09 15:44:47      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:targe   art   install   nes   string   ref   .json   包含   nbsp   

文章内容来来自官方github
说明: singer大部分的taps && targets 是用python编写的,所以内容里面的代码也是使用python 编写

使用python运行singer

运行singer 必须安装python 3.5 以及以上的版本,推荐的方式是使用python 的virtual 环境工具,
实际上也必须使用python的虚拟环境工具,不然好多版本的根本就跑不起来,同时在singer的最佳
实践中,对于singer-python 包的依赖,也推荐使用固定版本的,当然这个也和singer 的架构设计有
关系(类似unix 的pipe,target 对于的数据的处理是通过stdio。。。,后边会有说明)

运行tap

(1). 创建并激活python3的虚拟环境

 
python3 -m venv ~/.virtualenvs/<tap-foo>
source ~/.virtualenvs/<tap-foo>/bin/activate

(2). 安装tap pip 包

pip install <tap-foo>

(3). 创建tap 配置文件
一般为config.json ,里面包含必备的配置以及身份认证信息
(4). 如果tap 支持discovery 模式,运行 --discover 生成catalog 内容

~/.virtualenvs/<tap-foo>/bin/<tap-foo> --config tap_config.json --discover > catalog.json

(5). 根据tap 支持的特性,你可能需要添加一些元数据信息(复制模式,stream 选择的filed )

(6) 以sync 模式运行tap

~/.virtualenvs/<tap-foo>/bin/<tap-foo> --config tap_config.json --catalog catalog.json
 

参考资料

https://github.com/singer-io/getting-started/blob/master/docs/RUNNING_AND_DEVELOPING.md

Singer 学习六 运行&&开发taps、targets (一 taps 运行说明)

标签:targe   art   install   nes   string   ref   .json   包含   nbsp   

原文地址:https://www.cnblogs.com/rongfengliang/p/10244510.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!