
Converting a CSV Into a YAML List With Correct Types
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.
Older than half the tools that still emit it. Namespaces, XPath and getting rows out of feeds and exports.

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.

Measured heap needs for 36.6 MB of XML in Java: DOM fails at 256 MB, StAX with JAXB per record runs in 16 MB, and the memory is flat whatever the file size.

fast-xml-parser returns objects, but its defaults drop attributes and turn 007 into 7 and 29.50 into 29.5. Set the options, validate, and see the 4.4 s cost.

DOMParser reads XML in the browser but reports errors as a parsererror element, not an exception. Query with XPath, handle namespaces, compare with HTML mode.

Parse XML in Ruby with Nokogiri: xpath and at_xpath, BigDecimal for money, namespaces, strict versus lenient parsing, the noent option and Reader streaming.

Read XML in PHP 8.5 with SimpleXML, DOMXPath and XMLReader, avoid the boolean cast trap, handle namespaces and read parse errors with libxml_get_errors.

Read XML into Rust structs with quick-xml and serde, stream 200,000 orders in 0.09 seconds, and see how bad booleans and mismatched tags are reported.

Unmarshal XML into Go structs with tags, use a pointer for absent versus empty, catch bad booleans, and stream 200,000 orders in 0.8 seconds.

XmlSerializer writes xsi and xsd namespace declarations and a utf-16 header by default. Remove them, control attributes and lists, and see what it ignores.

Load XML into XDocument, query with LINQ, cast attributes and elements to typed values, handle namespaces, and avoid the culture trap in decimal.Parse.

Map XML to Java classes with Jakarta XML Binding, read attributes, lists and optional elements, and see a bad boolean and a bad number accepted silently.
We send one email when a new article is published. No spam.