Closed finish06 closed 4 years ago
Reran the following scenarios with success:
python get_zips.py
python get_zips.py --unzip 2 --download 4
python get_zips.py --unzip 20 --download 1
python get_zips.py --unzip 2 --select 4
Help menu:
usage: get_zips.py [-h] [--unzip int] [--download int | --select int]
Download and unzip SPL data.
optional arguments:
-h, --help show this help message and exit
--unzip int Optional number of files to extract from SPL zip.
--download int Optional number of SPL zip files to download, max 4.
--select int Optional SPL zip file to download, i.e. 1, 2, 3 or 4
Fixes coderxio/dailymed-api#23
Explanation
get_zips.py
now callsextract_zips.py
. This allows for each SPL to be downloaded, extracted, and deleted before the next SPL is obtained.get_zips.py
reads and writes the SPL.zip file in chunks to prevent memory issues in low memory environments.get_zips.py
includes cmd line arguments to specific number of files to unzip, the number of SPLs to download or the specific SPL to download.Download and unzip SPL data.
optional arguments: -h, --help show this help message and exit --unzip u Number of files to unzip from SPL --download d Number of SPL files to download, max 4 --select s Specific SPL file to download, i.e. 1, 2, 3 or 4