Skip to content

Final project for Stanford's Code in Place course: a Python grocery list generator

Notifications You must be signed in to change notification settings

shelbybachman/grocery-list-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains materials for for my final project from Stanford's 2021 Code in Place course.

project overview

For project, I created a python program that generates a formatted grocery list based on user input in the console.
You can view a demo of the grocery list generator here.

dependencies

to use the generator yourself, you'll need:

  • Python 3 installed
  • the Python Imaging Library Pillow installed: python -m pip install --upgrade Pillow

using the generator

to use the generator yourself, follow these steps:

  • clone the repo: git clone https://github.com/shelbybachman/grocery-list-generator.git
  • navigate into the directory: cd grocery-list-generator
  • run the program: python grocery_list.py:

image of running program

  • when prompted, enter items and quantities
    • enter singular nouns only (e.g. banana rather than bananas)
    • enter integer quantities only

image of entering items and quantities

  • when done entering all your items, press Enter
  • your grocery list will be saved in two ways. first, as plain text in the console, which can be copied to list manager of your choice:

image of plain text list printed by program

  • second as an image, in the subdirectory lists/:

image of list image location

image of plain list image created by program

customization

the grocery list generator has a number of customization options:

customize food items in the grocery database

to assign categories to food items entered, the program reads food items from files, one for each category. you can update the food items in each of the files contained in data/*.csv, shown below:

image of .csv files which are used to create the foot dictionary

customize font family in the list image

to change the font family of the font shown on the list image, add the relevant .ttf files to the utils/ directory. you can download font(s) of choice from google fonts.

then, you will need to update relevant lines in the program grocery_list.py shown below:

  • update FONTFILE_LIGHT to define the font file for the date & list items (example: 'utils/Roboto-Light.ttf')
  • update FONTFILE_BOLD to define the font file for the title & category names (example: 'utils/Roboto-Bold.ttf')

image of code where customization can occur

About

Final project for Stanford's Code in Place course: a Python grocery list generator

Resources

Stars

Watchers

Forks

Languages