
Reading and Writing YAML in Python Safely and Cleanly
A tested Python guide to YAML: safe loading, speed, strict keys, validation, clean output, round trips, merging, env substitution and a reference module.
Everything you need to level up your coding skills.

A tested Python guide to YAML: safe loading, speed, strict keys, validation, clean output, round trips, merging, env substitution and a reference module.

Build XML from CSV rows without string templates that break on an ampersand. Use lxml or escape every value, and handle control characters and empty cells.

Translate IF, nested IF, IFS and SWITCH into SQL CASE WHEN, with AND and OR, NULL handling, branch types and what each returns when nothing matches.

Add, rename, merge and delete keys and array elements in PostgreSQL JSONB with jsonb_set, jsonb_insert, || and minus, and see where each does nothing.

Error 1290 blocks LOAD DATA INFILE and INTO OUTFILE outside one directory. Find the allowed path, move the file there, or switch to LOCAL and know the cost.

Translate COUNTIF, COUNTIFS, COUNTA and COUNTBLANK into SQL with count star, count of a column and FILTER, and handle distinct counts and blanks correctly.

Every clause of LOAD DATA INFILE that matters for a CSV, from the tab default to NULL handling, with the output of each variant on MySQL 8.4.

Convert an XML config to YAML so a person can read and diff it, and learn why a YAML 1.1 loader turns the strings no and NO into false and 0755 into 493.

Change a single field in a PostgreSQL JSONB document with jsonb_set or subscripts, increment a counter, and avoid the lost-update and rewrite costs.

LOAD DATA LOCAL turns bad values into warnings and still reports success. Import a CSV into MySQL safely, with a script that checks before it swaps.

Find tabs and non-breaking spaces in YAML with grep, cat -A and git grep, fix them with sed or expand, and keep them out with editor settings and a hook.

Translate SUMIF and SUMIFS into SQL with WHERE, GROUP BY and FILTER, including criteria, wildcards, dates, OR conditions and the blank and case traps.
We send one email when a new article is published. No spam.