touch-frequency-cap-check v1.0.0

Crystal command line tool: contacts touched more often than a cap you set in the last days you set, with the channel split, from a CSV of touches.

touch-frequency-cap-check

Crystal command line tool and library. Give it a CSV of outreach touches (contact, channel, date), the date you call today, a window of days and a cap, and it lists the contacts who were touched more than the cap inside the window. The window is the last N calendar days including today: a touch counts when today minus touched_on is between 0 and N - 1 days. The window length (--days, default 14) and the cap (--cap, default 3) are set by you, and the tool knows no rule about how often is too often. It never reads the clock: --today is required, so the output is the same every time. Contacts and channels are trimmed and compared without regard to case, and the first spelling seen is shown.

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

Install

shards build   # then ./bin/touch-frequency-cap-check

Use

Input: CSV with the columns contact, channel and touched_on (yyyy-mm-dd), any order, header case does not matter. Options: --today yyyy-mm-dd (required), --days N (above 0, default 14), --cap N (above 0, default 3); --opt=value also works. Output: rows, rows inside the window, contacts with at least one touch in the window, contacts over the cap (touches above the cap: count and share of those contacts, 1 decimal), the first 20 of them (touches, then the channels used; sorted by touches, most first, then contact), contacts exactly at the cap, and touches per channel inside the window with their share (1 decimal). A bad date, a touch dated after --today (the message names the row, the header counts as row 1), a missing --today, a bad --days or --cap, a missing column, an empty file or a missing file stops the run with a message and exit 1. In the example, 6 of the 7 contacts have a touch in the window (d@example.com was last touched before it, and one touch of c@example.com is a day too old), 3 of the 6 are over the cap and 1 is exactly at it.

$ bin/touch-frequency-cap-check sample.csv --today 2026-01-15 --days 14 --cap 3
window: last 14 days, 2026-01-02 to 2026-01-15 (today)
cap: 3 touches
rows: 21
rows inside the window: 19
contacts with at least one touch in the window: 6
contacts over the cap: 3 (50.0% of those contacts)
contacts exactly at the cap: 1

over the cap
contact        touches  channels used
g@example.com  5        email, linkedin, phone
a@example.com  4        email, linkedin, phone
e@example.com  4        email, linkedin, phone

touches per channel inside the window
channel   touches  share
email     9        47.4%
linkedin  6        31.6%
phone     4        21.1%

Test

crystal spec

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

Repository

touch-frequency-cap-check

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • about 2 hours ago
  • November 29, 2026
License

MIT License

Links
Synced at

Sun, 29 Nov 2026 05:05:14 GMT

Languages