From cae93b3dd424a52aae13064e2fcdbc7cc30c4b1e Mon Sep 17 00:00:00 2001 From: Liz Date: Tue, 21 Feb 2017 08:31:31 -0600 Subject: [PATCH] added info added requirements section, examples for running the program, and updated formatting --- README.md | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2dda80c..19949bb 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,29 @@ ## About ## -batch_retrieval.py downloads images from Chronicling America. It works in three steps: +batch_retrieval.py downloads newspaper page images from Chronicling America. It works in three steps: -1. Create the master manifest of every newspaper image in the Chronicling America collection -2. Download the images. The getImages function can take in two integers that correspond to the beginning year and ending year that you want to download from (dates of newspapers). -3. Convert images from JP2000 to .jpg +1. Creates the master manifest of every newspaper page image in the Chronicling America collection +2. Downloads requested images. The getImages function takes in two integers that correspond to the beginning year and ending year that you want to download images for (publication dates of newspapers). +3. Converts downloaded images from JP2000 to .jpg -All images are stored in a file hierarchy based on the Chronicling America file hierarchy. +All downloaded images are stored in a file hierarchy based on the Chronicling America file hierarchy. + +## Requirements ## +* Java version 7 or higher +* Python version 2.7 (not Python 3) +* Python image dependencies: + * JasPer (JP200 Python encoder/decoder) + * Pgmagick (Python image library) ## Running ## -Run the retrieval by running: -`python Batch_Retrieval.py ` - -use to specify which functions to run: -* flag = 1 for run build manifest, get images and convert to *.jpg -* flag = 2 for get images and convert to *.jpg (use if manifest already exists) -* flag = 3 for build manifest only +To run the retrieval program: +`python batch_retrieval.py ` + +Use one of the following `` values to specify which function(s) to run: +* flag = 1: Run all steps. Build manifest, get images from a specific year or years, and convert to .jpg. +**Example:** `python batch_retrieval.py 1 1924 1924` [Creates complete manifest, downloads all images from 1924, and converts those images to .jpg] +**Example:** `python batch_retrieval.py 1 1836 1840` [Creates complete manifest, downloads all images from 1836-1840, inclusive, and converts those images to .jpg] +* flag = 2: Get images from a specific year or years and convert images to .jpg (can only be run independently if manifest already exists). +**Example:** `python batch_retrieval.py 2 1924 1924` [Manifest already exists; downloads all images from 1924 and converts those images to .jpg] +**Example:** `python batch_retrieval.py 2 1836 1840` [Manifest already exists; downloads all images from 1836-1840, inclusive, and converts those images to .jpg] +* flag = 3: Build manifest (do not download and convert images). Do not specify a begin year or end year, as the manifest builder always compiles the complete manifest for all images in the Chronicling America collection. +**Example:** `python batch_retrieval.py 1` [Creates a complete manifest all of newspaper page images in Chronicling America and saves manifest for later use.]