From b57f36a346f1d40bf555142c250e85171c062306 Mon Sep 17 00:00:00 2001 From: zjgilliam Date: Mon, 23 Sep 2024 07:56:40 -0500 Subject: [PATCH] Automated commit -> added proxy and tease settings in env --- jatosAPI.py | 31 +++++++++++++++++++++---------- requirements.txt | 16 ++++++++++++++++ 2 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 requirements.txt diff --git a/jatosAPI.py b/jatosAPI.py index 8620990..7c37b96 100644 --- a/jatosAPI.py +++ b/jatosAPI.py @@ -10,12 +10,20 @@ # jap_5ThOJ14yf7z1EPEUpAoZYMWoETZcmJk305719 -def get_met(): - tease = os.getenv['TEASE'] +def parse_cmd(): + #parse command line for TEASE var + import argparse + parser = argparse.ArgumentParser(description='API File to Pull Subject Data from Jatos') + parser.add_argument('-t', type=str, help='TEASE') + + + +def get_met(tease): + proxies = { - 'http': f'http:zjgilliam:{tease}//proxy.divms.uiowa.edu:8888', - 'https': f'https://zjgilliam:{tease}proxy.divms.uiowa.edu:8888', + 'http': f'http:zjgilliam:{tease}@proxy.divms.uiowa.edu:8888', + 'https': f'https://zjgilliam:{tease}@proxy.divms.uiowa.edu:8888', } url = 'https://jatos.psychology.uiowa.edu/jatos/api/v1/results/metadata' @@ -60,12 +68,13 @@ def get_met(): return study_result_ids -def get_data(study_result_ids): - tease = os.getenv['TEASE'] +def get_data(study_result_ids, tease): + + proxies = { - 'http': f'http:zjgilliam:{tease}//proxy.divms.uiowa.edu:8888', - 'https': f'https://zjgilliam:{tease}proxy.divms.uiowa.edu:8888', + 'http': f'http:zjgilliam:{tease}@proxy.divms.uiowa.edu:8888', + 'https': f'https://zjgilliam:{tease}@proxy.divms.uiowa.edu:8888', } headers = { @@ -222,8 +231,10 @@ def push(): def main(): - study_result_ids = get_met() - get_data(study_result_ids) + args = parse_cmd() + tease = args.t + study_result_ids = get_met(tease) + get_data(study_result_ids, tease) convert_beh() txt_files = [] for root, dirs, files in os.walk('./data/raw'): diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5b0c5fb --- /dev/null +++ b/requirements.txt @@ -0,0 +1,16 @@ +contourpy==1.2.1 +cycler==0.12.1 +fonttools==4.53.1 +fuzzywuzzy==0.18.0 +kiwisolver==1.4.5 +matplotlib==3.9.2 +numpy==2.0.1 +packaging==24.1 +pandas==2.2.2 +pillow==10.4.0 +pyparsing==3.1.2 +python-dateutil==2.9.0.post0 +pytz==2024.1 +seaborn==0.13.2 +six==1.16.0 +tzdata==2024.1