PROJECT FILES (fictional sample)

.
|-- pyproject.toml
|-- src/
|   `-- pantry_log/
|       |-- __init__.py
|       |-- cli.py
|       `-- store.py
`-- tests/
    `-- test_store.py

--- pyproject.toml ---
[project]
name = "pantry-log"
version = "0.2.0"
description = "Keep a list of what is in your pantry and see what expires soon."
requires-python = ">=3.10"
dependencies = []

[project.optional-dependencies]
dev = ["pytest>=8"]

[project.scripts]
pantry = "pantry_log.cli:main"

--- src/pantry_log/cli.py (excerpt) ---
def build_parser():
    p = argparse.ArgumentParser(prog="pantry")
    sub = p.add_subparsers(dest="command", required=True)
    add = sub.add_parser("add", help="add an item")
    add.add_argument("name")
    add.add_argument("--expires", help="expiry date, YYYY-MM-DD")
    sub.add_parser("list", help="list all items")
    exp = sub.add_parser("expiring", help="items expiring soon")
    exp.add_argument("--days", type=int, default=7)
    return p

--- src/pantry_log/store.py (excerpt) ---
DEFAULT_PATH = Path.home() / ".pantry.json"

def data_path():
    return Path(os.environ.get("PANTRY_FILE", DEFAULT_PATH))

def load(): ...   # returns [] if the file does not exist
def save(items): ...  # writes JSON, indent=2

--- tests/test_store.py (excerpt) ---
def test_load_missing_file_returns_empty(tmp_path, monkeypatch):
    monkeypatch.setenv("PANTRY_FILE", str(tmp_path / "p.json"))
    assert store.load() == []

Not present in the project: LICENSE, CI config, docs folder, CONTRIBUTING, Dockerfile.
