
Converting Excel to JSON With Python for Clean Output
Convert an Excel sheet to JSON in Python: records, nested groups and JSON Lines, with typed values, ISO dates, nulls and a check that nothing was lost.
Everything you need to level up your coding skills.

Convert an Excel sheet to JSON in Python: records, nested groups and JSON Lines, with typed values, ISO dates, nulls and a check that nothing was lost.

Normalize phone numbers to E.164 with a regex and the phonenumbers library; the regex accepted 43.8% more numbers than the library calls valid.

A CSV has no NULL, so missing arrives as empty, a dash, N/A or null. Inventory the tokens, convert to real NA, keep the reason and see what fillna(0) does.

Parse $1,234.50, (12.50), 1.234,50 € and 7,00 into exact Decimals, find the cases where stripping symbols is wrong, and spot a column that mixes currencies.

Four formats in one date column, 959 values that are not dates and 15,642 that could be read two ways. Parse with explicit formats and report what you cannot.

Deduplicating a CSV is easy; deciding which duplicate to keep is not. Compare first, last, latest-signup and highest-balance keepers on 200,000 rows.

Trim padded CSV fields with pandas, the csv module, DuckDB and qsv, and see why strip() misses the zero-width space that still breaks an email match.

A cleaning pipeline that never edits the raw file, counts rows at every step and keeps rejects: 200,000 rows in 3.85 s, identical output twice.

Swift has no CSV parser in Foundation, and its String treats CRLF as one Character, so splitting on a newline fails. Parse bytes or use SwiftCSV.

Read a CSV in Kotlin with kotlin-csv and build a small import job that validates rows, rejects bad ones with row numbers and never hides a failure.

A bash read loop on a CSV breaks on quoted commas, backslashes, a missing last newline and empty tab fields. Let a CSV parser emit safe records first.

Parse CSV in Ruby 3.4 with the csv gem: the Gemfile LoadError, a numeric converter that read 02134 as 1116, nil versus empty strings, and timings.
We send one email when a new article is published. No spam.