# ripper-feeder
This tool allows for the rapid ingestion of assets (Audio and Covers 
only) through the Orchard Asset Ripper.

This tool works against an S3 Bucket filled with Tracks (wav/flac files)
organized under release-level keys. 

## Environment:
### Bare Minimum (S3-based):
```
export ENVIRONMENT=dev (prod, dev, qa, test)

export AR_MYSQL_USER=
export AR_MYSQL_PASSWORD=
export AR_MYSQL_HOST=<squad>.db.devorch.com
export AR_MYSQL_DATABASE=art_relations

export SNOWFLAKE_ACCOUNT=orchard
export SNOWFLAKE_USER=
export SNOWFLAKE_ROLE=DEV_ENGINEERING
export SNOWFLAKE_PASSWORD=
export SNOWFLAKE_WAREHOUSE=DEV_OWS_WAREHOUSE
export SNOWFLAKE_SCHEMA=<full schema - i.e. 'schemaname.dev'>

export S3_BUCKET=<bucket_name>
export AWS_ACCESS_KEY_ID_DEV=<key>
export AWS_SECRET_ACCESS_KEY_DEV=<secret>
```

## Folder structure
**Input**:
```
bucket_name --
      |_ audio_folder_name
      |____ release_key_1 (ex: 12394)
      |________ release_key_1_001_001.wav
      |________ release_key_1_001_002.wav
      |________ ...
      |
      |____ release_key_2 (ex: 23456)
      |____ release_key_3
      |____ ...
      |
      |_ cover_folder_name
      |____ release_key_1
      |________ foreign_key_1.tif
      |____ release_key_2
      |____ ...
```
**Output:**
```
ripper_folder --
      |_ WAV
      |____ UPC_ONE (ex: 1239412345)
      |________ UPC_ONE_1_1.wav
      |________ UPC_ONE_1_2.wav
      |________ ...
      |
      |____ UPC_TWO (ex: 2345612345)
      |____ UPC_THREE
      |____ ...
      |
      |_ TIF
      |____ UPC_ONE
      |________ UPC_ONE.tif
      |____ UPC_TWO
      |____ ...
```

## How to Run
Although this application can be run from any machine, and directed to 
save the downloaded files to any mounted resources therein, the latency 
caused by the large amount of data being pulled down NECESSITATES that 
this application is loaded and executed on the ripper(ing) server, so 
that files are pulled directly to the ripper box, and not to an 
intermediate "weigh-station"

There are some cases when files must be converted during feeding. These 
cases are outlined below
 
## Outputs

## File conversion

## How To Create a New File Transformer
Copy an existing transformer, and modify 
'audio_asset_transform' and 'cover_asset_transform'.

Then, add the newly derived transformer class to the dictionary in file `constants/transformers.py`. The key of the dict
is simply a handle, whereas the value must match the derived class name. (see file itself for example.)  