# fingerprint-sweeper

Process to sweep up tracks that were missed in the fingerprinting process. See tech design at https://goo.gl/uh1Dzf.

## Install
```
pyvenv-3.4 env
source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
```

## Test
Run tests from fingerprint-sweeper directory:
```
py.test --cov-report term-missing --cov=fpsweeper test/
```


## DEV Environment
### AWS Config
Include the following in your ~/.aws/config file
```
[default]
region=us-east-1
```

### Set Environment Variables
```
export FPC_DB_URL='mysql+pymysql://<user>:<pw>@dev-wpcorpsite.cb22xqmk0y0q.us-east-1.rds.amazonaws.com/fingerprint_capture'
export AR_DB_URL='mysql+pymysql://<user>:<pw>@mr.db.devorch.com/art_relations'
export DD_DB_URL='mysql+pymysql://<user>:<pw>@<server>/direct_delivery'
export DD_STORAGE_PHYSICAL_LOCATION_ID=7
export PYTHONPATH=<your_path>/fingerprint-sweeper
```

### Usage
```
python fpsweeper/logic/sweeper.py -h
```

### Run Process
```
python fpsweeper/logic/sweeper.py --daterange_start_days=5 --daterange_end_seconds=3600 --backfill
```
