python etl库
bamboo-lib的Python项目详细描述
竹子
竹子是一个库,旨在促进创建提取、转换和加载(etl)数据管道的过程。bamboo包含许多功能,如下载和缓存http资产、从远程服务器复制文件、在远程服务器上运行命令、处理压缩的存档、执行大容量数据库摄取等。
安装
pip install bamboo-lib
其他步骤
如果需要使用分布式锁定功能,则需要安装 一些附加软件。以下是MacOS的说明
在MacOS上安装Sherlock。
brew install libmemcached
pip install pylibmc --install-option="--with-libmemcached=/usr/local/Cellar/libmemcached/1.0.18_2"
pip install sherlock
运行测试
要运行测试,只需运行:
pytest
或者,如果要显示运行的所有日志/打印语句:
pytest -s
配置
要更改bamboo将存储http下载的默认文件夹,请设置BAMBOO_DOWNLOAD_FOLDER
环境变量。默认情况下,下载将转到/tmp
。
若要更改默认记录器设置,请将BAMBOO_LOGGER_CONF
设置为指向日志配置文件(请参阅example/logging.conf
中的示例)。
故障排除提示
macos上的多处理问题
如果您在High Sierra或更高版本上运行,并出现如下错误:
objc[30911]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug
尝试设置:
exportOBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES