Metadata-Version: 2.5
Name: mealtime-pantry
Version: 0.3.3
Summary: Food product records with local fuzzy search, Open Food Facts discovery, and a CLI to add products.
Project-URL: Homepage, https://github.com/mealtime-tools/pantry
Author-email: owahltinez <oscar@wahltinez.org>
License-Expression: MIT
License-File: LICENSE
Keywords: afcd,agent,cli,food,macros,nutrition
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Utilities
Requires-Python: >=3.13
Requires-Dist: click-agentcli>=0.1.0
Requires-Dist: click>=8.1
Requires-Dist: mealtime-nutrients>=0.3.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: rapidfuzz>=3.9
Provides-Extra: browser
Requires-Dist: playwright>=1.44; extra == 'browser'
Description-Content-Type: text/markdown

# Pantry

Pantry finds and stores food-product nutrition. It searches the local Coles
and AFCD shards plus a user's own records, and can acquire one product from a
Coles or Woolworths URL, USDA FoodData Central, or Open Food Facts.

```sh
pantry --json search "greek yoghurt"
pantry --json search "greek yoghurt" --remote
pantry --json lookup coles 1047
pantry --json lookup coles 1047 --grams 42 | recipes edit "Snack" --input -
pantry add https://www.coles.com.au/product/example-1047
pantry add usda:2476857
pantry add off:0123456789012
pantry delete manual sourdough
```

Nutrients describe the record's `grams`, which every record and result carries
and which is 100 unless `--grams N` asks for another weight. There is no pack
size or serving size. A per-100 mL panel is read as per 100 g and says so in
`basis_note`. An item is a flat record in the shared
[item format](https://github.com/mealtime-tools/nutrients/blob/main/FORMAT.md),
so it pipes unchanged into Recipes, or into whatever tool records what you ate.

Energy is `kcal` and every other nutrient is grams. A panel printing
kilojoules is converted where it is read, so no record holds a `kj`.

Manual input is flat JSON, restated to 100 g before it is stored:

```sh
printf '%s\n' '{"grams":90,"kcal":335,"protein":45.6,"fat":7.9,"carbs":4.9}' |
  pantry add --input - --id sourdough --name Sourdough
```

Unknown standard nutrients are `null`; zero is returned only when the source
explicitly reported zero.

`pantry delete SOURCE ID` removes a record from that store, and only from
there: a shipped shard row is refused, and deleting a correction leaves the
row it shadowed visible again.

The ignored `data/coles.jsonl` scrape is irreplaceable. No command writes to
package data. Acquired products go to `$XDG_CONFIG_HOME/pantry` or
`~/.config/pantry`.

Retailer requests are deliberately limited and paced. A block stops the run;
there is no retry, proxy rotation, or CAPTCHA handling.

## Development

```sh
uv run pytest -q
uv run --project importers/afcd pytest -q importers/afcd/tests
uv run ruff check src
uv run ruff format --check src
```
