Repository navigation
What is it?
sms-toolkit turns Android SMS/call history into a clean, browsable archive.
SMS Backup & Restore makes full backups on every scheduled run, so a year of
daily backups is dozens of multi-GB XML files that are ~99% duplicates.
sms-toolkit streams those files, drops the duplicates by MD5 hash, and keeps
one SQLite database — importing only what's genuinely new, every time.
Highlights
- Streaming de-dup import —
smsandcallsimport XML backups in
append mode by default; already-imported messages are skipped, so
re-importing the same folder twice adds nothing. - Chat-style viewer —
servestarts a messaging-app-like web UI:
conversation list, sent/received bubbles, day dividers, inline MMS photos
with lightbox, plus an archive list view with search and pagination. - Normalization & contacts — canonical phone/date backfill and a
contacts table built from addresses (including multi-participant MMS),
both previewable before writing (--report,--dry-run). - IFTTT import, attachment export, year export — Excel-based IFTTT
ingestion, MMS parts out to files with CSVs, and one-year carves into
standalone databases. - Screenshot OCR — extract conversations from message-app screenshots
(four strategies) and fuzzy-match them against the database. - Diagnostics —
diagchecks integrity, row counts, tag breakdown,
date range, and MMS inventory with a 0/1 exit code.
Install
Requires Python 3.10+.
git clone
cd sms-toolkit
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[excel,viewer,ocr]"
Extras are independent: excel (IFTTT import), viewer (Flask UI),
ocr (screenshot extraction). The base install covers import, normalize,
contacts, exports, and diagnostics.
Verification
184/184 tests pass; ruff, ruff format, and mypy-strict green. The suite
includes differential tests that run the refactored code against the
original pre-refactor scripts on identical inputs, and the refactored
package preserves the originals' MD5 dedup hashes byte-for-byte (they are
primary keys in existing databases).