XML

Mark Carter cartermark46 at ukmail.com
Sat Jun 21 06:02:10 EDT 2003


> XML for ? is like CSV for a RDBMS

I couldn't resist mentioning YAML - a human-readable data
serialisation grammar. It's implemented in Python, and other
languages. It is something that I am only just getting into myself,
but so far I can see quite a few possibilities for it. I think that
where it scores big is that it allows humans to write structured data
to a file, which YAML can then process. YAML supports lists, arrays,
and a few other things.

Here's an example I found at http://www.yaml.org/spec/15may2001.html:

buyer    : %
    address     : %
       city       : Royal Oak
       line one   : 458 Wittigen's Way
       line two   : Suite #292
       postal     : 48046
       state      : MI
    family name : Dumars
    given name  : Chris
date     : 12-JAN-2001
comments :
    Mr. Dumars is frequently gone in the morning
    so it is best advised to try things in late
    afternoon. \nIf Joe isn't around, try his house\
    keeper, Nancy Billsmer @ (734) 338-4338.\n
delivery : %
    method : UZS Express Overnight
    price  : 45.50
invoice : 00034843
product : @
    %
        desc      : Grade A, Leather Hide Basketball
        id        : BL394D
        price     : 450.00
        quantity  : 4
    %
        desc      : Super Hoop (tm)
        id        : BL4438H
        price     : 2,392.00
        quantity  : 1
tax      : 0.00
total    : 4237.50




More information about the Python-list mailing list