Repository navigation
v0.4.0
F&B Margin Kit 0.4.0 compares two explicitly entered menu plans, including selling prices, ingredient and packaging costs, platform fees and quantities.
Use --compare-menu proposed.csv with the same eight-column schema as the baseline. Both files must contain the same menu/category identities; their row order may differ. The command writes comparison.json and comparison.md beside the existing baseline reports. The comparison shows changed inputs, menu and category amounts, and proposed-minus-baseline totals.
Provide each plan's period-level channel costs separately with --channel-costs and --compare-channel-costs. An omitted cost CSV means zero additional channel costs for that side. The same supplied --fixed-cost applies to both plans.
For a menu with positive baseline contribution and positive proposed unit contribution, the report calculates the minimum whole quantity needed to retain the baseline menu contribution. This threshold uses exact rational arithmetic on the original price, VAT, fee and cost inputs, before period-level channel and fixed costs. Currency reports keep the existing 50-digit per-menu calculation and exact aggregation. Menus with nonpositive baseline contribution, zero proposed unit contribution or negative proposed unit contribution have distinct status values, and quantities beyond the CSV input limit are flagged.
All supplied CSVs are protected against direct, hard-link and symlink aliases of report outputs before files are written. The comparison option preserves the baseline JSON, Markdown and optional offline HTML reports. The release also includes the previously reviewed exact-aggregation and literal-Markdown-name fixes from PRs 7 and 8.
Assets include an installable dependency-free wheel, checksums, and a worked synthetic example. The example ZIP contains four input CSVs, the comparison results and baseline reports, with the regeneration command. In the example, a store latte's price changes from 5,500 to 6,050, ingredient cost from 1,200 to 1,350, and units from 100 to 90. Its original menu contribution requires at least 92 units under the proposed inputs.
Validation passed 85 unit tests and hosted Python 3.10, 3.12 and 3.14 checks. Independent review passed nine scenario probes with 461 exact assertions, 55 input-protection and error probes, and byte comparisons of 14 legacy report files. The tagged-source package workflow passed 32 installed-wheel execution checks and 31 linux/amd64 container checks, then published that tested container image.