monthly-quota-pace v1.0.0
monthly-quota-pace
Crystal command line tool and library. Give it a CSV of the sends you made per day, a monthly quota, the month and today's date, and it shows how much of the quota is used, how much is allowed per remaining day, the projected month total at your average pace, the gap to the quota, the day the quota would run out at that pace, and the same projection from the last 7 days. It is arithmetic on the sends you list and a quota you set (--quota, a whole number of 1 or more, set by you): it knows no vendor's real bucket rules, calls nothing and reads no clock, because today comes from --today. Days with no row count as 0 sent. Rows outside the month, and rows after --today inside the month, are ignored and counted. A duplicate day inside the counted range is an error. The average per elapsed day is sent so far divided by the day of the month of --today; the projection is that average times the days in the month (leap years handled). The run out day is the smallest day number d where average times d reaches the quota, so it can be a day that has already passed when the quota is already used up; it shows "not within this month" when that day is beyond the last day and "n/a" when nothing was sent. Allowed per remaining day is quota left divided by days left, "n/a" with no days left or no quota left. The last 7 days average counts the 7 calendar days up to and including today, zero days included (fewer days early in the month). Figures with 1 decimal are computed from exact values and rounded half away from zero, so a gap can differ by 0.1 from the difference of two shown figures.
Part of the OneGTMLab free GTM tools. Background on the idea: EmailBison.
Install
shards build # then ./bin/monthly-quota-pace
Use
Input: CSV with the columns day (yyyy-mm-dd) and sent (a whole number, 0 or more), any order, header case does not matter, extra columns are ignored, a UTF-8 BOM and CRLF line endings are fine. Options, all required: --quota N, --month yyyy-mm, --today yyyy-mm-dd (must fall inside --month); the form --quota=N also works. A bad date or number (the message names the row, the header counts as row 1), --today outside --month, a missing option, a missing column, an empty file, no data rows or a missing file stops the run with a message and exit 1. In the example, the row from October is outside the month and the rows from 20 and 25 November are after today, so 3 rows are ignored, and the 4th, 5th, 11th and 12th have no row and count as 0.
$ bin/monthly-quota-pace sample.csv --quota 5000 --month 2026-11 --today 2026-11-18
month: 2026-11 (30 days)
today: 2026-11-18 (day 18)
rows outside the month ignored: 1
rows after today ignored: 2
quota: 5000 (set by you)
days elapsed: 18
sent so far: 3360
share of quota used: 67.2%
quota left: 1640
days left: 12
allowed per remaining day: 136.7
average per elapsed day: 186.7
projected month total at that pace: 5600.0
gap to the quota: over by 600.0
quota runs out at that pace: 2026-11-27
average of the last 7 days: 211.4
projected month total at the last 7 days pace: 6342.9
Test
crystal spec
Offline, no network calls, no dependencies beyond the language runtime. MIT licensed.
monthly-quota-pace
- 0
- 0
- 0
- 0
- 0
- about 4 hours ago
- November 29, 2026
MIT License
Sun, 29 Nov 2026 08:36:56 GMT