generated from d3b-center/d3b-python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #6 from d3b-center/feature/reorganize_dewrangle
Feature/reorganize dewrangle
- Loading branch information
Showing
5 changed files
with
802 additions
and
453 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
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,24 @@ | ||
"""Download job results from Dewrangle.""" | ||
|
||
from . import helper_functions as hf | ||
|
||
def download_job(jobid, token=None): | ||
""" | ||
Function to download results from Dewrangle | ||
Input: Dewrangle job id | ||
Output: object with job resuls | ||
""" | ||
|
||
client = hf.create_gql_client(api_key=token) | ||
|
||
return hf.download_job_result(jobid, client=client, api_key=token) | ||
|
||
|
||
def main(args): | ||
"""Main function.""" | ||
|
||
status, job_df = download_job(args.jobid) | ||
if status == "Complete": | ||
job_df.to_csv(args.outfile) | ||
else: | ||
print("Job incomplete, please check again later.") |
Oops, something went wrong.