~javiljoen/groceries

Grocery list app

6931d0b Add id field to items table in db schema

1 year, 9 months ago

9a68e12 [not used yet] Implement Drop for TempFile

2 years ago

#groceries

Grocery management CLI application

builds.sr.ht status

#Installation

Clone this repo and install the package by running:

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

#Usage

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

#Backends

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

#Development

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