Pantry User Guide

Omari Norman

Version 11

Copyright (c) 2007 Omari Norman.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Pantry's "built-in" XML validator is xmlproc.

xmlproc is Copyright 1998-2000 by Lars Marius Garshol, Oslo, Norway.

All Rights Reserved

Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that modified copies are clearly marked as such.

LARS MARIUS GARSHOL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL LARS MARIUS GARSHOL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


Table of Contents

About Pantry
1. What Pantry is
2. Pantry's advantages
3. Pantry disadvantages
4. Alternatives
5. Getting support and reporting bugs
1. Installing Pantry
1.1. Installation instructions
1.2. Possible installation problems
1.3. Tailoring your installation
1.4. About the documentation
2. Basic Pantry commands
2.1. The Pantry Paradigm
2.2. Basic food searches
2.3. Using the --print option
2.3.1. Combining reports
2.4. Details on searching
2.4.1. More traits you may use to search
2.4.2. Searches are regular expressions
2.4.3. My search is returning foods I don't want!
2.4.4. Searches are case sensitive
2.5. Using nutrient lists to compare foods to particular nutrient goals
2.5.1. What are nutrient lists?
2.5.2. How nutrient lists are displayed in nuts reports
2.5.3. Using a different nutrient list
2.6. Using summary reports to see information about an entire buffer
2.6.1. Using the sum report
2.6.2. Using the groups reports
2.7. Changing food traits
2.8. Saving new foods with --add and --edit; deleting with the --delete option
3. Using Pantry: practical examples
3.1. Finding nutrient amounts
3.2. Keeping a food diary
3.3. Organizing your foods into files
3.3.1. A quick file
3.3.2. Organizing diary files
4. More Pantry usage
4.1. Using the --sort option to sort foods within a report
4.2. More change options
4.2.1. Using the --auto-order option
4.2.2. Changing food quantities by refuse amount
4.3. Configuring Pantry
4.3.1. Configuring a search path
4.3.2. Specifying your own nutrient lists, and a default nutrient list
4.3.3. Specifying custom sort orders
4.4. Changing food quantities by nutrient amount
4.5. Using the pantry-addTo script
4.6. Pantry usage shortcuts
4.6.1. Using short options
4.6.2. Learn your shell
4.6.3. Learn other Unix utilities
4.6.4. Use pantry-addTo
4.7. Using Pantry with screen
5. Adding new foods and editing the nutrients or units of existing foods
5.1. Creating a new food
5.1.1. Create a new blank XML file
5.1.2. Create a food element
5.1.3. Create a nutrients element
5.1.4. Creating unit elements
5.2. Using a Foods XML file
5.3. Using Foods XML files to edit units or nutrients of foods
5.4. Validation of Foods XML files
6. Plain text Foods files, and choosing which type of Foods file to use
6.1. How Foods Text files work
6.2. Foods Text files: an example
6.3. Using Foods Text files
6.4. Which sort of file should I use?
7. Adding recipes
7.1. When to use recipes
7.2. Creating a recipe
7.2.1. Creating a recipes file and its root element
7.2.2. Creating the recipe element
7.2.3. Setting the yield of a recipe
7.2.4. Setting the ingredients of a recipe
7.2.5. Setting the available units for a recipe
7.3. Using recipes
7.4. Validation of Recipes XML files
A. Reference pages
pantry — nutrient analyzer
B. Pantry's birth

List of Examples

2.1. Introducing the --print option
2.2. Using --print traits
2.3. Using --print units
2.4. Using --print nuts
2.5. Two nuts reports
2.6. Two units reports
2.7. Combining reports
2.8. Using the blank report
2.9. Using multiple search options
2.10. Using regular expressions
2.11. A search that has more foods than I am interested in
2.12. Using anchors
2.13. Using the --exact-match option
2.14. The facts nutrient list with 100 grams of bananas
2.15. Specifying a nutrient list
2.16. Using the sum report
2.17. Using the --nutrient-list option with the sum report
2.18. How many groups are in the master file?
2.19. Changing foods
2.20. Changing the unit trait
2.21. Errors when changing the unit trait
2.22. qty may be a fraction or mixed number
2.23. Using the --add option
2.24. Using the --edit option
2.25. Using the --delete option
3.1. Searching for apples
3.2. Searching for apples, with the --group option
3.3. Searching for apples using a regular expression
3.4. Available units for an apple
3.5. How many calories are in an apple?
3.6. Adding entries to a diary
3.7. Printing nutrient reports about a diary
3.8. Getting totals about a diary
4.1. Pantry does not sort foods
4.2. Using the --sort option
4.3. Using --auto-order
4.4. Using --sort with foods that have been automatically ordered
4.5. Using --auto-order with only the date trait changed
4.6. Traits and available units for an apple
4.7. Using the measures report
4.8. Using the --refuse option
4.9. Beginning a .pantryrc.xml file
4.10. .pantryrc.xml with search path specified
4.11. Specifying a default nutrient list in .pantryrc.xml
4.12. Showing all available nutrients
4.13. .pantryrc.xml with new nutrient list
4.14. Using a new nutrient list
4.15. .pantryrc.xml with sort-order element
4.16. Using the --by-nut option
4.17. Using --by-nut with Total Fat
4.18. Using --by-nut with --c-unit
4.19. The closest thing to Stonyfield
4.20. Approximating one food by using another food and the --by-nut option
4.21. Using the -K option
4.22. Example .pantryrc.xml file with pantry-addTo configuration
4.23. Setting up a quick file
4.24. Using pantry-addTo scripts
4.25. Seeing the results from using pantry-addTo
4.26. Searching for apple returns 163 results
4.27. Using the paste report
5.1. foods.xml file with foods element
5.2. foods.xml with food element
5.3. Food with nutrients element
5.4. Complete foods.xml file.
5.5. Use a Foods XML file as you would use a Pantry native file
6.1. A sample Foods Text file
6.2. Using a Foods Text file
6.3. Changing a Foods Text file
7.1. A recipes.xml file with an empty recipes element
7.2. Creating the recipe element
7.3. Setting the recipe yield
7.4. A recipe with its ingredients
7.5. A complete new recipe
7.6. Using a Recipe XML file
7.7. Adding a recipe to a Pantry native file