Skip to main content

Home and office nutrient tracking software

Project description

Latest version unknown| Build status unknown| Monthly downloads unknown| Python3 (3.4 - 3.10)| Code style: black| License GPL-3

Extensible command-line tools for nutrient analysis.


  • Python 3.4.0 or later (lzma, ssl & sqlite3 modules) [works on winXP]
  • Packages: see or requirements.txt (and config/requirements-*.txt)
  • Internet connection, to download food database & package dependencies

See nt database:

See usda database:


On macOS and Linux, you may need to add the following line to your .profile or .bashrc file:

export $PATH=$PATH:/usr/local/bin

On Windows you should check the box during the Python installer to include Scripts directory in your $PATH. This can be done manually after installation too.

Windows users may manually attempt to install search enhancing library python-Levenshtein via running:

pip3 install python-Levenshtein


pip3 install -r config/requirements-optional.txt

Install PyPi release (from pip)

pip3 install nutra

(Note: use pip3 on Linux/macOS)

Update to latest

pip3 install -U nutra

Subscribe to the development release

pip3 install --pre -U nutra

Using the source-code directly

git clone
cd cli
git submodule update --init

pip3 install -r requirements.txt
./nutra init

or install from source,

git clone
cd cli
git submodule update --init

make install  # python3 --quiet install
nutra init

If installed or inside cli folder, can also run with python3 -m ntclient

When building the PyPi release use the commands:

make build  # python3 --quiet sdist
twine upload dist/nutra-X.X.X.tar.gz

Running tests

You will need the test dependencies. (Similarly, you will need the lint dependencies to run make lint)

For recent versions of Linux, macOS, and Windows:

pip3 install -r config/requirements-test.txt

For Windows XP (Python 3.4) use:

pip3 install -r config/requirements-win_xp-test.txt

To run the tests, run this in the cloned folder:

make test  # python3

Argcomplete (tab completion on Linux/macOS)

After installing nutra, argcomplete package should also be installed,

Simply run the following out of a bash terminal:


Then you can press tab to fill in or complete subcommands and to list argument flags.

Currently Supported Data

USDA Stock database

  • Standard reference database (SR28) [7794 foods]

Relative USDA Extensions

  • Flavonoid, Isoflavonoids, and Proanthocyanidins [1352 foods]


Requires internet connection to download initial datasets. Run nutra init for this step.

Run the nutra script to output usage.

Usage: nutra [options] <command>


usage: nutra [-h] [-v] [-d] [--no-pager]
             {init,nt,search,sort,anl,day,recipe,bio} ...

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -d, --debug           enable detailed error messages
  --no-pager            disable paging (print full output)

nutra subcommands:
    init                setup profiles, USDA and NT database
    nt                  list out nutrients and their info
    search              search foods by name, list overview info
    sort                sort foods by nutrient ID
    anl                 analyze food(s)
    day                 analyze a DAY.csv file, RDAs optional
    recipe              list and analyze recipes
    bio                 view, add, remove biometric logs

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nutra-0.2.2.tar.gz (45.4 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page