# S3 cleanup

It cleans up S3 bucket from unnecessary files based on `valid_from` and `valid_until` from DSP config.


## Make commands
- `make venv` - create local virtual env(base.pip dependencies)
- `make devenv` - create local virtual env(dev.pip dependencies)
- `make test` - run tests
- `make lint` - run pylint check
- `make clean` - clean unnecessary files
- `make docker/login` - aws configuration need to be set first
- `make docker/build` - build Docker images from a Dockerfile
- `make docker/push` - push an image to a registry

(when run `make test`, `make lint`  command, all dependencies from requirements/test will be installed.
When run `make venv` base.pip dependencies will be installed)

### configure AWS:
- to check if aws configuration was already set: `aws configure list`
- to configure `https://docs.aws.amazon.com/en_us/cli/latest/userguide/cli-chap-configure.html`

## Usage(run script)
    s3_cleanup
        --path-to-config PATH_TO_CONFIG
        --target-bucket TARGET_BUCKET
        [--delete]

Running script without `--delete` flag enables dry-run mode.


## Examples

    s3_cleanup --path-to-config s3://dev-delphi-configs/dsp_config.json --target-bucket dev-sme-data-decompressed

