Skip to content

itsjohnward/grocer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grocer: A Programmable Grocery Delivery Interface

Build Status Code style: black Code style: black

Install

$ pip install git+https://github.com/itsjohnward/grocer.git

Getting a ChomeDriver

  1. Download ChromeDriver from here https://chromedriver.storage.googleapis.com/index.html?path=83.0.4103.39/
  2. Set an environment variable pointing to where you downloaded it. i.e. export CHROMEDRIVER_PATH=/Users/john/csci-e-29/grocer/chromedriver

Setting up account info

Set your instacart username and password as environment variables like so:

export EMAIL=example@example.com
export PASSWORD=password

Use from the command line

$ grocer <store> <action>

For example:

$ grocer wegmans times
                  date         time  price
index                                     
0       Monday, May 11    4pm - 6pm  $5.99
1       Monday, May 11    5pm - 7pm  $5.99
2      Tuesday, May 12  10am - Noon  $5.99
3      Tuesday, May 12   11am - 1pm  $5.99
4      Tuesday, May 12   Noon - 2pm  $5.99
5      Tuesday, May 12    1pm - 3pm  $5.99

Import to create your own python programs

For example:

from grocer import GrocerClient

# Create a client instance
client = GrocerClient(merchant="wegmans", email="example@example.com", password="password")

# Call client methods
print(client.get_delivery_times())

Example project

See https://github.com/itsjohnward/grocer-notifier as an example of a project written using Grocer.

Feature Roadmap / Further Work

Merchants

  • Wegmans (Instacart)
  • Fairway (Instacart)
  • FreshDirect
  • Amazon Fresh

Actions

  • times: get available delivery times
  • search: search for products
  • add: add product to cart
  • remove: remove product from cart
  • cart: get the status of the current cart
  • checkout: purchase the items currently in the cart