The guide library
Find the right workflow.
Start with the task and input you have. All 14 guides include a complete local Python script, a reproducible example, and stated limits.
Download the scripts and tests (ZIP)
Python scripts, tests, and ready-to-run merge, join, and date practice files with expected results. No signup required.
New to the examples? Start with the two-file merge practice. Extract the whole ZIP, then follow its fixtures/README.md. Ready-made input and expected-result files cover merge, join, and date auditing; the other guides show how to create their samples.
Prepare the CSV format
Choose the step for the format problem you actually have. Encoding conversion expects comma CSV; it is not a general legacy-encoded TSV converter.
Convert a CSV to UTF-8 in Python Without Guessing Its Encoding
Convert a CSV from an explicit source encoding to UTF-8, validate its records, preserve text and line endings, and refuse to overwrite existing files.
Input to prepare: Comma-separated text and a source encoding confirmed by the producer.
Convert TSV or Semicolon-Delimited Files to CSV in Python
Convert tab, semicolon, or pipe-delimited exports to comma CSV using an explicit delimiter and expected header, preserving text and quoted records.
Input to prepare: UTF-8 text, a known delimiter, and the complete expected header in order.
Select and Reorder CSV Columns in Python Without Editing the Original
Export only named CSV columns in a fixed order, preserve text IDs and records, and stop on missing headers or malformed rows without editing the source.
Input to prepare: Comma-delimited UTF-8 and the exact column names required by the receiver.
Combine or reconcile records
Merge stacks rows. Join adds lookup fields. Compare reports snapshot changes. Deduplicate keeps the first row for a chosen key and audits later occurrences. Choose the operation before choosing a script.
Merge CSV Files in Python Without Repeating Headers
Combine CSV exports with one header, preserve text IDs, and reject mismatched columns before writing a report.
Input to prepare: A folder of UTF-8 CSV files with identical column names and order; repeated records are retained.
Join Two CSV Files by Key in Python and Report Unmatched Rows
Join orders to a unique lookup key, preserve every left row, reject ambiguous matches, and report unmatched records in a separate CSV.
Input to prepare: Two UTF-8 CSV files with the same key-column name; the lookup key must be unique.
Compare Two CSV Files by ID: Added, Removed, and Changed Rows
Compare snapshots by a unique text ID, report changed fields, and reject ambiguous duplicate records.
Input to prepare: Two UTF-8 CSV snapshots with the same column set and a unique ID in each.
Remove Duplicate CSV Rows by Column in Python, with an Audit File
Remove duplicate CSV records by exact column keys, keep the first occurrence, and audit conflicting values without editing your source file.
Input to prepare: A UTF-8 CSV, explicit record-key columns, and a justified first-occurrence policy.
Validate or export data
Check a format or value contract, or prepare a different output shape. These are independent tools: review each result before passing it to another step.
Validate Mixed Date Formats in a CSV Without Guessing Day and Month
Audit mixed CSV dates with explicit formats, reject ambiguous day/month values, and retain original records alongside a separate issue report.
Input to prepare: A UTF-8 CSV, a named date column, and formats confirmed by the source owner.
Validate JSONL in Python and Report the Broken Lines
Check JSONL records locally and report malformed lines, duplicate keys, blank lines, and non-standard constants.
Input to prepare: UTF-8 JSONL with one object per physical line; this validator rejects a leading BOM.
Convert CSV to JSON in Python Without Losing Leading Zeros
Convert CSV to a JSON array while preserving leading-zero IDs, choosing empty-value handling, and rejecting duplicate headers or malformed records.
Input to prepare: Comma-delimited UTF-8 CSV; confirm whether empty cells should stay strings or become null.
Export Nested JSON to CSV Without Losing Missing or Null Values
Export selected nested JSON fields to CSV with explicit key paths, keep arrays in one cell, and distinguish missing, null, empty, and blocked values.
Input to prepare: A JSON array of objects and a separate mapping of output columns to object-key paths.
Split a CSV File in Python and Keep the Header in Every Part
Split a CSV by record count, repeat its header, preserve quoted newlines, and identify incomplete runs.
Input to prepare: A UTF-8 CSV and a maximum number of data records per part, not a byte-size limit.
Inspect files and folder copies
Use file hashes for byte-content questions. Use CSV comparison above for logical records: changing row order changes file bytes even when the records agree.
Find Duplicate Files in Python Without Deleting Anything
Build a read-only SHA-256 duplicate-file report with a reproducible sample and no deletion commands.
Input to prepare: One quiet local folder; only its direct regular, non-symlink files are scanned.
Verify a Folder Copy with Python SHA-256 File Manifests
Create SHA-256 file inventories and compare a folder copy for added, missing, or changed files using a reproducible example.
Input to prepare: Quiet local source and copy trees; inventory reports must be outside the scanned folders.