
Converting YAML to a Markdown Table for Docs and READMEs
Generate a Markdown table from a YAML list in Python, escaping pipes, joining lists, handling blanks and keeping the table in sync with the YAML in CI.
Tag
134 posts

Generate a Markdown table from a YAML list in Python, escaping pipes, joining lists, handling blanks and keeping the table in sync with the YAML in CI.

Read a key, value and type sheet with openpyxl, build nested YAML from dotted keys, and keep versions, dates and blanks from changing on the way.

Turn CSV rows into a YAML list of mappings in Python, keeping zip codes as text and giving integers, floats, booleans and empty cells the right types.

Flatten a YAML list of service records into a CSV a reviewer can sort and filter, handling nested keys, list values, missing fields and Excel encoding.

Why a PUT drops fields, why dict.update clobbers nested objects, how absent differs from null in Pydantic, and how field-level SQL avoids lost updates.

Load a daily CSV in Airflow with one plain Python task instead of a chain of operators: idempotent by date, safely retried and testable outside Airflow.

A complete psycopg 3 script that stages a daily CSV with COPY, merges it with an upsert, records a content hash, and is safe to run again after a failure.

A short Python scanner that flags base64 blobs, percent-encoded text, script tags, formula starts and oversized fields in a CSV before you import it.

A plain SHA-256 of an email is reversible with a guess list. Use a keyed HMAC for tokens and partial masking for display, with a script that does both.

Convert JSON to YAML with a YAML library so strings like yes, 3.10 and 02134 keep their quotes, and see what string formatting does to the same data.

A small function that neutralizes formula triggers in CSV text cells, why negative numbers must be exempt, and a test table to keep the fix from regressing.

Convert YAML to JSON with PyYAML and json, and handle the cases that break it: dates, sets, integer keys, NaN, anchors, several documents and complex keys.