
Analyzing Podcast and Blog Feeds From XML With Python
Turn an RSS podcast feed into cadence, duration and size numbers, handle itunes durations in two formats and RFC 822 dates, and compare with feedparser.
Older than half the tools that still emit it. Namespaces, XPath and getting rows out of feeds and exports.

Turn an RSS podcast feed into cadence, duration and size numbers, handle itunes durations in two formats and RFC 822 dates, and compare with feedparser.

Read the ECB daily reference rates XML: two namespaces, rates as attributes, 29 currencies, a 64-day history, and Decimal for the arithmetic.

Total amounts by currency and top SKUs over 20,000 invoices in one streaming pass with Decimal, 21 MB of memory, and the same USD total as a tree-based check.

Profile an XML file you have never seen in 0.2 seconds and 21 MB of memory, by counting every element and attribute path with iterparse, and read the profile.

A method for questions about an XML file nobody has converted: look, profile, sample, pick a tool, answer, then prove the numbers with a second method.

Which XSD edits break old documents, which break old consumers, and a script that tests six changes both ways against saved samples before you ship.

The same order checked three ways: XSD and RELAX NG passed a wrong total and a negative price, Schematron caught both, only RELAX NG took reordered children.

Ten XSD validation messages from libxml2, exactly as printed, what each one means in the document and the smallest change that makes it validate.

Build an XSD for an orders file step by step: sequence, pattern, enumeration, optional elements, required attributes and a decimal with attributes.

How to check XML files against an XSD: write the schema, run xmllint and lxml, read the errors, add Schematron for business rules, and test changes safely.

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.

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.
We send one email when a new article is published. No spam.