Skip to content

kids-first/kf-dataservice-tools

Repository files navigation

Kids First Dataservice Tools

Command-line tools for bulk interaction with the dataservice. Built with (Kids First Pyton Utilities)[https://github.com/kids-first/kf-utils-python]

Installation

Using pip

pip install git+https://github.com/kids-first/kf-dataservice-tools.git@latest-release

Tools included so far

Copy items between dataservices

Copy a list of kf_ids from one dataservice to another

Copy a list of kf_ids. The list of kf_ids should be in a file, minimally with a column named kf_id.

kf_dscopy -s prd -t localhost kf_ids -f "path/to/file.csv"

Copy a single kf_id

kf_dscopy -s prd -t localhost kfids -k PT_GRMPYCAT

Copy multiple kf_ids

kf_dscopy -s prd -t localhost kfids -k PT_GRMPYCAT -k BS_FRRRBA11

Copy kf_ids that are in a file manifest and some specific kf_id(s):

kf_dscopy -s prd -t localhost kfids -f "path/to/file.csv" -k PT_GRMPYCAT -k BS_FRRRBA11

Copy an entire study

Copy an entire study (study + all of its descendants)

kf_dscopy -s prd -t localhost study SD_ME0WME0W

Copy an entire study and copy all sequencing centers

kf_dscopy -s prd -t localhost study SD_ME0WME0W --copy_sc

Copy sequencing centers

Check if all the sequencing centers in the source are in target. Copy all the sequencing centers not in target into target.

kf_dscopy -s prd -t localhost sequencing_centers

Delete items from a dataservice

Delete specific KF_IDs

This mirrors kf_dscopy with the kfids option

kf_dsdelete -h localhost kfids -k BS_1234567 -k DX_ABCDEFGH

Delete a study

kf_dsdelete -h localhost study -s SD_12345678

Delete everything in a dataservice

kf_dsdelete -h localhost everything