Skip to main content

cronopy

Unofficial cli for cronometer.

Install

uv sync

Usage

crono login -e you@example.com      # password is prompted (or pass -p)
crono search "chili" -n 10          # table output
crono search "chili" --json         # raw JSON
crono food 455715                   # measures of a food with grams and kcal
crono calories                      # consumed / burned / remaining for today
crono calories -d 2026-09-20 --json # another day, raw JSON
crono diary                         # servings logged today (entry ids)
crono add 455715 100 -m 1025057 -g breakfast -t 08:30   # food id, amount, measure id
crono remove 5207940830             # entry id from `crono diary`
crono whoami
crono logout

The session (cookies and user id) is stored in ~/.config/cronopy/session.json (or $XDG_CONFIG_HOME/cronopy/session.json) and reused by every command. GWT hashes are fetched on demand and never persisted, since they change with each Cronometer frontend deploy.

Library

With credentials (logs in lazily on first use):

from cronopy import CronometerClient

with CronometerClient(email="you@example.com", password="...") as client:
    results = client.search("chili", max_results=10)
    today = client.get_calories()  # CalorieSummary for today
    print(today.consumed, today.target, today.remaining)  # target = burned + weight goal

With a saved session (for example the one written by crono login):

from cronopy import CronometerClient, load_session, save_session

with CronometerClient(load_session()) as client:
    results = client.search("chili", max_results=10)
    if (updated := client.refresh_session()) is not None:
        save_session(updated)

An expired session raises NotAuthenticatedError. Handle it by calling client.login() (needs credentials) and retrying:

from cronopy import CronometerClient, NotAuthenticatedError, load_session

with CronometerClient(load_session(), email="you@example.com", password="...") as client:
    try:
        results = client.search("chili")
    except NotAuthenticatedError:
        client.login()
        results = client.search("chili")

Release files for cronopy 0.2.0

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

Source distribution (sdist)

Source distribution for cronopy 0.2.0
File Size Uploaded
cronopy-0.2.0.tar.gz 16.5 kB Details

Built distribution (wheel)

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

Total release size: 35.5 kB

Release files / cronopy-0.2.0.tar.gz

Download URL cronopy-0.2.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fba8246482c900d4b3a33732347009b17d282079a2538f79cfa9a8fe40c0b52e
BLAKE2b-256 checksum
How to use checksums
17e4823e2c125b073b86c879409baf59763661501542c15bf63182f047358365
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cronopy-0.2.0-py3-none-any.whl

Download URL cronopy-0.2.0-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e068384d00c567c1d1ba0dd8395d92e3c030dea7a8c919d9bd275b5e924f5e4
BLAKE2b-256 checksum
How to use checksums
a5f687af675556608c74e534acce4c0860eccee3588531d7b1b50f0d9375882c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.4.1

2 release files

0.4.0

2 release files

This release

0.2.0 This release

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