Skip to content
Shopping list creator for Lazy people.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Updated Jun 14, 2019
scripts gsheets method, to avoid disconnection (#1) Jun 21, 2019
shopping_list_bot Using loguru instead of logging module (#3) Jul 16, 2019
tests Updated price_checker.py ../shopping_list_bot/price_updater.py ../sho… Jun 14, 2019
.gitignore Added skeleton docstrings, renamed and added scripts dir Jun 13, 2019
.travis.yml Added loggingclass, more stores get price and name using beautiful so… Jul 5, 2019
CONTRIBUTING.md
LICENSE Initial commit Jun 8, 2019
MANIFEST.in Automated commit Jun 8, 2019
README.md Update README.md Jun 26, 2019
client_secret.json.enc Added my encrypted Google client-secret.json file Jun 20, 2019
setup.py Using loguru instead of logging module (#3) Jul 16, 2019

README.md

Shopping List Bot

Build Status GitHub

The Story

Due to the high rate of inflation, buying monthly groceries has become a sport. One has to go to the ends of the world in order to good prices on the items they need. When creating a monthly grocery list one has to go through countless catalogues or websites to find good prices or promotions, and that is time-consuming.

Over time I started to get annoyed and decided to create a Python script that would search for the items I have listed in a Google spreadsheet across some of the major online shops in the country (South Africa). The script opens various websites (Using Selenium), searches for the items listed, gets the current prices and correct item name and then uploads the data to a Google Spreadsheet. Pretty straight forward.

Installation

  1. Obtain Google API for authentication:

    • Follow the instructions here
  2. Before you install ensure that geckodrive for Firefox is installed.

    • Download geckodriver
      • wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
      • Extract: tar -xvzf geckodriver-v0.24.0-linux64.tar.gz
    • sudo cp geckodriver /usr/local/bin
  3. Now install:

    • pip install . -U
  4. Upload the spreadsheet to GDrive or GSpeadsheet, and insert your items into column 2 [ Items ]

Usage

price_checker.py -h
usage: price_checker.py [-h] --json CLIENT_SECRET_FILE --spreadsheet_name
                        SPREADSHEET_NAME [--share-with SHARED] [--update]
                        [--loglevel LOG_LEVEL]

optional arguments:
  -h, --help            show this help message and exit
  --json CLIENT_SECRET_FILE
                        Google Json file containing secrets.
  --spreadsheet_name SPREADSHEET_NAME, -s SPREADSHEET_NAME
                        Name of the spreadsheet you want to open.
  --share-with SHARED   [email address] Share the spreadsheet with someone via
                        email
  --update              Update spreadsheet with new prices.
  --loglevel LOG_LEVEL  log level to use, default [INFO], options [INFO,
                        DEBUG, ERROR]

Typical usage:

price_checker.py --json ~/.envs/client_secret.json -s "Shopping List"

Oh, Thanks!

By the way... Click if you'd like to say thanks... :) else Star it.

🍰

TODO

  • Integrate with `Slack` API to send slack messages if price of an item changes.
    
  • Add more tests
    

Travis CI automated daily price updates

Travis CI can automatically run your Google App Engine based application, by encrypting your clients_secrets.json file and pushing it to GitHub. See: https://docs.travis-ci.com/user/deployment/google-app-engine/

Feedback

Feel free to fork it or send me PR to improve it.

You can’t perform that action at this time.