Information estates
Reliable data imports keep evidence separate from interpretation
An import can complete successfully while assigning the wrong identity, losing precision or hiding an unreadable value. Reliable applications preserve the source and make each interpretation explainable.

A spreadsheet uploads, the progress bar reaches its end and a web application reports success. That result can mean several different things: the file arrived, the parser understood its structure, records were created, or the records were checked against something authoritative.
Those meanings shouldn't share one green status. A parser can read every cell and still attach a value to the wrong record. A normalisation rule can turn an unfamiliar notation into something plausible while discarding the evidence needed to question it later.
When I design an import workflow, I want a clear separation between the original material, the interpretation produced by software and the decision a person makes from that interpretation. Keeping those layers distinct makes corrections possible without rewriting the past.
Preserve the original before deriving records
Retain the original bytes as a separate source object, subject to the application's access and retention rules. Record the arrival time, source identifier and a cryptographic digest. Python's hashlib documentation describes SHA-256 support for calculating such a digest.
A digest helps show that two byte sequences match, provided you trust where the reference digest came from. It doesn't establish who authored a document or whether its contents are true. Treat authorship and provenance as separate questions, and don't ask the hash to prove more than it can.
Don't repair an original file in place when parsing fails. Retain a corrected upload as a new source version and record its relationship to the earlier one. If the application transforms the file for display, make the distinction between source and preview clear.
Preserving evidence doesn't mean every uploaded file should be served back to the browser unchanged. Apply upload controls and access restrictions before making material available. OWASP's file-upload guidance covers type validation, storage isolation and other controls that belong around the ingestion boundary.
Keep location and meaning together
A derived value needs enough context to be traced back to its origin. For a workbook, that might include the source version, worksheet, cell and relevant heading. For a delimited file, it might be a row number, field name and the original text.
Store the observed representation alongside the interpreted value where their difference matters. A blank field, a zero, an unreadable string and a missing column describe different situations. Turning all four into a null value may simplify an API while making the underlying problem impossible to explain.
Formula cells need particular care. The openpyxl reader documentation distinguishes reading a formula from reading the value stored the last time Excel read the sheet. openpyxl doesn't recalculate anything, so the cached value is only whatever the last application to save the file wrote. On its own, it can't tell you whether it's current. Files saved by tools that don't calculate formulas, openpyxl included, may have no cached value at all.
Define how the application handles a missing cached result. It could require a fresh export or route the file for review. Silently substituting a plausible value changes the evidence rather than importing it.
Resolve identity before relying on a comparison
Take a simple example: two delivery records share a reference, but the source doesn't establish which customer each belongs to. Matching by the reference alone can produce a technically successful import and a commercially incorrect result.
Record the identity evidence and the rule used to select a record. If two candidates remain, keep the ambiguity visible. A similarity score can help prioritise review, but it shouldn't quietly become permission to merge records.
Manual resolution needs its own history. Record the actor, selected identity, reason and source versions considered. A later upload might supply contradictory evidence, and the application should be able to explain why an earlier decision was made.
Keep identity confidence separate from agreement between values. Two equal numbers don't establish that the documents refer to the same thing. Conversely, a reliable identity match doesn't make conflicting values agree.
Define numeric interpretation explicitly
Decide how numbers are read, compared and displayed before implementing a status rule. Units, decimal separators, rounding and the meaning of an empty field can all affect the result.
Python's Decimal documentation explains why decimal representations can be preferable to binary floating point for exact decimal comparisons. Constructing a decimal from source text avoids first introducing a binary approximation, provided the text hasn't already been through a float. openpyxl, for example, hands numeric cells back as floats. The application still needs an explicit precision and rounding policy for the arithmetic it performs.
For the delivery example, a quantity of 1.20 may have the same numeric value as 1.2 while retaining a different displayed precision. Whether that distinction matters is a domain decision. Keep it where it's relevant; don't let the data type decide for you.
Test boundary values and unsupported formats. A value just outside an allowed range, an unknown unit and an empty field should each produce its own intended result.
Version the interpretation and the decision
Reprocessing an unchanged file with an improved parser may produce a different interpretation. Keep the source version, parser version, rules version and run identifier with the result. That allows a reviewer to distinguish new evidence from new software behaviour.
Don't overwrite an accepted historical result without recording that transition. Show which run is current, which it supersedes and why. Corrections become easier to review when the old result remains explainable.
For long-running processing, expose the stages honestly: received, queued, parsing, awaiting review, completed or failed. A retry should have a defined relationship to the earlier attempt. My earlier piece on partial failure in automation explains why an interrupted workflow needs more information than a failed badge.
Test the awkward records with synthetic fixtures
Build a small set of invented inputs covering duplicate identities, changed layouts, missing fields, stale formula results, unusual number formats and conflicting evidence. Give each an independently stated expected outcome.
Check the user-facing explanation as well as the stored result. A correct classification with no route back to the source can still leave the person reviewing it unable to act.
A useful completion message is specific: these sources produced these interpretations under these rules, and these questions are still open. An application earns trust when it can keep that explanation intact through corrections, retries and later changes.