CLI that downloads marriage and impediment notice records from
https://oag.ecitizen.go.ke/notice-board/data/{marriages,impediments}
into SQLite, and uploads the original photos to an S3-compatible bucket.
Existing application_number rows are ignored on re-fetch.
go build -o bmd ./cmd/bmd./bmd fetch --db bmd.db --dataset all --page-size 30
./bmd stats --db bmd.dbWith S3 photo uploads and Cloudflare cookies:
BMD_COOKIE='cf_clearance=...' S3_ENDPOINT=https://s3.example.com S3_BUCKET=bmd-photos \
./bmd fetch --db bmd.db --max-pages 2 --verboseLegacy OAG_* env vars still work as fallback for BMD_*.
- Pages
?page=N&page_size=30per dataset (marriages,impediments). - Rows stored in SQLite table
marriage_notices,UNIQUE(kind, application_number), inserted withINSERT OR IGNOREso duplicates are skipped with photos untouched. marriagesare stored askind=domestic,impedimentsaskind=international. Upgrading keeps existing rows: the legacynoticestable is migrated and dropped.- New rows download both original photos (
/files/download?...) and upload to{prefix}/{kind}/{application_number}/{groom|bride}_original{ext}, recording the stored URL back in the row. - Without
S3_ENDPOINT+S3_BUCKET, rows are stored without photo upload.
See .env.example and bmd fetch --help.
mise run build
mise run fetch -- --dataset all --max-pages 2 --verbose
mise run fetch:marriages
mise run fetch:impediments
mise run stats -- --db bmd.db