Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/apursley2012/corner-grocer/llms.txt

Use this file to discover all available pages before exploring further.

Corner Grocer is a Python application that reads grocery purchase data, counts how often each item appears, and lets you explore that data through lookup, sorting, search, histogram output, and persistent SQLite storage. A browser-based demo runs the same functionality without any installation.

Introduction

Learn what Corner Grocer does and how it is structured across its three Python modules.

Quickstart

Get the application running locally in under five minutes with a sample input file.

API Reference

Explore all public classes and functions: GroceryFrequency, grocery_utils, db_handler, and CornerGrocerApp.

Browser Demo

Run Corner Grocer directly in your browser — no Python or database setup required.

What Corner Grocer does

Corner Grocer solves a practical inventory-tracking problem: given a list of purchased grocery items (one per line), it counts each item’s frequency and surfaces the data in multiple ways.

Frequency Lookup

Look up exactly how many times any item was purchased from a text file or SQLite database.

Sort & Search

Sort results alphabetically or by purchase count. Search by partial name with case-insensitive matching.

Persistent Storage

The database-backed version retains data between sessions using SQLite — no server required.

Histogram Output

Visualize item frequencies as an asterisk histogram directly in the terminal.

Backup Export

Save the frequency list or histogram to .dat files on demand.

Browser Demo

A static HTML/JS version of the full application runs in any browser via GitHub Pages.

Application versions

Corner Grocer has three runnable Python files, each representing a stage of development:
1

corner_grocer.py — Enhancement One

The original Python rewrite of the C++ application. Uses GroceryFrequency class with defaultdict for in-memory frequency tracking from a text file. Menu options 1–7 including backup export.
2

corner_grocer.py (Enhancement Two additions)

Adds alphabetical sort, frequency sort, and item search by importing helper functions from grocery_utils.py. All original menu options remain intact.
3

corner_grocer_main.py — Enhancement Three

Replaces in-memory storage with a SQLite backend via db_handler.py. Adds menu options 7 and 8 for saving frequency list and histogram to .dat files. Data persists across sessions.

Build docs developers (and LLMs) love