data-import
Technical notes on web development, DevOps, and AI integration.
4 articles
- 16:55backend
A Format-Aware Intake Converter for XLSX, DOCX, and PDF
A practical design for converting spreadsheets, Word documents, and PDFs into structured and readable intake digests.
TL;DR: This converter processes XLSX, DOCX, and PDF batches with format-specific readers under one shared workflow, leaving originals untouched. Spreadsheets get formula recalculation via headless LibreOffice, typed JSON, and Markdown output; Word and PDF convert to Markdown with layout limits and no OCR. Failures are logged per file while the batch continues, but a failing exit status flags results for review.
#python#data-import#automation - 20:16backend
Four Bars With the Same Name: An Import Key That Must Not Guess
A three-column natural key, a NULL-safe comparison, and a guard that fires before the first query.
TL;DR: Data was moved from an intake file into two tables. A key issue arose with duplicate organization names. The code was fixed to use a three-column key to prevent data loss.
#go#mysql#data-import - 04:28backend
Seed Migration and Status Mapping for Government Facility Data Import
Creating new categories through idempotent seed migrations, then importing facility data with status-based publish mapping for existing and planned facilities.
TL;DR: A missing Sarana Budaya category blocked importing eight cultural facilities, so the team added it via an idempotent seed migration using ON DUPLICATE KEY UPDATE. Existing facilities import as published, planned ones as drafts with admin notes. The importer ships with dry-run mode, a development-only guard, and slug-based deduplication for safe, repeatable runs.
#go#mysql#data-import - 04:23backend
Corrective Cultural Heritage Data: Pool Matching Without a Unique Key
The corrective import of PPKD cultural heritage data failed because the SK number wasn't unique. Candidate pools and overlap coefficient solve 1:1 matching.
TL;DR: Importing PPKD heritage data broke when SK numbers turned out to be shared across multiple objects, so direct key matching corrupted good records. The fix pairs each row with the best name match from an SK's candidate pool using the overlap coefficient, plus a used guard preventing double assignment. Column ownership rules keep verified coordinates and media untouched.
#go#mysql#data-import