Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 1000 Bytes

File metadata and controls

35 lines (22 loc) · 1000 Bytes

AWS lambda function for validating, cropping and re-scaling incoming images to fruktkartan.se.

Installation

cp .env.sample .env
python3 -m pip install -r requirements/dev.txt

The .env.sample file contains defaults for the environment variables used. You need to set these variables somehow, e.g. by copying them to a .env file.

You will also need to setup credentials for AWS S3 access (see https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html for various ways to do this)

Not that the requirements/prod.txt file does not contain boto3 or Pillow, as these are preinstalled in our production environment.

Running

./resize.py --help

Testing

Tests are written for pytest. Linting can be done with flake8.

python3 -m flake8
python3 -m pytest

Licences

Test images, see description pages at Wikimedia Commons: