diff --git a/AACT_downloader/ClinicalTrialHistory/docker-entrypoint-initdb.d/020_HttpSchema.sql b/AACT_downloader/ClinicalTrialHistory/docker-entrypoint-initdb.d/020_HttpSchema.sql index e45fe6d..f87fdca 100644 --- a/AACT_downloader/ClinicalTrialHistory/docker-entrypoint-initdb.d/020_HttpSchema.sql +++ b/AACT_downloader/ClinicalTrialHistory/docker-entrypoint-initdb.d/020_HttpSchema.sql @@ -24,11 +24,11 @@ CREATE TABLE IF NOT EXISTS http.responses ( id SERIAL PRIMARY KEY, nct_id VARCHAR(15), version_a SMALLINT, - version_b SMALLINT, + version_b SMALLINT, url VARCHAR(255), response_code SMALLINT, response_date TIMESTAMP WITH TIME ZONE, - html TEXT + html TEXT ); diff --git a/history_downloader/db_connection.py b/history_downloader/db_connection.py index 4b5f94c..3a85f92 100644 --- a/history_downloader/db_connection.py +++ b/history_downloader/db_connection.py @@ -1,3 +1,7 @@ +# Description +# This program tests the ability to connect the the DB +# + import psycopg2 as psyco conn = psyco.connect(dbname="aact_db", user="root", host="will-office", password="root") diff --git a/history_downloader/downloader.py b/history_downloader/downloader.py index a93d9c4..9875525 100644 --- a/history_downloader/downloader.py +++ b/history_downloader/downloader.py @@ -1,4 +1,3 @@ -from tkinter import W import requests import psycopg2 as psyco from datetime import datetime @@ -223,6 +222,7 @@ def flag_trials_of_interest(db_connection): ; """ #TODO: actually send it to the database. + #Should probably have thsi saved as a file, such as the downloader_prep.sql file. def reserve_trials(db_connection, limit=10): """ diff --git a/history_downloader/readme.md b/history_downloader/readme.md new file mode 100644 index 0000000..e4c5321 --- /dev/null +++ b/history_downloader/readme.md @@ -0,0 +1,20 @@ +# File descriptions + +db_connection.py +- is just a test file +- [ ] TODO: should be incorporated in a tests justfile recipe. maybe moved to a test location? + + +downloader_prep.sql +- contains sql to identify which trials are of interest. +- [ ] TODO: add into the automation routine somewhere. + +downloader.py +- does the actual downloading +- setup to also act as a python module if needed. +- [ ] TODO: there are quite a few things that need cleaned or refactored. + +./tests/download_tests.py +- downloads some test html values from clinicaltrials.gov + + diff --git a/justfile b/justfile index 120859d..7f9775e 100644 --- a/justfile +++ b/justfile @@ -48,7 +48,7 @@ setup-containers: #Stop the appropriate docker container stop-containers: #stop all docker containers if they are currently running. - #The if statement is used because sometimes there are no running containers + #The if [empty string] statement because sometimes there are no running containers if [ -n "{{docker_container}}" ]; then docker stop {{docker_container}}; fi @echo "confirmed that docker containers {{docker_container}} are stopped"