PKT Reporter
From
TheCivvie@618:500/1 to
All on Sun Feb 1 13:21:32 2026
# pkt_report / pkt_indexerA small, practical toolkit for indexing, analysing, and reportingFidoNet-style packet and echomail traffic using
SQLite.Built for sysops who like clear stats, tidy reports, and scripts thatdon’t get in the way.Developed and used in real-world BBS /
FTN environments.-----------------------------------------------------------------------## 📦 What’s IncludedThis repository contains
three core tools that work together:### pkt_indexer.pyIndexes FTN packets and messages into a SQLite database.What it does:- Parses
incoming packet/message data- Stores per-message metadata- Tracks areas, posters, dates, sizes, and message characteristicsData captured
(depending on configuration):- Area name- Origin / poster- Message date- Message size (bytes)- Line count (excluding kludges)- Quoted
percentageThis script is normally run periodically or via cron as packets arrive.-----------------------------------------------------------------------### pkt_db_check.pyValidates and prepares the SQLite database
schema.What it does:- Checks the database exists and is accessible- Verifies required tables and columns- Creates missing tables/columns if
needed- Ensures schema compatibility with newer report featuresThis allows the reporter to evolve without breaking existing
databases.-----------------------------------------------------------------------### pkt_report.pyGenerates human-readable traffic reports
from the indexed data.Supported reports:- Daily traffic tables by area- Totals and per-day breakdowns- TOP reports (posters, areas, message
sizes)Notable features:- Clean day-based headers (robust across month changes)- Optional filtering by area or zone- TOP reports including:
- Total messages - Total bytes posted - Average message size - Largest individual messagesOutput is designed for terminal, email, or
BBS posting.-----------------------------------------------------------------------## 🛠 Requirements- Python 3.8+- SQLite3 (standard
library)- No third-party dependenciesTested on:- Linux (including Raspberry Pi)-
macOS-----------------------------------------------------------------------## 🚀 Typical Workflow1. Index packets as they arrive:
python3 pkt_indexer.py --folder /path/to/pkts --db pkt_index.db --delete2. Verify / inspect the database (safe to re-run): python3
pkt_db_check.py --db pkt_index.db3. Generate reports: python3 pkt_report.py --db pkt_index.db --date
WEEK-----------------------------------------------------------------------## 🧰 Usage / CLI### pkt_indexer.pyIndexes *.pkt files into
SQLite.Common options:- --folder, -f Folder containing .pkt files (default: current directory)- --db, -d SQLite database path
(default: pkt_index.db)- --recursive Scan subfolders for .pkt- --delete Delete .pkt files after successful import- --test
Parse and display data without writing to DBExamples:Index a spool directory recursively: python3 pkt_indexer.py -f
/home/fmail/ftn/inbound --recursive -d pkt_index.dbTest parsing without DB writes: python3 pkt_indexer.py -f /home/fmail/ftn/inbound
--testImport and delete packets after success: python3 pkt_indexer.py -f /home/fmail/ftn/inbound --recursive
--delete-----------------------------------------------------------------------### pkt_db_check.pyDatabase inspector / sanity
checker.Common options:- --db, -d SQLite database path (default: pkt_index.db)- --limit, -n Number of sample rows to display (default:
20)Example: python3 pkt_db_check.py -d pkt_index.db -n 50-----------------------------------------------------------------------###
pkt_report.pyGenerates traffic summary tables and TOP reports.Date range options (pick one):- --date WEEK | MONTH | CMONTH WEEK = last 7
days MONTH = previous calendar month CMONTH = current calendar month so far- --days N- --from YYYY-MM-DD --to YYYY-MM-DDReport
shaping:- --period auto | month | day- --area-width NArea inclusion / exclusion:- --known-areas FILE- --only-areas FILE- --exclude-areas
FILEFiles may be .txt (one area per line, # comments allowed) or .json.TOP mode:- --top ECHO Shows top posters and message-size
statistics (if size data exists)Examples:Last 7 days: python3 pkt_report.py -d pkt_index.db --date WEEKLast 30 days: python3
pkt_report.py -d pkt_index.db --days 30Explicit date range: python3 pkt_report.py -d pkt_index.db --from 2026-01-26 --to 2026-02-01Include
known areas: python3 pkt_report.py -d pkt_index.db --date WEEK --known-areas known.txtOnly selected areas: python3 pkt_report.py -d
pkt_index.db --date WEEK --only-areas areas.jsonExclude areas: python3 pkt_report.py -d pkt_index.db --date WEEK --exclude-areas
exclude.txtTOP report for one echo: python3 pkt_report.py -d pkt_index.db --date WEEK --top
MIN_CHAT-----------------------------------------------------------------------## 📊 Example OutputStatistics from 26-Jan-26 to
01-Feb-26Area 26 27 28 29 30 31 01 Total============================================================================MIN_CHAT 4 6 3 9 2
1 5 : 30MIN_WEATHER 1 0 2 1 0 3 2 :
9============================================================================TOTALS 5 6 5 10 2 4
7 : 39TOP message size example:=== TOP POSTERS BY TOTAL MESSAGE SIZE ===Poster Messages Total KB Avg KB Max
KB------------------------------------------------------Sean 42 418.2 9.9 22.1MurphyBot 18
146.5 8.1 18.6-----------------------------------------------------------------------## 🧠 Design Notes- Internal date keys are
used for correctness- Display formatting prioritises readability- Schema changes are handled defensively- Scripts are intentionally simple
and hackable-----------------------------------------------------------------------## 📜 LicenseMIT LicenseCopyright (c) 2026 Sean
Rima and MurphyPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation
files (the "Software"), to dealin the Software without restriction.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND.-----------------------------------------------------------------------## ☕ Final WordsIf you’re running an FTN-style system in
2026 and still care about good stats,this is for you.Pull requests welcome. Hacks encouraged. Coffee optional but recommended.
... TCOB1: binkd only binkd.rima.ie
--- FMail-lnx 2.3.2.6-B20251227
* Origin: TCOB1 A Mail Only System (618:500/1)