Elixir library and Mix task. Give it a CSV of the credits your data tool spent each day and the number of credits you have left today. It shows the days covered, the total used, the average per day over the whole range and over the last few days, the highest day, how many days the balance lasts at the recent pace and the date it runs out.

Days without a row between the first and the last date count as 0 credits, and several rows for one date are added together. The recent pace is the credits used in the last --window days divided by --window (default 7, set by you, not a rule). Runway in days is the balance divided by that recent daily average, and the run-out date is the last date plus the whole days of the runway (rounded down). When the recent average is 0 it prints "not at the current pace". Averages and the runway are exact integer arithmetic rounded half up to one decimal. Extra columns are ignored. A missing --balance, a balance or window that is not above 0, a window larger than the number of days, a missing file, a bad date, a credit count that is not a non-negative whole number or no rows stops the run with an error and a non-zero exit.

Part of the OneGTMLab free GTM tools. Background on the idea: GTM engineering.

Install

{:credit_runway, "~> 1.0"}   # in mix.exs deps

Use

CSV columns: date (yyyy-mm-dd), credits_used. Options: --balance N (required, credits left today), --window D (default 7).

$ mix credit_runway sample.csv --balance 5000
days covered: 10 (2026-03-01 to 2026-03-10)
total credits used: 1050
average per day (all 10 days): 105.0
average per day (last 7 days): 107.1
highest day: 2026-03-08 (200)
balance: 5000
runway: 46.7 days
runs out on: 2026-04-25

Test

mix test

Offline, no network calls, no dependencies beyond the language runtime. MIT licensed.