Skip to content

Changelog

jsem-nerad edited this page Nov 23, 2026 · 7 revisions

Changelog

The full changelog lives in the repository: CHANGELOG.md

0.6.0

An MCP server. strava-cz mcp serves the canteen to an AI agent over MCP (stdio), built on the official SDK and installed with the new mcp extra: pip install "strava-cz[mcp]". It signs in through the same profiles as the command, and a password is never an argument of a tool. The tools follow the command: get_menu, get_ordered, get_balance, get_account, order_meals and cancel_meals, with the same filters and options and the same JSON as --format json.

Ordering and cancelling are on by default. strava-cz mcp --read-only does not register those two tools at all. Read tools carry readOnlyHint, write tools destructiveHint. Failures come back as tool errors that name the exception and its reason. See MCP Server.

The library and the existing commands are unchanged. The README is now short and points here for the details.

0.5.0

Meal ids no longer cross logins. The canteen numbers its menu afresh at every login, and every run of strava-cz is a new login, so a number read from strava-cz menu could be a soup in the next run (a refusal giving another meal's reason) or an orderable meal on another day (ordered with exit code 0). In the command, a meal id is now the day and the slot, such as 2026-11-09:O2, in the tables, in the JSON and as the argument to order and cancel. A bare number is refused with exit code 2. This changes the command's interface and its JSON: id is now a string. See Command Line.

The library stays compatible. Meal.key, Meal.kind_code and Menu.get_by_key() are new, and order_meals(), cancel_meals(), is_ordered() and in take a key as well as an id. The check after a write looks each meal up by its key, and reports the write as unconfirmed if that slot has gone.

A live test on a real account found the rest.

  • A session reset renumbers the menu too, and a rollback resets. A retry in the same login could order another meal on another day, so a number read before a reset is now refused with MenuNotFetchedError until you fetch(). Keys keep working.
  • A failure during a write now tells the truth about the account. A timeout on the save reads back what happened, and when that isn't possible the new OrderNotConfirmedError says so.
  • Each login reads its own copy of the orders, so the old check after a write couldn't see a save that did nothing. verify_saved=True checks the canteen's records, and the command always does.
  • With --continue-on-error the exit code was always 4. It is now 5 for money and 1 for a network or canteen failure.
  • --dry-run now predicts the real call, including that one refusal stops a batch without --continue-on-error.
  • An expired session is now AuthenticationError (API code 15), and logout() no longer leaves a client that refuses to log in again.

0.4.0

A strava-cz command and stored profiles. The library API is unchanged from 0.3.0.

The command line. strava-cz exposes everything the library does — menu, ordered, order, cancel, balance, account, raw and profile. It prints a readable table by default and one JSON object with --format json, with every diagnostic pushed to stderr so the stream stays parseable. Exit codes 0–6 let a shell tell a rejected login from an unorderable meal from an empty account. --dry-run on order and cancel works out what would change and sends nothing. See Command Line.

Profiles. strava-cz profile add stores the username and canteen number in $XDG_CONFIG_HOME/strava-cz/profiles.json (0600, atomic writes) and puts the password in the OS keyring — never in that file, unless you explicitly ask for --secret file. StravaCZ.from_profile() uses the same profiles from Python. On a machine with no keyring the command says so and names the alternatives rather than quietly writing the password somewhere less safe. See Profiles.

Colour is now emitted only to a terminal, and NO_COLOR is honoured.

0.3.0

A large fix-up and rewrite, with breaking changes: meals and days are proper objects instead of dictionaries, and filtering has different defaults.

The headline fix. Orderability was being read from the wrong field. The library looked only at the day-level omezeniObj.den code and ignored obj and zm, which are the per-meal fields that actually decide it. Days carrying the code "T" were treated as unorderable and vanished from the default listing — four of twenty usable days on the account used for verification — and on menus where den was set on every meal, get_days() returned an empty list.

den is now parsed into a DayStatus rather than left as a raw string, and "T" has a meaning: the canteen's standing order does not cover that day. Its meals are perfectly orderable by hand, they just never appear on their own. Day.auto_ordered and the auto_ordered filter expose it, which is what an automatic ordering tool needs. See Meals and Restrictions and API Internals.

Also fixed: soups reported as freely orderable despite the API marking them otherwise; user.balance arriving as a string you could not do arithmetic on; cancel_meals() reporting success for ids that did not exist; requests sent when there was nothing to change; continue_on_error=True raising anyway; a missing field in the API response taking down the whole fetch; no request timeouts; network I/O in the constructor; and three tests that sent real traffic to app.strava.cz on every CI run.

New: Meal, Day, Allergen and OrderResult dataclasses; the Restriction enum; can_order / can_cancel; orderable, date_from, date_to and include_no_school filters; context-manager support; configurable timeout, retries and HTTP client; a richer exception hierarchy; py.typed.

Changed: requests → httpx; attribute access instead of dictionary keys (meal.name, not meal["name"]); meal.date is a datetime.date; OrderType replaced by Restriction; filters no longer hide anything by default; Python 3.10+.

0.2.0

Introduced the Menu class, the MealType and OrderType enums, filtering by meal and order type, duplicate detection, balance tracking and rollback on failure.

0.1.x

First public releases: login, menu listing, ordering, PyPI packaging and CI.

Clone this wiki locally