Skip to content
Shopping list creator for Lazy people.
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
scripts Price fixes (#5) Jul 26, 2019
shopping_list_bot
tests Updated price_checker.py ../shopping_list_bot/price_updater.py ../sho… Jun 14, 2019
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE Initial commit Jun 8, 2019
MANIFEST.in
README.md
secrets.tar.enc Price fixes (#5) Jul 26, 2019
setup.py

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.

🍰

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.