butterflybug.github.io/Tesco_delivery_checker
Recommended Python version 3.8.0
$ pipenv install --dev
The script run_checker.py
requires proper environmental variables to be set up before its code is run. They are essential for that program so that it is able to successfully log into the website and obtain all needed information about available or unavailable slots.
Variable | Description | Default |
---|---|---|
$ TESCO_EMAIL |
Login to your Tesco account | |
$ TESCO_PASSWORD |
Password to your Tesco account | |
$ WAIT_TIME |
How often run_checker.py is performed in seconds |
3600 |
$ SENDGRID_API_KEY |
API key to your SendGrid account | |
$ EMAIL_NOTIFICATION |
Email address which notification should be sent on |
$ pytest
To record a new cassette needed to run tests, that invalid one should be deleted. Once the file is removed, the newest version and updated content of the website can be recorded again.
$ pytest --record-mode=all
The whole project's deployment is prepared to be supported with dokku
.
To correctly deploy the application to external server some steps need to be followed:
Set up dokku
on remote server.
Add remote to your local repository:
git remote add [remote_name] dokku@[server_address]:[application_name]
i.e. git remote add dokku@example.com:tesco
Deploy with:
git push [remote_name] master
Make sure that environment variables are set:
dokku config:set [application_name] VARIABLE_NAME=VALUE
This project follows PEP8 style guide.
$ python -m flake8
$ black
Type annotation PEP484 with Mypy
$ mypy [file_path]