Check CSV files before import: a worked example
Catch missing values, repeated IDs and invalid amounts before an import. This worked example shows the checks you could apply to a recurring CSV export. It is a static example using fictional data, not an interactive upload tool.
If you want editable Python code for running repeatable checks on your own computer, see the CSV Import Validator Kit. The kit requires Python 3.12+, a terminal and basic coding knowledge.
A small file with avoidable errors
Imagine you need to import this invoice export. The records below are fictional. Copying this example does not create or change any real invoice.
record_id,email,amount,invoice_date
INV-1001,alex@example.com,125.00,2026-11-01
INV-1002,,89.00,2026-11-02
INV-1002,sam@example.com,not-a-number,2026-02-30
INV-1004,lee.example.com,-40.00,2026-11-04
Define the rules before checking the file
- record_id: required and unique within this file.
- email: required, with a basic email format.
- amount: a number greater than or equal to zero for this example. Negative amounts may be legitimate in another workflow.
- invoice_date: a real calendar date in the format your destination expects.
These are example requirements, not universal accounting rules. Use the requirements of your actual destination system.
What needs attention?
| Record | Issue | Next action |
|---|---|---|
| First INV-1002 record | The email value is empty. | Check the original source and whether email is required for your import. |
| Second INV-1002 record | The reference repeats, the amount is not numeric, and 30 February is not a valid date. | Resolve the identity conflict and correct the values from an authoritative source. |
| INV-1004 | The email lacks an @ sign and the amount is below the example minimum. | Confirm the email and whether this should be a credit instead of a positive invoice. |
A basic format check does not prove an email address exists. A valid date does not prove it is the correct date. Passing these checks does not guarantee that another system will accept the file.
A repeatable import checklist
- Keep an untouched copy of the original export.
- Confirm the destination's column names, formats and required values.
- Run checks using rules appropriate to that destination.
- Investigate flagged records. Do not silently remove or invent values just to make a check pass.
- Check the corrected file again and test a small import where your destination supports it.
Turn recurring checks into a local Python workflow
The CSV Import Validator Kit — Python Source Code contains editable code for required values, unique columns, numeric bounds, allowed choices, basic email shape and calendar-date checks. It includes JSON reports, exit codes, valid and invalid examples, a setup guide and 20 automated tests.
The supplied code uses Python's standard library. It is a source-code kit for people comfortable with a terminal. It is not a browser app, managed import service or automatic data-repair tool, and it does not write to your database or include a Shopify-specific import schema.
View the kit, current price and download details
The commercial-use licence permits use, modification and integration in personal, internal and commercial end products, including client projects. Redistribution of the standalone kit is excluded. Read the product page and the included LICENSE.txt for the applicable terms and limitations.
Is it a fit?
Consider this kit if you repeatedly check CSV exports and want editable Python code you can adapt. If you need a point-and-click application, an accountant to review the data or someone to manage the import for you, this product does not provide those services.