Skip to main content

Nutrilog

Write explicit nutrient data to Google Health.

nutrilog auth login
nutrilog log "Bean salad" --grams 350 --kcal 420 --protein 25 --fat 12 --carbs 48
nutrilog log --input meal.json
cat meal.json | nutrilog log --input -
nutrilog history
nutrilog history yesterday
nutrilog history 2026-08-17 2026-08-23
nutrilog history '2026-08-22T20:00:00+10:00' '2026-08-23T01:00:00+10:00'
nutrilog duplicate POINT_ID --protein 0
nutrilog delete POINT_ID

JSON input is a flat item carrying name, meal_type, optional time, optional grams, and nutrient fields. Omit time to use the device's current local time. Every new entry needs kcal, protein, fat, and carbs; explicit zero is a valid value. Use --nutrient NAME=GRAMS for another nutrient; names come from mealtime-nutrients, the list the mealtime tools share, which holds exactly one per nutrient. Dietary fibre is fiber, and carbohydrate has its own field, so it is carbs and never carbohydrates. Explicit flags override the input. Piped tool output keeps its {"ok":true,"data":...} envelope, and a field this version has not heard of is dropped, so the other tools stay free to add one. A bare JSON object is read as hand-written instead: an unrecognised key there is an error, rather than a nutrient quietly left out of the entry. grams is written to Google as a gram serving and survives reads. When it is absent, the shared format treats the nutrients as a 100 g fallback.

duplicate always keeps the source and accepts the same overrides as log. To correct an entry, duplicate it with the correction, inspect the result, then delete the source explicitly. JSON overrides may use null to remove a value.

Output carries kcal, protein, fat and carbs always, plus only the nutrients the entry states; an absent key and a null mean the same, while an explicit zero survives. Missing legacy Google core macros render as zero in Nutrilog output. Unstated nutrients are omitted from writes. --dry-run --json shows the record without authenticating or writing.

nutrilog history reads today by default. Pass one date for that day or two dates for an inclusive range; dates may be ISO dates, today, or yesterday. Dates become UTC bounds using the device's local timezone. Offset-aware ISO datetimes are exact bounds; the end datetime is exclusive. Entries are then compared only in UTC. Core macro totals are always present. Every other nutrient is totalled only when an entry states it, over the entries that state it, so a total may cover part of the range.

OAuth tokens remain in ~/.config/nutrilog/tokens.json with mode 0600.

Release files for nutrilog 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nutrilog 0.5.1
File Size Uploaded
nutrilog-0.5.1.tar.gz 52.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nutrilog 0.5.1
File Interpreter ABI Platform
nutrilog-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 73.9 kB

Release files / nutrilog-0.5.1.tar.gz

Download URL nutrilog-0.5.1.tar.gz
Size 52.5 kB
Tags Source
SHA-256 checksum
How to use checksums
288910a1c87553a384ab7fa69ed432011c5cc4d682f403590afe8232aee44719
BLAKE2b-256 checksum
How to use checksums
c03b0fd409aad9f73b5b79373c9f5dcc0f8511be2cf0ef9b932656ac9b90d2c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / nutrilog-0.5.1-py3-none-any.whl

Download URL nutrilog-0.5.1-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e25f4d67c6a8bc846164c90b6590e2f0e277f80befa89263198f219d3fa0e03
BLAKE2b-256 checksum
How to use checksums
089a07bc6a33b5f5fa2cf2d007df16fece77f47dc287dc340044b162e22848f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page