数据切片工具,用于从一个transmart读取数据并将其上载到另一个transmart

transmart-hyper-dicer的Python项目详细描述


Build statuscodecovPyPIPyPI - Downloads

transmart hyper dicer是一个数据切片工具,它从一个TranSMART实例读取数据并将其上载到另一个实例。

注:这是一个非常初步的版本,仍在开发中。 可在https://github.com/thehyve/transmart-hyper-dicer/issues报告问题。

配置

通过设置下面的环境变量,可以配置到keypolt身份提供程序和transmart的连接:

VariableDescription
TRANSMART_URLURL of the TranSMART back-end application e.g. https://transmart.example.com
KEYCLOAK_SERVER_URLURL of the Keycloak identity provider e.g. https://keycloak.example.com
KEYCLOAK_REALMKeycloak realm, e.g. dev
KEYCLOAK_CLIENT_IDKeycloak client ID, e.g. transmart-client
OFFLINE_TOKENAn offline token used used as a refresh token in order to communicate with TranSMART
VERIFY_CERTEither a boolean, in which case it controls whether the server’s TLS certificate is verified, or a string, in which case it must be a path to a CA bundle to use. Defaults to True.

为了为USERNAME用户生成脱机令牌,可以使用以下curl命令。 要获取令牌,用户需要具有领域级别的角色映射:offline_access。 在使用该命令之前,必须用正确的大写单词替换。

curl \
  -d 'client_id=KEYCLOAK_CLIENT_ID'\
  -d 'username=USERNAME'\
  -d 'password=PASSWORD'\
  -d 'grant_type=password'\
  -d 'scope=offline_access'\
'https://KEYCLOAK_SERVER_URL/auth/realms/KEYCLOAK_REALM/protocol/openid-connect/token'

响应中的refresh_token字段的值是脱机令牌。

所有变量都可以在.env文件中指定为键值对。启动应用程序时,它们将自动设置为环境变量。.env文件的示例:

KEYCLOAK_CLIENT_ID=transmart-client
KEYCLOAK_SERVER_URL=https://keycloak.example.com
KEYCLOAK_REALM=dev
OFFLINE_TOKEN=<refresh_token value from the curl response>
TRANSMART_URL=https://transmart.example.com

安装

这个包需要Python3.6+。

要安装transmart-hyper-dicer,请执行以下操作:

pip install transmart-hyper-dicer

或来源:

git clone https://github.com/thehyve/transmart-hyper-dicer.git
cd transmart-hyper-dicer
pip install .

使用以下命令运行测试(包括覆盖率):

python setup.py test

用法

基于输入json文件中指定的约束,从配置的transmart实例读取数据子集 并以transmart-copy格式将输出写到/path/to/output。 输出目录应该是空的不存在的(然后将被创建)。

输入约束必须是valid tranSMART constraint。<;input.json>;文件内容示例:

{"type":"study_name","studyId":"EHR"}

运行:

transmart-hyper-dicer <input.json> /path/to/output

这将在output目录中生成目录i2b2metadatai2b2demodata。 生成的数据可以使用transmart-copy

# Download transmart-copy:
curl -f -L https://repo.thehyve.nl/service/local/repositories/releases/content/org/transmartproject/transmart-copy/17.1-HYVE-6.2/transmart-copy-17.1-HYVE-6.2.jar -o transmart-copy.jar
# Load data
PGUSER=tm_cz PGPASSWORD=tm_cz java -jar transmart-copy.jar -d output

包管理和依赖关系

这个项目使用pip来安装依赖项和包管理。

  • 依赖项应添加到安装要求列表中的setup.py中。

许可证

版权所有(c)2019 Hyve B.V.

Transmart超级骰子是根据麻省理工学院的许可证授权的。请参阅文件LICENSE

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

推荐PyPI第三方库


热门话题
java如何在Spring工具套件中找到Spring版本?   是否有API将vSphere JSON结果映射到适当的Java对象?   java在spring WebSocket中有请求作用域吗?(websocket scop==会话范围)   java我想从list1中删除list2元素并返回list1   java使用JPA/Hibernate为单个集合使用多个@Where   JSF2.0中混合Ajax和完整请求的java   java变量miles可能尚未初始化   java使用文件路径StringArray构建父子数组   java数据源在struts中不起作用   java从另一个类访问txtField值   具有相同主键和外键双向关系的java Hibernate实体OneToOne   java Android广播接收器:上下文问题   java我可以将实体指定为数据存储属性以实现类似joinlike的功能吗?   java如何排除hadoop核心依赖项   java是否可以确定用户是否实时单击了任何通知(不仅仅是来自我的应用程序)?   java在单独的类中访问私有变量?   java如何使用Spring@Value注入映射