# sme-labelcopy-loader

Connect to sme RDS database and unload data from the view/table in csv file on the s3.

### Dependencies
- python 3.8

## Installation

Use pipenv and install requirements:
```sh
$ make install_with_dev_from_lock
```

### .env.shadow
.env.shadow is a template environment variable script that exports keys and values necessary for successful connectivity, paths, etc.  You will need to copy this file to `.env` and populate the necessary keys.

```sh
$ cp .env.shadow .env
```

If you don't have access to sme RDS database (which is likely because it is in switchboard vpc), 
it is needed to request access to a server which has this access. 
Please provide these env variables in .env file - 

export SSH_HOST=
export SSH_USERNAME=
export SSH_PRIVATE_KEY=

and the script will set up the tunnel to the sme RDS database though this server.

### Running the script:

```sh
$ python main.py
```

