-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from chris-s-friedman/feat/kf-dataservice-query
✨ new script to query the dataservice
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |