Grocery list CLI and REST app
Add id field to items table in db schema
Add lists table referenced in items table to db schema
Explicitly use UTF-8 for text files


browse  log 



You can also use your local clone with git send-email.


Grocery management CLI application

builds.sr.ht status


Clone this repo and install the package by running:

pip install -r requirements/pkg.txt
pip install .


Installing the package makes a shell command groceries available.

To see the available options, run:

groceries -h

The path to the grocery list file to use can be provided by setting the environment variable GROCERIES_URI, e.g.:

export GROCERIES_URI=~/groceries.txt
groceries list


Two storage backends are supported:

  1. Plain-text file in todo.txt format (can be synced to mobile with e.g. SimpleTask)
  2. SQLite

It is possible to convert between the formats with groceries export > file.txt and groceries import file.txt.

The format is detected based on the scheme of the URI provided. Examples of allowed formats:

  • SQLite:
    • sqlite:///home/me/groceries.db
  • Plain-text:
    • file:///home/me/groceries.txt
    • ~/groceries.txt

#Priority levels

The default priority levels are: Today, Soon, Upcoming, Maybe later. This can be changed by setting the environment variable GROCERIES_PRIORITIES to a comma-separated list of the desired levels, e.g.:

export GROCERIES_PRIORITIES=Daily,Weekly,Monthly
groceries list


In a Python ≥ 3.8 virtual environment, run:

make init

To upgrade all dependencies, run:

make update

To run all tests and linter checks, run:

make check

#REST API server

To run the REST API server in development mode, set the FLASK_APP and FLASK_ENV environment variables as follows (e.g. in .envrc if using direnv):

export FLASK_APP=groceries.web.wsgi:main
export FLASK_ENV=development

Then start the development server with:

flask run