Skip to content

Commit

Permalink
Merge pull request #18 from chris-s-friedman/feat/kf-dataservice-query
Browse files Browse the repository at this point in the history
✨ new script to query the dataservice
  • Loading branch information
chris-s-friedman committed Feb 17, 2022
2 parents 04a0ad2 + dc42863 commit fa9012f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions utils/work/query_ds.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
Query entities in the dataservice
"""
import json

import click
from kf_utils.dataservice.scrape import yield_entities_from_kfids


@click.command()
@click.argument("kf_id", type=str)
@click.argument("host", default="https://kf-api-dataservice.kidsfirstdrc.org")
def query(host, kf_id):
"""
Query the given host for the given kf_id
"""
for e in yield_entities_from_kfids(host, [kf_id], show_progress=False):
print(json.dumps(e, indent=4))


if __name__ == "__main__":
query()
1 change: 1 addition & 0 deletions utils/work/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kf_utils @git+https://github.com/kids-first/kf-utils-python.git

0 comments on commit fa9012f

Please sign in to comment.