Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Being overloaded is the sign of a true Debian maintainer. -- JHM on #Debian


devel / comp.lang.python / XML Considered Harmful

SubjectAuthor
* XML Considered HarmfulMichael F. Stemper
+- Re: XML Considered HarmfulJon Ribbens
+* Re: XML Considered Harmfulalister
|`* Re: XML Considered HarmfulMichael F. Stemper
| +* Re: XML Considered HarmfulPete Forman
| |+* Re: XML Considered HarmfulJon Ribbens
| ||`- Re: XML Considered HarmfulPete Forman
| |`- Re: XML Considered HarmfulMichael F. Stemper
| +- Re: XML Considered Harmfulalister
| +* Re: XML Considered HarmfulEli the Bearded
| |+- Re: XML Considered HarmfulJoe Pfeiffer
| |`* Re: XML Considered HarmfulMichael F. Stemper
| | +* Re: XML Considered HarmfulDennis Lee Bieber
| | |`- Re: XML Considered HarmfulMichael F. Stemper
| | `* Re: XML Considered HarmfulChristian Gollwitzer
| |  `* Re: XML Considered HarmfulEli the Bearded
| |   +- Re: XML Considered HarmfulMichael F. Stemper
| |   `* Re: XML Considered HarmfulChris Angelico
| |    `* Re: XML Considered HarmfulEli the Bearded
| |     `- Re: XML Considered HarmfulChris Angelico
| `* Re: XML Considered Harmfuldn
|  `* Re: XML Considered HarmfulStefan Ram
|   +- Re: XML Considered HarmfulChris Angelico
|   +- Re: XML Considered HarmfulDan Stromberg
|   +- Re: XML Considered HarmfulChris Angelico
|   `- Re: XML Considered Harmfuldn
+* Re: XML Considered HarmfulStefan Ram
|`- Re: XML Considered HarmfulJoe Pfeiffer
+- Re: XML Considered HarmfulEthan Furman
+- Re: XML Considered HarmfulDan Stromberg
+- Re: XML Considered HarmfulDennis Lee Bieber
+* Re: XML Considered HarmfulMark Lawrence
|+- Re: XML Considered HarmfulMichael F. Stemper
|+* Re: XML Considered HarmfulMostowski Collapse
||`- Re: XML Considered HarmfulMostowski Collapse
|`* Re: XML Considered HarmfulMostowski Collapse
| `* Re: XML Considered HarmfulMostowski Collapse
|  `- Re: XML Considered HarmfulMostowski Collapse
+- Re: XML Considered HarmfulMats Wichmann
+- Re: XML Considered HarmfulChris Angelico
+* RE: XML Considered HarmfulAvi Gross
|+* Re: XML Considered HarmfulStefan Ram
||+- RE: XML Considered HarmfulAvi Gross
||`- Re: XML Considered HarmfulJon Ribbens
|`- Re: XML Considered HarmfulStefan Ram
+- Re: XML Considered HarmfulJulio Di Egidio
+* Re: XML Considered HarmfulPeter J. Holzer
|`- Re: XML Considered HarmfulGreg Ewing
+* Re: XML Considered HarmfulPeter J. Holzer
|`- Re: XML Considered HarmfulGreg Ewing
+- Re: XML Considered HarmfulPeter J. Holzer
+* Re: XML Considered Harmfuldn
|`- Re: XML Considered HarmfulGreg Ewing
+* Re: XML Considered HarmfulChris Angelico
|+* Re: XML Considered HarmfulJon Ribbens
||`* Re: XML Considered HarmfulPeter J. Holzer
|| `- Re: XML Considered HarmfulJon Ribbens
|`- Re: XML Considered HarmfulGreg Ewing
+- Re: XML Considered HarmfulDavid L Neil
+- Re: XML Considered HarmfulKarsten Hilbert
+* Re: XML Considered HarmfulMichael F. Stemper
|+* Re: XML Considered HarmfulStefan Ram
||+- Re: XML Considered Harmfuldn
||`- Re: XML Considered HarmfulPaul Rubin
|+* RE: XML Considered HarmfulAvi Gross
||`* Re: XML Considered HarmfulMichael F. Stemper
|| +* RE: XML Considered HarmfulAvi Gross
|| |`* Re: XML Considered HarmfulMichael F. Stemper
|| | +* Re: XML Considered HarmfulStefan Ram
|| | |`* Re: XML Considered HarmfulMichael F. Stemper
|| | | +- Re: XML Considered HarmfulKarsten Hilbert
|| | | +* Re: XML Considered HarmfulStefan Ram
|| | | |`- Re: XML Considered HarmfulChris Angelico
|| | | `- Re: XML Considered Harmfuldn
|| | +- RE: XML Considered HarmfulAvi Gross
|| | `* Re: XML Considered HarmfulGreg Ewing
|| |  `* Re: XML Considered HarmfulMichael F. Stemper
|| |   `- RE: XML Considered HarmfulAvi Gross
|| `* Re: XML Considered HarmfulPeter J. Holzer
||  `* Re: XML Considered HarmfulMichael F. Stemper
||   `* RE: XML Considered HarmfulAvi Gross
||    `* Re: XML Considered HarmfulMichael F. Stemper
||     `- RE: XML Considered HarmfulAvi Gross
|+* Re: XML Considered Harmful2QdxY4RzWzUUiLuE
||`* Re: XML Considered HarmfulMichael F. Stemper
|| `- Re: XML Considered HarmfulChris Angelico
|`- Re: XML Considered Harmfuldn
`- Re: XML Considered Harmfuldn

Pages:1234
XML Considered Harmful

<sid7a6$kcu$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19689&group=comp.lang.python#19689

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: michael.stemper@gmail.com (Michael F. Stemper)
Newsgroups: comp.lang.python
Subject: XML Considered Harmful
Date: Tue, 21 Sep 2021 13:12:10 -0500
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <sid7a6$kcu$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 21 Sep 2021 18:12:22 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4f3ba84ed9c94cb44b19172b401ba190";
logging-data="20894"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+wYm6/HR6tuMDdjGVMR6HGrWRez/e3DHc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
Cancel-Lock: sha1:Fao7fWQVMUybEH2xE0M6uIeNO2w=
Content-Language: en-US
X-Mozilla-News-Host: news://news.eternal-september.org:119
 by: Michael F. Stemper - Tue, 21 Sep 2021 18:12 UTC

On the prolog thread, somebody posted a link to:
<https://dirtsimple.org/2004/12/python-is-not-java.html>

One thing that it tangentially says is "XML is not the answer."

I read this page right when I was about to write an XML parser
to get data into the code for a research project I'm working on.
It seems to me that XML is the right approach for this sort of
thing, especially since the data is hierarchical in nature.

Does the advice on that page mean that I should find some other
way to get data into my programs, or does it refer to some kind
of misuse/abuse of XML for something that it wasn't designed
for?

If XML is not the way to package data, what is the recommended
approach?
--
Michael F. Stemper
Life's too important to take seriously.

Re: XML Considered Harmful

<slrnskk9sp.4gd.jon+usenet@raven.unequivocal.eu>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19690&group=comp.lang.python#19690

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jon+usenet@unequivocal.eu (Jon Ribbens)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Tue, 21 Sep 2021 18:42:33 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <slrnskk9sp.4gd.jon+usenet@raven.unequivocal.eu>
References: <sid7a6$kcu$1@dont-email.me>
Injection-Date: Tue, 21 Sep 2021 18:42:33 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="97ed41b2128d0d77623682414e7b1a7c";
logging-data="31032"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BI/ova2T8KM4djbYIYQdTgA07T9Nr/rI="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:js3crB5NUt2WF7/HqfX7Kf45FDY=
 by: Jon Ribbens - Tue, 21 Sep 2021 18:42 UTC

On 2021-09-21, Michael F. Stemper <michael.stemper@gmail.com> wrote:
> On the prolog thread, somebody posted a link to:
><https://dirtsimple.org/2004/12/python-is-not-java.html>
>
> One thing that it tangentially says is "XML is not the answer."
>
> I read this page right when I was about to write an XML parser
> to get data into the code for a research project I'm working on.
> It seems to me that XML is the right approach for this sort of
> thing, especially since the data is hierarchical in nature.
>
> Does the advice on that page mean that I should find some other
> way to get data into my programs, or does it refer to some kind
> of misuse/abuse of XML for something that it wasn't designed
> for?
>
> If XML is not the way to package data, what is the recommended
> approach?

I'd agree that you should not use XML unless the data is being supplied
already in XML format or perhaps if there is already a schema defined in
XML for exactly your purpose.

If there is nothing pre-existing to build upon then I'd suggest JSON.

If anyone suggests YAML, then you should just back slowly away while
speaking in a low calm voice until you have reached sufficient safe
distance, then turn and run.

Re: XML Considered Harmful

<sid9fq$6bh$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19691&group=comp.lang.python#19691

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!0BUoxIKeUVSm8bQj8XmtkA.user.46.165.242.75.POSTED!not-for-mail
From: alister.ware@ntlworld.com (alister)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Tue, 21 Sep 2021 18:49:30 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <sid9fq$6bh$1@gioia.aioe.org>
References: <sid7a6$kcu$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="6513"; posting-host="0BUoxIKeUVSm8bQj8XmtkA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Pan/0.146 (Hic habitat felicitas; 8107378
git@gitlab.gnome.org:GNOME/pan.git)
X-Notice: Filtered by postfilter v. 0.9.2
 by: alister - Tue, 21 Sep 2021 18:49 UTC

On Tue, 21 Sep 2021 13:12:10 -0500, Michael F. Stemper wrote:

> On the prolog thread, somebody posted a link to:
> <https://dirtsimple.org/2004/12/python-is-not-java.html>
>
> One thing that it tangentially says is "XML is not the answer."
>
> I read this page right when I was about to write an XML parser to get
> data into the code for a research project I'm working on.
> It seems to me that XML is the right approach for this sort of thing,
> especially since the data is hierarchical in nature.
>
> Does the advice on that page mean that I should find some other way to
> get data into my programs, or does it refer to some kind of misuse/abuse
> of XML for something that it wasn't designed for?
>
> If XML is not the way to package data, what is the recommended approach?

1'st can I say don't write your own XML parser, there are already a
number of existing parsers that should do everything you will need. This
is a wheel that does not need re-inventing.

2nd if you are not generating the data then you have to use whatever data
format you are supplied

as far as I can see the main issue with XML is bloat, it tries to do too
many things & is a very verbose format, often the quantity of mark-up can
easily exceed the data contained within it.

other formats such a JSON & csv have far less overhead, although again
not always suitable.

As in all such cases it is a matter of choosing the most apropriate tool
for the job in hand.

--
Antonym, n.:
The opposite of the word you're trying to think of.

Re: XML Considered Harmful

<XML-20210921194728@ram.dialup.fu-berlin.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19694&group=comp.lang.python#19694

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: 21 Sep 2021 19:14:28 GMT
Organization: Stefan Ram
Lines: 67
Expires: 1 Dec 2021 11:59:58 GMT
Message-ID: <XML-20210921194728@ram.dialup.fu-berlin.de>
References: <sid7a6$kcu$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de ewEnu3FXYE4fmPo5wyuVogpDFESS4dEPYbAAVgCwiPDX8G
X-Copyright: (C) Copyright 2021 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Tue, 21 Sep 2021 19:14 UTC

"Michael F. Stemper" <michael.stemper@gmail.com> writes:
>If XML is not the way to package data, what is the recommended
>approach?

I think no general answer can be given. You need to judge
for yourself what is suited best for your application.

I would not use the verb "package" in this context.
For me, XML is a notation for structured data.
So, one uses it to /write/ data.

I have not looked at the page you mentioned, but some say
XML is too verbose because of the end tags are repeating
the element type name. Others say this makes large elements
more readable for humans.

If your data is not too complicated and you do not foresee
problems, XML might be good enough and you should not invest
too much time into looking at alternatives.

>I was about to write an XML parser

One of the most important reasons to use XML is the
availability of prefabricated libraries and tools.
Writing one's own parser undermines the very thing that
is one of the most important benefits of using XML!

If you prefer a more lightweight document notation you can
look at:

- ini files
- YAML
- JSON
- S expressions (i.e., LISP notation)
- Python source files (which can also represent some type of data,
and instead of parsing them, one just can load them as a module)

And just for completenes, let me also mention SGML (which,
however, is not "lightweight"!). Erik Naggum, who was
writing about SGML, wanted to create his own notation,
which he called "Enamel", but this never got very far.

And, if readability for humans is less important, there are
ASN.1 and IFF (Python still has the chunk module to read IFF
chunked data).

. I am sometimes using my own notation, which I call
"Unotal". It addresses some of my own XML criticism. For
example, I want an element to possibly have more or less
than one type, to have several attributes with the same
name, and I want types and attributes to be structured.
(My Unotal parser for Python is not yet finished.)

I published this web page with some of my criticism of XML
(one can also use "http:" to access it):

https://www.purl.org/stefan_ram/pub/xml_data_representation_en

. About Unotal:

https://www.purl.org/stefan_ram/pub/unotal_en

And another page about a problem with XML, in German:

https://www.purl.org/stefan_ram/pub/xmldesign_element_oder_attribut_de

Re: XML Considered Harmful

<sidbem$jki$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19695&group=comp.lang.python#19695

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: michael.stemper@gmail.com (Michael F. Stemper)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Tue, 21 Sep 2021 14:22:52 -0500
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <sidbem$jki$1@dont-email.me>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 21 Sep 2021 19:23:02 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4f3ba84ed9c94cb44b19172b401ba190";
logging-data="20114"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/LB8Wr595Bu37iQG3qJpitxDgVeFYX3BY="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
Cancel-Lock: sha1:G2o+o+KDBZIrXso//LTNTMScVfY=
In-Reply-To: <sid9fq$6bh$1@gioia.aioe.org>
Content-Language: en-US
 by: Michael F. Stemper - Tue, 21 Sep 2021 19:22 UTC

On 21/09/2021 13.49, alister wrote:
> On Tue, 21 Sep 2021 13:12:10 -0500, Michael F. Stemper wrote:
>
>> On the prolog thread, somebody posted a link to:
>> <https://dirtsimple.org/2004/12/python-is-not-java.html>
>>
>> One thing that it tangentially says is "XML is not the answer."
>>
>> I read this page right when I was about to write an XML parser to get
>> data into the code for a research project I'm working on.
>> It seems to me that XML is the right approach for this sort of thing,
>> especially since the data is hierarchical in nature.
>>
>> Does the advice on that page mean that I should find some other way to
>> get data into my programs, or does it refer to some kind of misuse/abuse
>> of XML for something that it wasn't designed for?
>>
>> If XML is not the way to package data, what is the recommended approach?
>
> 1'st can I say don't write your own XML parser, there are already a
> number of existing parsers that should do everything you will need. This
> is a wheel that does not need re-inventing.

I was going to build it on top of xml.etree.ElementTree

> 2nd if you are not generating the data then you have to use whatever data
> format you are supplied

It's my own research, so I can give myself the data in any format that I
like.

> as far as I can see the main issue with XML is bloat, it tries to do too
> many things & is a very verbose format, often the quantity of mark-up can
> easily exceed the data contained within it.
>
> other formats such a JSON & csv have far less overhead, although again
> not always suitable.

I've heard of JSON, but never done anything with it.

How does CSV handle hierarchical data? For instance, I have
generators[1], each of which has a name, a fuel and one or more
incremental heat rate curves. Each fuel has a name, UOM, heat content,
and price. Each incremental cost curve has a name, and a series of
ordered pairs (representing a piecewise linear curve).

Can CSV files model this sort of situation?

> As in all such cases it is a matter of choosing the most apropriate tool
> for the job in hand.

Naturally. That's what I'm exploring.

[1] The kind made of tons of iron and copper, filled with oil, and
rotating at 1800 rpm.

--
Michael F. Stemper
This sentence no verb.

Re: XML Considered Harmful

<87ilytzkt4.fsf@gmail.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19698&group=comp.lang.python#19698

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: petef4+usenet@gmail.com (Pete Forman)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Tue, 21 Sep 2021 22:21:43 +0100
Organization: Linux Private Site
Lines: 59
Message-ID: <87ilytzkt4.fsf@gmail.com>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org>
<sidbem$jki$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="9a8e331e27de74ec27d3f00e78076145";
logging-data="5681"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+YZGIOHzDOrlXvOgp1nV2V"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:P6rk6a/wQT4u2D/v3tyk8B7CP2Q=
sha1:IAT8TycT+ZSPLQ2sWVyQQe7aIK4=
 by: Pete Forman - Tue, 21 Sep 2021 21:21 UTC

"Michael F. Stemper" <michael.stemper@gmail.com> writes:

> On 21/09/2021 13.49, alister wrote:
>> On Tue, 21 Sep 2021 13:12:10 -0500, Michael F. Stemper wrote:
> It's my own research, so I can give myself the data in any format that I
> like.
>
>> as far as I can see the main issue with XML is bloat, it tries to do
>> too many things & is a very verbose format, often the quantity of
>> mark-up can easily exceed the data contained within it. other formats
>> such a JSON & csv have far less overhead, although again not always
>> suitable.
>
> I've heard of JSON, but never done anything with it.

Then you should certainly try to get a basic understanding of it. One
thing JSON shares with XML is that it is best left to machines to
produce and consume. Because both can be viewed in a text editor there
is a common misconception that they are easy to edit. Not so, commas are
a common bugbear in JSON and non-trivial edits in (XML unaware) text
editors are tricky.

Consider what overhead you should worry about. If you are concerned
about file sizes then XML, JSON and CSV should all compress to a similar
size.

> How does CSV handle hierarchical data? For instance, I have
> generators[1], each of which has a name, a fuel and one or more
> incremental heat rate curves. Each fuel has a name, UOM, heat content,
> and price. Each incremental cost curve has a name, and a series of
> ordered pairs (representing a piecewise linear curve).
>
> Can CSV files model this sort of situation?

The short answer is no. CSV files represent spreadsheet row-column
values with nothing fancier such as formulas or other redirections.

CSV is quite good as a lowest common denominator exchange format. I say
quite because I would characterize it by 8 attributes and you need to
pick a dialect such as MS Excel which sets out what those are. XML and
JSON are controlled much better. You can easily verify that you conform
to those and guarantee that *any* conformant parser can read your
content. XML is more powerful in that repect than JSON in that you can
define and enforce schemas. In your case the fuel name, UOM, etc. can be
validated with standard tools. In JSON all that checking is entirely
handled by the consuming program(s).

>> As in all such cases it is a matter of choosing the most apropriate tool
>> for the job in hand.
>
> Naturally. That's what I'm exploring.

You might also like to consider HDF5. It is targeted at large volumes of
scientific data and its capabilities are well above what you need.
MATLAB, Octave and Scilab use it as their native format. PyTables and
h2py provide Python/NumPy bindings to it.

--
Pete Forman

Re: XML Considered Harmful

<sidmeg$5kd$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19699&group=comp.lang.python#19699

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!0BUoxIKeUVSm8bQj8XmtkA.user.46.165.242.75.POSTED!not-for-mail
From: alister.ware@ntlworld.com (alister)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Tue, 21 Sep 2021 22:30:40 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <sidmeg$5kd$1@gioia.aioe.org>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org>
<sidbem$jki$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="5773"; posting-host="0BUoxIKeUVSm8bQj8XmtkA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Pan/0.146 (Hic habitat felicitas; 8107378
git@gitlab.gnome.org:GNOME/pan.git)
X-Notice: Filtered by postfilter v. 0.9.2
 by: alister - Tue, 21 Sep 2021 22:30 UTC

On Tue, 21 Sep 2021 14:22:52 -0500, Michael F. Stemper wrote:

> On 21/09/2021 13.49, alister wrote:
>> On Tue, 21 Sep 2021 13:12:10 -0500, Michael F. Stemper wrote:
>>
>>> On the prolog thread, somebody posted a link to:
>>> <https://dirtsimple.org/2004/12/python-is-not-java.html>
>>>
>>> One thing that it tangentially says is "XML is not the answer."
>>>
>>> I read this page right when I was about to write an XML parser to get
>>> data into the code for a research project I'm working on.
>>> It seems to me that XML is the right approach for this sort of thing,
>>> especially since the data is hierarchical in nature.
>>>
>>> Does the advice on that page mean that I should find some other way to
>>> get data into my programs, or does it refer to some kind of
>>> misuse/abuse of XML for something that it wasn't designed for?
>>>
>>> If XML is not the way to package data, what is the recommended
>>> approach?
>>
>> 1'st can I say don't write your own XML parser, there are already a
>> number of existing parsers that should do everything you will need.
>> This is a wheel that does not need re-inventing.
>
> I was going to build it on top of xml.etree.ElementTree
>
so not writing a parser, using one, that's ok

>> 2nd if you are not generating the data then you have to use whatever
>> data format you are supplied
>
> It's my own research, so I can give myself the data in any format that I
> like.
>
>> as far as I can see the main issue with XML is bloat, it tries to do
>> too many things & is a very verbose format, often the quantity of
>> mark-up can easily exceed the data contained within it.
>>
>> other formats such a JSON & csv have far less overhead, although again
>> not always suitable.
>
> I've heard of JSON, but never done anything with it.
the python json library makes it simple.
it was originally invented for javascript, it looks very much like the
repl for a list/dictionary but if you are using std libraries you don't
really need to know except for academic interst
>
> How does CSV handle hierarchical data?
It dosn't, if you have heirachiacl data it is not a suitable format
> For instance, I have
> generators[1], each of which has a name, a fuel and one or more
> incremental heat rate curves. Each fuel has a name, UOM, heat content,
> and price. Each incremental cost curve has a name, and a series of
> ordered pairs (representing a piecewise linear curve).
>
> Can CSV files model this sort of situation?
>
>> As in all such cases it is a matter of choosing the most apropriate
>> tool for the job in hand.
>
> Naturally. That's what I'm exploring.
>
>
> [1] The kind made of tons of iron and copper, filled with oil, and
> rotating at 1800 rpm.

--
Riches cover a multitude of woes.
-- Menander

Re: XML Considered Harmful

<1b1r5hfsry.fsf@pfeifferfamily.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19700&group=comp.lang.python#19700

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: pfeiffer@cs.nmsu.edu (Joe Pfeiffer)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Tue, 21 Sep 2021 16:49:53 -0600
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <1b1r5hfsry.fsf@pfeifferfamily.net>
References: <sid7a6$kcu$1@dont-email.me>
<XML-20210921194728@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="026e5a1a67eab49b2fa6b442256f0e39";
logging-data="2607"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+aVC1uhLTn30d3jZWhXQJJXfjZiZSVmY="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:o6CxGWyKn5YG6oJB56pCNP3v/Uo=
sha1:/KWgHNrsYc+Yfcea5ce013XDgUo=
 by: Joe Pfeiffer - Tue, 21 Sep 2021 22:49 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
<snip>
> - S expressions (i.e., LISP notation)

If you're looking at hierarchical data and you don't have some good
reason to use something else, this is very likely to be your simplest
option.

Re: XML Considered Harmful

<slrnskkos9.4gd.jon+usenet@raven.unequivocal.eu>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19701&group=comp.lang.python#19701

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jon+usenet@unequivocal.eu (Jon Ribbens)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Tue, 21 Sep 2021 22:58:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <slrnskkos9.4gd.jon+usenet@raven.unequivocal.eu>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org>
<sidbem$jki$1@dont-email.me> <87ilytzkt4.fsf@gmail.com>
Injection-Date: Tue, 21 Sep 2021 22:58:17 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4bfd37bb49e4f89ffda8c1d0d47620a1";
logging-data="32399"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JgqhSQQ+yql6Qh/TgUDXSseWVzpvSUrE="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:FVglmRdA4NFBOEFA0cSBEyLovpE=
 by: Jon Ribbens - Tue, 21 Sep 2021 22:58 UTC

On 2021-09-21, Pete Forman <petef4+usenet@gmail.com> wrote:
> CSV is quite good as a lowest common denominator exchange format. I say
> quite because I would characterize it by 8 attributes and you need to
> pick a dialect such as MS Excel which sets out what those are. XML and
> JSON are controlled much better. You can easily verify that you conform
> to those and guarantee that *any* conformant parser can read your
> content. XML is more powerful in that repect than JSON in that you can
> define and enforce schemas. In your case the fuel name, UOM, etc. can be
> validated with standard tools. In JSON all that checking is entirely
> handled by the consuming program(s).

That's not true. You can use "JSON Schema" to create a schema
for validating JSON files, and there appear to be at least four
implementations in Python.

Re: XML Considered Harmful

<eli$2109212025@qaz.wtf>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19702&group=comp.lang.python#19702

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix5.panix.com!qz!not-for-mail
From: *@eli.users.panix.com (Eli the Bearded)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Wed, 22 Sep 2021 00:30:35 -0000 (UTC)
Organization: Some absurd concept
Message-ID: <eli$2109212025@qaz.wtf>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org> <sidbem$jki$1@dont-email.me>
Injection-Date: Wed, 22 Sep 2021 00:30:35 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="panix5.panix.com:166.84.1.5";
logging-data="1654"; mail-complaints-to="abuse@panix.com"
User-Agent: Vectrex rn 2.1 (beta)
X-Liz: It's actually happened, the entire Internet is a massive game of Redcode
X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix
X-US-Congress: Moronic Fucks.
X-Attribution: EtB
XFrom: is a real address
Encrypted: double rot-13
 by: Eli the Bearded - Wed, 22 Sep 2021 00:30 UTC

In comp.lang.python, Michael F. Stemper <michael.stemper@gmail.com> wrote:
> I've heard of JSON, but never done anything with it.

You probably have used it inadvertantly on a regular basis over the
past few years. Websites live on it.

> How does CSV handle hierarchical data? For instance, I have
> generators[1], each of which has a name, a fuel and one or more
> incremental heat rate curves. Each fuel has a name, UOM, heat content,
> and price. Each incremental cost curve has a name, and a series of
> ordered pairs (representing a piecewise linear curve).
>
> Can CSV files model this sort of situation?

Can a string of ones and zeros encode the sounds of Bach, the images
of his sheet music, the details to reproduce his bust in melted plastic
extruded from nozzle under the control of machines?

Yes, CSV files can model that. But it would not be my first choice of
data format. (Neither would JSON.) I'd probably use XML.

I rather suspect that all (many) of those genomes that end up in
Microsoft Excel files get there via a CSV export from a command line
tool. Once you can model life in CSV, everything seems possible.

> [1] The kind made of tons of iron and copper, filled with oil, and
> rotating at 1800 rpm.

Those are rather hard to model in CSV, too, but I'm sure it could be
done.

Elijah
------
for bonus round, use punched holes in paper to encode the ones and zeros

Re: XML Considered Harmful

<1bpmt1e6wj.fsf@pfeifferfamily.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19703&group=comp.lang.python#19703

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: pfeiffer@cs.nmsu.edu (Joe Pfeiffer)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Tue, 21 Sep 2021 19:27:40 -0600
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <1bpmt1e6wj.fsf@pfeifferfamily.net>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org>
<sidbem$jki$1@dont-email.me> <eli$2109212025@qaz.wtf>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="026e5a1a67eab49b2fa6b442256f0e39";
logging-data="19901"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Np4QuTmrs40xAaEwJP7RCAwOpFg9OPOw="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:qPs9LAII7aBGJ7ZLnOX/XUxu+kw=
sha1:JaCCVfgcf6pXwMG7WNw6nY8/iqs=
 by: Joe Pfeiffer - Wed, 22 Sep 2021 01:27 UTC

Eli the Bearded <*@eli.users.panix.com> writes:

> In comp.lang.python, Michael F. Stemper <michael.stemper@gmail.com> wrote:
>> I've heard of JSON, but never done anything with it.
>
> You probably have used it inadvertantly on a regular basis over the
> past few years. Websites live on it.

If the user has any interaction whatever with the formats being used to
transfer data then something is very, very wrong. Someone using a
website built on JSON isn't using JSON in any meaningful sense of the
term.

>> How does CSV handle hierarchical data? For instance, I have
>> generators[1], each of which has a name, a fuel and one or more
>> incremental heat rate curves. Each fuel has a name, UOM, heat content,
>> and price. Each incremental cost curve has a name, and a series of
>> ordered pairs (representing a piecewise linear curve).
>>
>> Can CSV files model this sort of situation?
>
> Can a string of ones and zeros encode the sounds of Bach, the images
> of his sheet music, the details to reproduce his bust in melted plastic
> extruded from nozzle under the control of machines?
>
> Yes, CSV files can model that. But it would not be my first choice of
> data format. (Neither would JSON.) I'd probably use XML.
>
> I rather suspect that all (many) of those genomes that end up in
> Microsoft Excel files get there via a CSV export from a command line
> tool. Once you can model life in CSV, everything seems possible.

Whenever someone asks "can this be done?" in any sort of computer
related question, the real question is "is this practical?" I have hazy
memories of seeing a Turing Machine implemented in an Excel spreadsheet,
so *anything* can, with sufficiently ridiculous amounts of work. That's
not really helpful here.

>> [1] The kind made of tons of iron and copper, filled with oil, and
>> rotating at 1800 rpm.
>
> Those are rather hard to model in CSV, too, but I'm sure it could be
> done.

So let's try to point him at representations that are easy.

Re: XML Considered Harmful

<mailman.768.1632278185.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19704&group=comp.lang.python#19704

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ethan@stoneleaf.us (Ethan Furman)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Tue, 21 Sep 2021 19:36:14 -0700
Lines: 12
Message-ID: <mailman.768.1632278185.4164.python-list@python.org>
References: <sid7a6$kcu$1@dont-email.me>
<fd96c1f7-2109-1459-0929-b745827c37c5@stoneleaf.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de jqmWwl7T6Tl9qC4rtm3D7AC6CGwBdTOUZsgpQRB3Nu1w==
Return-Path: <ethan@stoneleaf.us>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=stoneleaf.us header.i=@stoneleaf.us header.b=D2n7H6bN;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.014
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'received:217.70': 0.09;
'received:gandi.net': 0.09; 'received:mail.gandi.net': 0.09;
'url:stable': 0.09; 'from:addr:ethan': 0.16;
'from:addr:stoneleaf.us': 0.16; 'from:name:ethan furman': 0.16;
'message-id:@stoneleaf.us': 0.16; '~ethan~': 0.16; 'wrote:': 0.16;
'to:addr:python-list': 0.20; 'seems': 0.26; 'header:User-Agent:1':
0.30; 'am,': 0.31; 'approach': 0.31; '(as': 0.32; 'header:In-
Reply-To:1': 0.34; 'url-ip:104.17/16': 0.35; 'possibly': 0.36;
'read': 0.38; 'michael': 0.60; 'format': 0.62; 'received:217':
0.67; 'right': 0.68
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stoneleaf.us;
s=gm1; t=1632278177;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references;
bh=u/YqHBqAteBrRDHXTtYeH6TmEJ2Jf0Ql1jQhEpUHhAA=;
b=D2n7H6bNieuf3twhCEejAJY9Y0zw79BCjM+cAyF+ZMqDyroHeRu+R9rQbVSmQ4wCGt4YlT
jClOUwjleg3NYsO4Yyx1EXM9YUU/D6UDH0O3YnZDkdkyGZz9g+hRRDDOa7VsZAasbFirqb
M5o48FBS9qVVtqUmTUkxjmDFIYl9NnEwVdHgeEwvrcZldY9XVHecS+ThpGGPejoK1h8TBh
ibbJEoKMC5CqOSv9LS+iJ+cfUnpaNOOshzpMiYsFmH2zAXMFWpm2j9RKqjcKRkV/hbOQL9
su1d5UUNBt/dSuyy5YR4CSw6VRmus3DX8vywDkQobZglNNTpF6vcZFLj1gkImw==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
In-Reply-To: <sid7a6$kcu$1@dont-email.me>
Content-Language: en-US
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <fd96c1f7-2109-1459-0929-b745827c37c5@stoneleaf.us>
X-Mailman-Original-References: <sid7a6$kcu$1@dont-email.me>
 by: Ethan Furman - Wed, 22 Sep 2021 02:36 UTC

On 9/21/21 11:12 AM, Michael F. Stemper wrote:

> It seems to me that XML is the right approach for this sort of
> thing, especially since the data is hierarchical in nature.

If you're looking for a format that you can read (as a human) and possibly hand-edit,
check out NestedText:

https://nestedtext.org/en/stable/

--
~Ethan~

Re: XML Considered Harmful

<mailman.769.1632278793.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19706&group=comp.lang.python#19706

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: drsalists@gmail.com (Dan Stromberg)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Tue, 21 Sep 2021 19:46:19 -0700
Lines: 17
Message-ID: <mailman.769.1632278793.4164.python-list@python.org>
References: <sid7a6$kcu$1@dont-email.me>
<CAGGBd_quevLzQDRZd1x=3QOC1HhZru990+K4Nm6FrWkNaeBbXA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de MJmOZPOXws/ZIND8WXhLWg8C+aCfQTHyfCPPTcOkKwRw==
Return-Path: <drsalists@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=d0VWVcCM;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.030
X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'simple.': 0.07;
'approach?': 0.09; 'cc:addr:python-list': 0.09; 'json': 0.09;
'both.': 0.16; 'cc:name:python list': 0.16; 'from:addr:drsalists':
0.16; 'from:name:dan stromberg': 0.16; 'received:209.85.217':
0.16; 'stuck': 0.16; 'wrote:': 0.16; 'tue,': 0.19;
'cc:addr:python.org': 0.20; 'cc:2**0': 0.25; 'elements': 0.32;
'sep': 0.32; 'message-id:@mail.gmail.com': 0.32; 'but': 0.32;
"didn't": 0.34; 'package': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35; 'also,':
0.36; 'really': 0.37; 'received:209.85': 0.37; 'way': 0.38;
'received:209': 0.39; 'use': 0.39; 'both': 0.40; 'michael': 0.60;
"there's": 0.61; 'data,': 0.63; 'complexity': 0.69; '2021': 0.71;
'easy': 0.74; 'hope.': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=L9hVZBUgTK6CWxtsU82183BOH74fgrwXzLM0Opq5bSQ=;
b=d0VWVcCMo9PnVRP195tHl/fzx3V0Dcg73Ex0uPsEQUGAtWetW0/2zEJmMDUSYUKvi4
HThNYsAVPXYMO75XAmiVbXNaa1XqJZSsC1wjXub1NOHILtP2NbEXRxBBnjoRqoLl7oBr
SKfuR2CQh9/e0p/IwE/xypivAHK/zQWxnFxWisygCtJYEVe7P6ajiwS8Njz8WC4985pG
WuL8MGWB2927fd1Dn56/CmpTUiVLbV69S3ZLPshaU4KGwDuGwzVc8aJzKA/IqSDxDwqb
uWIJY5+Nvf8ALKVBVt9Wwn3Sgs969Vw5GQQTr1FF3Tuk3DGNlZRVrArZ8frai0nij4zw
aHOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=L9hVZBUgTK6CWxtsU82183BOH74fgrwXzLM0Opq5bSQ=;
b=GxEIPMZf03IU7eCUubycpsQrYiu5rqThWyDFtIgApeKnn1GkzWBpaka3JuYB6r3hJX
cG3ndhS13wH/UNBP8nlZAB2nejfXiMfX+a9DAjr/eFe3Af28rJ1ra//kCsZ/Ix0+I3de
An+iGHVGYdEneiIZMFvXRh/h2YN65yc32kW0L3QohzzpJ547Pgdyl9f0/DkC0r9Eb7n7
ckqeuJ5IIK2k1SefUdtSv6nD/m9FQsplThsluSsIKaXOmcrhGLhBUiqg1zYTJ7hSzNov
mqCOEEK2pLsh758uoiV5niKs+X0+1QNeCjri1FnBLox9s0aao8tVR3PC/sRedGInmiPw
Cenw==
X-Gm-Message-State: AOAM532iMuopxjuDbnAgfptOg0y+8k4H9NEAGEKskCW2dVC5nm9sxQXW
Cigvb0gzyHpogMOOEBVCdw7wZMQdN2CQ5AMNRXdGnoO0
X-Google-Smtp-Source: ABdhPJwBHyQPFROASM4EcKBkU3UKS8NIWZl5n6lEBtJ5blr2SZdBi20xlSDO46eRSHrKeb0RobhIzrPpKJFtomzQ8Zw=
X-Received: by 2002:a67:61c7:: with SMTP id v190mr23338232vsb.15.1632278790747;
Tue, 21 Sep 2021 19:46:30 -0700 (PDT)
In-Reply-To: <sid7a6$kcu$1@dont-email.me>
X-Content-Filtered-By: Mailman/MimeDel 2.1.34
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAGGBd_quevLzQDRZd1x=3QOC1HhZru990+K4Nm6FrWkNaeBbXA@mail.gmail.com>
X-Mailman-Original-References: <sid7a6$kcu$1@dont-email.me>
 by: Dan Stromberg - Wed, 22 Sep 2021 02:46 UTC

On Tue, Sep 21, 2021 at 7:26 PM Michael F. Stemper <
michael.stemper@gmail.com> wrote:

> If XML is not the way to package data, what is the recommended
> approach?
>

I prefer both JSON and YAML over XML.

XML has both elements and tags, but it didn't really need both. This
results in more complexity than necessary. Also, XSLT and XPath are not
really all that simple.

But there's hope. If you're stuck with XML, you can use xmltodict, which
makes XML almost as easy as JSON.

HTH.

Re: XML Considered Harmful

<87bl4lyren.fsf@gmail.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19712&group=comp.lang.python#19712

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: petef4+usenet@gmail.com (Pete Forman)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Wed, 22 Sep 2021 08:56:48 +0100
Organization: Linux Private Site
Lines: 22
Message-ID: <87bl4lyren.fsf@gmail.com>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org>
<sidbem$jki$1@dont-email.me> <87ilytzkt4.fsf@gmail.com>
<slrnskkos9.4gd.jon+usenet@raven.unequivocal.eu>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="65fc32d9b54fabdd90d3f79dafc6c54f";
logging-data="11468"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+azBBz8IU+6sgFFwhjMBgb"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:uA5Op7EJ9iMFQ63fpds10T5Admo=
sha1:HcpSe1ZVqbSkedgLBay3p/2VLVw=
 by: Pete Forman - Wed, 22 Sep 2021 07:56 UTC

Jon Ribbens <jon+usenet@unequivocal.eu> writes:

> On 2021-09-21, Pete Forman <petef4+usenet@gmail.com> wrote:
>> CSV is quite good as a lowest common denominator exchange format. I
>> say quite because I would characterize it by 8 attributes and you
>> need to pick a dialect such as MS Excel which sets out what those
>> are. XML and JSON are controlled much better. You can easily verify
>> that you conform to those and guarantee that *any* conformant parser
>> can read your content. XML is more powerful in that repect than JSON
>> in that you can define and enforce schemas. In your case the fuel
>> name, UOM, etc. can be validated with standard tools. In JSON all
>> that checking is entirely handled by the consuming program(s).
>
> That's not true. You can use "JSON Schema" to create a schema for
> validating JSON files, and there appear to be at least four
> implementations in Python.

Fair point. It has been a while since I looked at JSON schemas and they
were rather less mature then.

--
Pete Forman

Re: XML Considered Harmful

<siff9o$mt7$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19714&group=comp.lang.python#19714

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: michael.stemper@gmail.com (Michael F. Stemper)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Wed, 22 Sep 2021 09:40:48 -0500
Organization: A noiseless patient Spider
Lines: 98
Message-ID: <siff9o$mt7$1@dont-email.me>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org>
<sidbem$jki$1@dont-email.me> <87ilytzkt4.fsf@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 22 Sep 2021 14:40:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7a12210abf9936a19d853adb0380e71e";
logging-data="23463"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+JPUraBQZy3Yd7MmhOT3ugBpFBoZGZtuk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
Cancel-Lock: sha1:Np+i13ybjA6oB0nh2aFEWuG702k=
In-Reply-To: <87ilytzkt4.fsf@gmail.com>
Content-Language: en-US
 by: Michael F. Stemper - Wed, 22 Sep 2021 14:40 UTC

On 21/09/2021 16.21, Pete Forman wrote:
> "Michael F. Stemper" <michael.stemper@gmail.com> writes:
>> On 21/09/2021 13.49, alister wrote:
>>> On Tue, 21 Sep 2021 13:12:10 -0500, Michael F. Stemper wrote:
>> It's my own research, so I can give myself the data in any format that I
>> like.
>>
>>> as far as I can see the main issue with XML is bloat, it tries to do
>>> too many things & is a very verbose format, often the quantity of
>>> mark-up can easily exceed the data contained within it. other formats
>>> such a JSON & csv have far less overhead, although again not always
>>> suitable.
>>
>> I've heard of JSON, but never done anything with it.
>
> Then you should certainly try to get a basic understanding of it. One
> thing JSON shares with XML is that it is best left to machines to
> produce and consume. Because both can be viewed in a text editor there
> is a common misconception that they are easy to edit. Not so, commas are
> a common bugbear in JSON and non-trivial edits in (XML unaware) text
> editors are tricky.

Okay, after playing around with the example in Lubanovic's book[1]
I've managed to create a dict of dicts of dicts and write it to a
json file. It seems to me that this is how json handles hierarchical
data. Is that understanding correct?

Is this then the process that I would use to create a *.json file
to provide data to my various programs? Copy and paste the current
hard-coded assignment statements into REPL, use json.dump(dict,fp)
to write it to a file, and then read the file into each program
with json.load(fp)? (Actually, I'd write a function to do that,
just as I would with XML.)

> Consider what overhead you should worry about. If you are concerned
> about file sizes then XML, JSON and CSV should all compress to a similar
> size.

Not a concern at all for my current application.

>> How does CSV handle hierarchical data? For instance, I have
>> generators[1], each of which has a name, a fuel and one or more
>> incremental heat rate curves. Each fuel has a name, UOM, heat content,
>> and price. Each incremental cost curve has a name, and a series of
>> ordered pairs (representing a piecewise linear curve).
>>
>> Can CSV files model this sort of situation?
>
> The short answer is no. CSV files represent spreadsheet row-column
> values with nothing fancier such as formulas or other redirections.

Okay, that was what I suspected.

> CSV is quite good as a lowest common denominator exchange format. I say
> quite because I would characterize it by 8 attributes and you need to
> pick a dialect such as MS Excel which sets out what those are. XML and
> JSON are controlled much better. You can easily verify that you conform
> to those and guarantee that *any* conformant parser can read your
> content. XML is more powerful in that repect than JSON in that you can
> define and enforce schemas. In your case the fuel name, UOM, etc. can be
> validated with standard tools.

Yeah, validating against a DTD is pretty easy, since lxml.etree does all
of the work.

> In JSON all that checking is entirely
> handled by the consuming program(s).
Well, the consumer's (almost) always going to need to do *some*
validation. For instance, as far as I can tell, a DTD can't specify
that there must be at least two of a particular item.

The designers of DTD seem to have taken the advice of MacLennan[2]:
"The only reasonable numbers are zero, one, or infinity."

Which is great until you need to make sure that you have enough
points to define at least one line segment.

>>> As in all such cases it is a matter of choosing the most apropriate tool
>>> for the job in hand.
>>
>> Naturally. That's what I'm exploring.
>
> You might also like to consider HDF5. It is targeted at large volumes of
> scientific data and its capabilities are well above what you need.

Yeah, I won't be looking at more than five or ten generators at most. A
small number is enough to confirm or refute the behavior that I'm
testing.

[1] _Introducing Python: Modern Computing in Simple Packages_,
Second Release, (c) 2015, Bill Lubanovic, O'Reilly Media, Inc.
[2] _Principles of Programming Languages: Design, Evaluation,
and Implementation_, Second Edition, (c) 1987, Bruce J. MacLennan,
Holt, Rinehart, & Winston
--
Michael F. Stemper
No animals were harmed in the composition of this message.

Re: XML Considered Harmful

<sifg0c$s6n$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19715&group=comp.lang.python#19715

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: michael.stemper@gmail.com (Michael F. Stemper)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Wed, 22 Sep 2021 09:52:59 -0500
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <sifg0c$s6n$1@dont-email.me>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org>
<sidbem$jki$1@dont-email.me> <eli$2109212025@qaz.wtf>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 22 Sep 2021 14:53:00 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7a12210abf9936a19d853adb0380e71e";
logging-data="28887"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191Df2kRyzpyRFdOETQNpWxn9LmvVfxkV0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
Cancel-Lock: sha1:a01uCZEZFil9lwUrpEJG4tlg4Uk=
In-Reply-To: <eli$2109212025@qaz.wtf>
Content-Language: en-US
 by: Michael F. Stemper - Wed, 22 Sep 2021 14:52 UTC

On 21/09/2021 19.30, Eli the Bearded wrote:
> In comp.lang.python, Michael F. Stemper <michael.stemper@gmail.com> wrote:
>> I've heard of JSON, but never done anything with it.
>
> You probably have used it inadvertantly on a regular basis over the
> past few years. Websites live on it.

I used to use javascript when I was running Windows (up until 2009),
since it was the only programming language to which I had ready
access. Then I got a linux box and quickly discovered python. I
dropped javascript like a hot potato.

>> How does CSV handle hierarchical data? For instance, I have
>> generators[1], each of which has a name, a fuel and one or more
>> incremental heat rate curves. Each fuel has a name, UOM, heat content,
>> and price. Each incremental cost curve has a name, and a series of
>> ordered pairs (representing a piecewise linear curve).
>>
>> Can CSV files model this sort of situation?
>
> Can a string of ones and zeros encode the sounds of Bach, the images
> of his sheet music, the details to reproduce his bust in melted plastic
> extruded from nozzle under the control of machines?
>
> Yes, CSV files can model that. But it would not be my first choice of
> data format. (Neither would JSON.) I'd probably use XML.

Okay. 'Go not to the elves for counsel, for they will say both no
and yes.' (I'm not actually surprised to find differences of opinion.)

>> [1] The kind made of tons of iron and copper, filled with oil, and
>> rotating at 1800 rpm.
>
> Those are rather hard to model in CSV, too, but I'm sure it could be
> done.

> for bonus round, use punched holes in paper to encode the ones and zeros

I've done cardboard.

--
Michael F. Stemper
No animals were harmed in the composition of this message.

Re: XML Considered Harmful

<mailman.774.1632334707.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19717&group=comp.lang.python#19717

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: wlfraed@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Wed, 22 Sep 2021 12:31:22 -0400
Organization: IISS Elusive Unicorn
Lines: 50
Message-ID: <mailman.774.1632334707.4164.python-list@python.org>
References: <sid7a6$kcu$1@dont-email.me>
<unlmkg1aiusdhpau4ojj05hbms6c01eoi5@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de Go0W/17GoPcvXbOHNSWKBg2/cMVmTNSy7/i8K5jNwCRw==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.100
X-Spam-Level: *
X-Spam-Evidence: '*H*': 0.80; '*S*': 0.00; 'filter': 0.07; 'overhead':
0.09; 'parse': 0.09; 'received:ciao.gmane.io': 0.09;
'received:gmane.io': 0.09; 'received:list': 0.09; 'theory': 0.09;
'definitions': 0.16; 'message-id:@4ax.com': 0.16; 'posts)': 0.16;
'received:116.202': 0.16; 'received:116.202.254': 0.16;
'received:116.202.254.214': 0.16; 'recommended.': 0.16; 'tends':
0.16; 'url-ip:66/8': 0.16; 'python': 0.16; 'says': 0.17;
'probably': 0.17; 'tue,': 0.19; 'to:addr:python-list': 0.20;
'written': 0.22; 'code': 0.23; 'installed': 0.23; "i'd": 0.24;
'seems': 0.26; 'again,': 0.26; 'interface': 0.26; "wasn't": 0.26;
'expect': 0.28; 'header:User-Agent:1': 0.30; 'approach': 0.31;
'header:Organization:1': 0.31; '(as': 0.32; 'sep': 0.32; "i'm":
0.33; 'there': 0.33; 'server': 0.33; 'mean': 0.34; 'package':
0.34; 'files': 0.36; 'those': 0.36; 'way': 0.38; 'means': 0.38;
'read': 0.38; 'use': 0.39; 'finding': 0.39; 'on.': 0.39; 'both':
0.40; 'something': 0.40; 'try': 0.40; 'should': 0.40; 'likely':
0.61; 'to:': 0.62; 'seen': 0.62; 'format': 0.62; 'generation':
0.62; 'data,': 0.63; 'between': 0.63; 'research': 0.64;
'accessing': 0.64; 'definition': 0.64; 'received:116': 0.64;
'widely': 0.64; 'less': 0.65; 'foreign': 0.67; 'right': 0.68;
'following:': 0.69; 'transport': 0.69; 'url:htm': 0.69; '2021':
0.71; 'database': 0.80; 'relations': 0.84; '(such': 0.84;
'companies,': 0.84; 'represented': 0.84; 'sqlite': 0.84; 'url-
ip:149.56/16': 0.84; 'url-ip:149/8': 0.84; 'somebody': 0.91
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: ForteAgent/8.00.32.1272
X-Mailman-Approved-At: Wed, 22 Sep 2021 14:18:25 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <unlmkg1aiusdhpau4ojj05hbms6c01eoi5@4ax.com>
X-Mailman-Original-References: <sid7a6$kcu$1@dont-email.me>
 by: Dennis Lee Bieber - Wed, 22 Sep 2021 16:31 UTC

On Tue, 21 Sep 2021 13:12:10 -0500, "Michael F. Stemper"
<michael.stemper@gmail.com> declaimed the following:

>On the prolog thread, somebody posted a link to:
><https://dirtsimple.org/2004/12/python-is-not-java.html>
>
>One thing that it tangentially says is "XML is not the answer."
>
>I read this page right when I was about to write an XML parser
>to get data into the code for a research project I'm working on.
>It seems to me that XML is the right approach for this sort of
>thing, especially since the data is hierarchical in nature.
>
>Does the advice on that page mean that I should find some other
>way to get data into my programs, or does it refer to some kind
>of misuse/abuse of XML for something that it wasn't designed
>for?

There are some that try to use XML as a /live/ data /storage/ format
(such as http://www.drivehq.com/web/brana/pandora.htm which has to parse
XML files for all configuration data and filter definitions on start-up,
and update those files on any changes).

If you control both the data generation and the data consumption,
finding some format with less overhead than XML is probably to be
recommended. XML is more a self-documented (in theory) means of packaging
data for transport between widely disparate applications, which are likely
written by different teams, if not different companies, who only interface
via the definition of the data as seen by XML.

>
>If XML is not the way to package data, what is the recommended
>approach?

Again, if you control both generation and consumption... I'd probably
use an RDBM. SQLite tends to be packaged with Python [Windows] or, at the
least, the DB-API adapter [Linux tends to expect SQLite as a standard
installed item]. SQLite is a "file server" model (as is the JET engine used
by M$ Access) -- each application (instance) is directly accessing the
database file; there is no server process mediating access.

Hierarchical (since you mention that in later posts) would be
represented by relations (terminology from relational theory -- a "table"
to most) linked by foreign keys.

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: XML Considered Harmful

<b5e3b045-b822-47f9-b282-2abe2312bafcn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19719&group=comp.lang.python#19719

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a37:674a:: with SMTP id b71mr1072748qkc.360.1632339663247;
Wed, 22 Sep 2021 12:41:03 -0700 (PDT)
X-Received: by 2002:ac8:505a:: with SMTP id h26mr1055750qtm.376.1632339663118;
Wed, 22 Sep 2021 12:41:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Wed, 22 Sep 2021 12:41:02 -0700 (PDT)
In-Reply-To: <sid7a6$kcu$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=146.200.61.243; posting-account=aKzvzQoAAAAnYB7N4xfKf_Ihdfau7aG5
NNTP-Posting-Host: 146.200.61.243
References: <sid7a6$kcu$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b5e3b045-b822-47f9-b282-2abe2312bafcn@googlegroups.com>
Subject: Re: XML Considered Harmful
From: breamoreboy@gmail.com (Mark Lawrence)
Injection-Date: Wed, 22 Sep 2021 19:41:03 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 13
 by: Mark Lawrence - Wed, 22 Sep 2021 19:41 UTC

On Tuesday, September 21, 2021 at 7:12:33 PM UTC+1, Michael F. Stemper wrote:
> On the prolog thread, somebody posted a link to:
> <https://dirtsimple.org/2004/12/python-is-not-java.html>

Me, but as the moderators on this group/mailing list have no objection to some people slamming Python where ever and whenever they like it, and when I object I get banned need I say more? Python doesn't discriminate against anybody unless you're on the autistic spectrum, in which case you can fuck off.

> --
> Michael F. Stemper
> Life's too important to take seriously.

Re: XML Considered Harmful

<sig5as$pen$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19721&group=comp.lang.python#19721

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: michael.stemper@gmail.com (Michael F. Stemper)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Wed, 22 Sep 2021 15:57:00 -0500
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <sig5as$pen$1@dont-email.me>
References: <sid7a6$kcu$1@dont-email.me>
<b5e3b045-b822-47f9-b282-2abe2312bafcn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 22 Sep 2021 20:57:00 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7a12210abf9936a19d853adb0380e71e";
logging-data="26071"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dTzBia1Ux1L/peoc/4bhTsyQgSMY0FBQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
Cancel-Lock: sha1:bpfKveF1EoHTmkowvKDOITpnBlE=
In-Reply-To: <b5e3b045-b822-47f9-b282-2abe2312bafcn@googlegroups.com>
Content-Language: en-US
 by: Michael F. Stemper - Wed, 22 Sep 2021 20:57 UTC

On 22/09/2021 14.41, Mark Lawrence wrote:
> On Tuesday, September 21, 2021 at 7:12:33 PM UTC+1, Michael F. Stemper wrote:
>> On the prolog thread, somebody posted a link to:
>> <https://dirtsimple.org/2004/12/python-is-not-java.html>
>
> Me, but as the moderators on this group/mailing list have no objection to some people slamming Python where ever and whenever they like it, and when I object I get banned need I say more? Python doesn't discriminate against anybody unless you're on the autistic spectrum, in which case you can fuck off.

What on earth did I do to deserve this?

--
Michael F. Stemper
A preposition is something you should never end a sentence with.

Re: XML Considered Harmful

<mailman.777.1632364258.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19722&group=comp.lang.python#19722

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: wlfraed@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Wed, 22 Sep 2021 18:37:18 -0400
Organization: IISS Elusive Unicorn
Lines: 76
Message-ID: <mailman.777.1632364258.4164.python-list@python.org>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org>
<sidbem$jki$1@dont-email.me> <eli$2109212025@qaz.wtf>
<sifg0c$s6n$1@dont-email.me>
<spankgl1naa2461nf03s498rll84n1cif8@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de ZUIJTMAkhCYqywzXpjIpBAmvQbFkK0EUpLySPHAhI5uA==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.020
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'csv': 0.03; '(which':
0.04; 'def': 0.04; 'parent': 0.07; 'etc.).': 0.09; 'parse': 0.09;
'received:ciao.gmane.io': 0.09; 'received:gmane.io': 0.09;
'received:list': 0.09; 'skip:# 30': 0.09; 'that.': 0.15; "(i'm":
0.16; '...,': 0.16; 'bearded': 0.16; 'data?': 0.16; 'dictionary,':
0.16; 'eli': 0.16; 'linear': 0.16; 'message-id:@4ax.com': 0.16;
'received:116.202': 0.16; 'received:116.202.254': 0.16;
'received:116.202.254.214': 0.16; 'self.name': 0.16; 'splitting':
0.16; 'tuple': 0.16; 'wrote:': 0.16; 'probably': 0.17; 'to:addr
:python-list': 0.20; 'skip:_ 10': 0.22; "i'd": 0.24; 'object':
0.26; '>>>': 0.28; 'series': 0.28; 'header:User-Agent:1': 0.30;
'module': 0.31; 'header:Organization:1': 0.31; '(as': 0.32;
'attach': 0.32; 'extract': 0.32; 'objects': 0.32; 'sep': 0.32;
'split': 0.32; 'but': 0.32; 'same': 0.34; 'handling': 0.35;
'yes,': 0.35; 'files': 0.36; 'class': 0.37; 'handle': 0.39;
'list': 0.39; 'use': 0.39; 'rest': 0.39; 'wed,': 0.39; 'both':
0.40; 'higher': 0.60; 'michael': 0.60; 'skip:h 10': 0.61; "you'd":
0.64; 'received:116': 0.64; 'rate': 0.67; 'skip:# 10': 0.68;
'cost': 0.69; 'content,': 0.69; 'following:': 0.69; 'price.':
0.69; 'terms': 0.70; '2021': 0.71; 'name,': 0.75; 'price': 0.75;
'....': 0.76; 'choice': 0.76; 'field': 0.78; 'extracted': 0.84;
'fuel': 0.84; 'heat': 0.84; 'identifies': 0.84; 'ordered': 0.84;
'pairs': 0.84; 'strings': 0.84; 'surprised': 0.84; 'incremental':
0.91
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: ForteAgent/8.00.32.1272
X-Mailman-Approved-At: Wed, 22 Sep 2021 22:30:58 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <spankgl1naa2461nf03s498rll84n1cif8@4ax.com>
X-Mailman-Original-References: <sid7a6$kcu$1@dont-email.me>
<sid9fq$6bh$1@gioia.aioe.org> <sidbem$jki$1@dont-email.me>
<eli$2109212025@qaz.wtf> <sifg0c$s6n$1@dont-email.me>
 by: Dennis Lee Bieber - Wed, 22 Sep 2021 22:37 UTC

On Wed, 22 Sep 2021 09:52:59 -0500, "Michael F. Stemper"
<michael.stemper@gmail.com> declaimed the following:

>On 21/09/2021 19.30, Eli the Bearded wrote:
>> In comp.lang.python, Michael F. Stemper <michael.stemper@gmail.com> wrote:
>>> How does CSV handle hierarchical data? For instance, I have
>>> generators[1], each of which has a name, a fuel and one or more
>>> incremental heat rate curves. Each fuel has a name, UOM, heat content,
>>> and price. Each incremental cost curve has a name, and a series of
>>> ordered pairs (representing a piecewise linear curve).
>>>
>>> Can CSV files model this sort of situation?
>>
<SNIP>
>> Yes, CSV files can model that. But it would not be my first choice of
>> data format. (Neither would JSON.) I'd probably use XML.
>
>Okay. 'Go not to the elves for counsel, for they will say both no
>and yes.' (I'm not actually surprised to find differences of opinion.)
>
You'd have to include a "level" (and/or data type if multiple objects
can be at the same level) field (as the first field) in CSV which
identifies how to parse the rest of the CSV data (well, technically, the
CSV module has "parsed" it -- in terms of splitting at commas, handling
quoted strings (which may contain commas which are not split points, etc.).

1-generator, name
2-fuel, name, UOM, heat-content, price
2-curve, name
3-point, X, Y
3-point, X, Y
....
2-curve, name
3-point, X, Y
3-point, X, Y
....

You extract objects at each level; if the level is the same or "lower"
(numerically -- higher in hierarchy) you attach the "previously" extracted
object to the parent object... Whether list or dictionary, or class
instance(s):

class Point():
#Point may be overkill, easier to just use a tuple (X, Y)
def __init__(self, X, Y):
self.X = X
self.Y = Y

class Curve():
def __init__(self, name):
self.name = name
self.points = []

#use as aCurve.points.append(currentPoint)

class Fuel():
def __init__(self, name, ..., price):
self.name = name
...
self.price = price

class Generator():
def __init__(self, name):
self.name = name
self.fuel = None
self.curves = []

#aGenerator.fuel = currentCurve
#aGenerator.curves.append(currentCurve)

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: XML Considered Harmful

<sihgvg$kfg$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19724&group=comp.lang.python#19724

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: auriocus@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Thu, 23 Sep 2021 11:21:27 +0200
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <sihgvg$kfg$1@dont-email.me>
References: <sid7a6$kcu$1@dont-email.me> <sid9fq$6bh$1@gioia.aioe.org>
<sidbem$jki$1@dont-email.me> <eli$2109212025@qaz.wtf>
<sifg0c$s6n$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 23 Sep 2021 09:21:53 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0c65bf450fdc83770539c52c795ff001";
logging-data="20976"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qumAmXezzsMVUHAxxw7VZO/xMxn37/oY="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0)
Gecko/20100101 Thunderbird/78.14.0
Cancel-Lock: sha1:HZVMjeh7MBL58+ifSBb4W0Y1WzA=
In-Reply-To: <sifg0c$s6n$1@dont-email.me>
 by: Christian Gollwitzer - Thu, 23 Sep 2021 09:21 UTC

Am 22.09.21 um 16:52 schrieb Michael F. Stemper:
> On 21/09/2021 19.30, Eli the Bearded wrote:
>> Yes, CSV files can model that. But it would not be my first choice of
>> data format. (Neither would JSON.) I'd probably use XML.
>
> Okay. 'Go not to the elves for counsel, for they will say both no
> and yes.' (I'm not actually surprised to find differences of opinion.)

It is wrong, CSV has no model of hierarchical data. A CSV file is a 2d
table, just like a database table or an Excel sheet.

You can /layer/ high-dimensional data on top of a 2D table, there is the
relational algebra theory behind this, but it is wrong (or misleading at
best) to say that CSV can model hierarchical data.

It's the same as saying "CSV supports images". Of course it doesn't, its
a textfile, but you could encode a JPEG as base64 and then put this
string into the cell of a CSV table. That definitely isn't what a sane
person would understand as "support".

Christian

Re: XML Considered Harmful

<mailman.778.1632401649.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19725&group=comp.lang.python#19725

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: mats@wichmann.us (Mats Wichmann)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Thu, 23 Sep 2021 06:53:10 -0600
Lines: 16
Message-ID: <mailman.778.1632401649.4164.python-list@python.org>
References: <sid7a6$kcu$1@dont-email.me>
<unlmkg1aiusdhpau4ojj05hbms6c01eoi5@4ax.com>
<9dba6f39-64c8-9077-a866-e0335eabf79b@wichmann.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 7OCBujY+yOxBhCQT6l9pLwRSiA6mupfNJUR1HTOGjaSA==
Return-Path: <mats@wichmann.us>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=pobox.com header.i=@pobox.com header.b=FqCTPqjk;
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.036
X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'generated': 0.03; 'csv':
0.03; '*not*': 0.09; 'choice.': 0.09; 'received:173': 0.13;
'excel,': 0.16; 'key.': 0.16; 'noisy': 0.16; 'recover': 0.16;
'sigh.': 0.16; 'wrote:': 0.16; 'problem': 0.16; 'to:addr:python-
list': 0.20; 'seems': 0.26; 'header:User-Agent:1': 0.30;
'format,': 0.32; 'but': 0.32; 'able': 0.34; 'header:In-Reply-
To:1': 0.34; 'people': 0.36; 'really': 0.37; "it's": 0.37;
'received:192.168': 0.37; 'least': 0.39; 'finding': 0.39; 'both':
0.40; 'format': 0.62; 'generation': 0.62; 'substantial': 0.64;
'your': 0.64; 'parts': 0.65; 'bad': 0.67; 'that,': 0.67; 'live':
0.68; 'excel': 0.69; 'control.': 0.84; 'exporting': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=message-id
:date:mime-version:subject:to:references:from:in-reply-to
:content-type:content-transfer-encoding; s=sasl; bh=/BTJnaGaEvcl
gyqoXuu//pZ2mVOhP1Oo/vUyVYZCLHU=; b=FqCTPqjk93XRzPEolsYRN7KigFNB
pdSrYdA0HJgJ1r759kvNKnK8qjDddZmy/GZIZJbYGeSyUVjxJvY2Wjz1PbV3UOcg
tUcMwGI3ENv3KKox4mVkfwyJICTOWQQS8SD5aYudPlMnJy6tZIagCT1jBnJXmA5e
mtWXKzx77dxTV7Q=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=wichmann.us;
h=message-id:date:mime-version:subject:to:references:from:in-reply-to:content-type:content-transfer-encoding;
s=2018-07.pbsmtp; bh=/BTJnaGaEvclgyqoXuu//pZ2mVOhP1Oo/vUyVYZCLHU=;
b=pvmdpFspxeRSIKWjJFR8WmYjgbqewIiP0jELWFQmoBqDOZ3fPYP5Z58Iu+waN7QRs54/oy51u+fw5KWKXMjAzOIsrKzILMfNY3mnu0kFo0pNt6m0yB1WDMMe4kqPZTRIMfGnigF3vXrvcgYNcTHbEAF+2W65XPXuU7GIgzks1yQ=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.1.0
Content-Language: en-US
In-Reply-To: <unlmkg1aiusdhpau4ojj05hbms6c01eoi5@4ax.com>
X-Pobox-Relay-ID: 3619C24E-1C6D-11EC-A479-F327CE9DA9D6-81526775!pb-smtp20.pobox.com
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <9dba6f39-64c8-9077-a866-e0335eabf79b@wichmann.us>
X-Mailman-Original-References: <sid7a6$kcu$1@dont-email.me>
<unlmkg1aiusdhpau4ojj05hbms6c01eoi5@4ax.com>
 by: Mats Wichmann - Thu, 23 Sep 2021 12:53 UTC

On 9/22/21 10:31, Dennis Lee Bieber wrote:

> If you control both the data generation and the data consumption,
> finding some format ...

This is really the key. I rant at people seeming to believe that csv is
THE data interchange format, and it's about as bad as it gets at that,
if you have a choice. xml is noisy but at least (potentially)
self-documenting, and ought to be able to recover from certain errors.
The problem with csv is that a substantial chunk of the world seems to
live inside Excel, and so data is commonly both generated in csv so it
can be imported into excel and generated in csv as a result of exporting
from excel, so the parts often are *not* in your control.

Sigh.

Re: XML Considered Harmful

<f36eaa31-62ff-43b1-ad82-a08df4c0bb26n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19726&group=comp.lang.python#19726

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a0c:816b:: with SMTP id 98mr4529074qvc.37.1632403628463;
Thu, 23 Sep 2021 06:27:08 -0700 (PDT)
X-Received: by 2002:ad4:5630:: with SMTP id cb16mr4087067qvb.45.1632403628278;
Thu, 23 Sep 2021 06:27:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Thu, 23 Sep 2021 06:27:08 -0700 (PDT)
In-Reply-To: <b5e3b045-b822-47f9-b282-2abe2312bafcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <sid7a6$kcu$1@dont-email.me> <b5e3b045-b822-47f9-b282-2abe2312bafcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f36eaa31-62ff-43b1-ad82-a08df4c0bb26n@googlegroups.com>
Subject: Re: XML Considered Harmful
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 23 Sep 2021 13:27:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 30
 by: Mostowski Collapse - Thu, 23 Sep 2021 13:27 UTC

I didn't slam Python. In the end I found PyPy, and had good results.
But there are like two kind of lists, one moderated and one unmoderated.
For example my PyPy testing is not found here:

https://mail.python.org/pipermail/python-list/2021-September/thread.html#start

On the other and this thread is intact:

https://groups.google.com/g/comp.lang.python/c/JrZ-Zywmzwg/m/wEArUPblAwAJ

Also on pipermail there is a strange chronological reordering. My
last recorded post is from 16. Sept from then on I got censored,
whereas Schachner, Joseph post is from 14. Sept and follows

my post. So I guess the list is heavily manipulated. Which is a pitty,
since Python has nothing to hide. Its a good language.

Mark Lawrence schrieb am Mittwoch, 22. September 2021 um 21:41:14 UTC+2:
> On Tuesday, September 21, 2021 at 7:12:33 PM UTC+1, Michael F. Stemper wrote:
> > On the prolog thread, somebody posted a link to:
> > <https://dirtsimple.org/2004/12/python-is-not-java.html>
> Me, but as the moderators on this group/mailing list have no objection to some people slamming Python where ever and whenever they like it, and when I object I get banned need I say more? Python doesn't discriminate against anybody unless you're on the autistic spectrum, in which case you can fuck off.
> > --
> > Michael F. Stemper
> > Life's too important to take seriously.

Re: XML Considered Harmful

<mailman.779.1632403647.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19727&group=comp.lang.python#19727

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: rosuav@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: XML Considered Harmful
Date: Thu, 23 Sep 2021 23:27:13 +1000
Lines: 30
Message-ID: <mailman.779.1632403647.4164.python-list@python.org>
References: <sid7a6$kcu$1@dont-email.me>
<unlmkg1aiusdhpau4ojj05hbms6c01eoi5@4ax.com>
<9dba6f39-64c8-9077-a866-e0335eabf79b@wichmann.us>
<CAPTjJmpMnuV-_xUox+NSRmdd6HjMiGdUu0scKhUWGzuvQVmA1Q@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de E+HyjqFY8X3mTUQHC8gnzQIkEX5Crqp8xJgGbLWB7WxQ==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=ltP4xFk8;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'generated': 0.03; 'csv':
0.03; 'stream': 0.04; 'is.': 0.05; 'internet,': 0.07; '*not*':
0.09; 'choice.': 0.09; 'json': 0.09; 'ultimate': 0.09; 'chrisa':
0.16; 'excel,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris
angelico': 0.16; 'key.': 0.16; 'mats': 0.16; 'noisy': 0.16;
'recover': 0.16; 'sigh.': 0.16; 'sole': 0.16; 'wichmann': 0.16;
'wrote:': 0.16; 'problem': 0.16; 'thu,': 0.19; 'to:addr:python-
list': 0.20; 'seems': 0.26; "isn't": 0.27; 'program,': 0.31;
'program': 0.31; 'think': 0.32; 'assume': 0.32; 'format,': 0.32;
'sep': 0.32; 'to:name:python': 0.32; 'message-id:@mail.gmail.com':
0.32; 'but': 0.32; 'there': 0.33; 'able': 0.34; 'header:In-Reply-
To:1': 0.34; 'received:google.com': 0.34; 'received:209.85.166':
0.35; 'from:addr:gmail.com': 0.35; 'people': 0.36; 'really': 0.37;
"it's": 0.37; 'received:209.85': 0.37; 'received:209': 0.39;
'least': 0.39; 'single': 0.39; 'enough': 0.39; 'finding': 0.39;
'define': 0.40; 'both': 0.40; 'likely': 0.61; 'format': 0.62;
'generation': 0.62; 'substantial': 0.64; 'universal': 0.64;
'your': 0.64; 'parts': 0.65; 'bad': 0.67; 'that,': 0.67; 'live':
0.68; 'excel': 0.69; '2021': 0.71; 'control.': 0.84; 'exporting':
0.84; 'ultimately': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=I/7aqDfC32O7hzg+rIbaqMVizCPCRn0sYJ6oxAw/1KU=;
b=ltP4xFk858VFAmUC+YIQ0VMePfgSP6oghGRjhWcQzxXP5cBiF+5vjUE9mhB617A248
6384y2pd37EOI3VpwDPUoBxWVHmNpdNn9SIrCMS/gYU9Dd9/RWgZXQWII7OFQxoOyPZo
PWBxoSMFXgTMtz/zUvcE0ErNEKvfCovvOK/oXNzreJJwYH6c/kHnZdH1QyCkHfitlI4E
5no+CgVzN8wVnD3PxLLZrL5ww37A4l4pIMTg0x+myhNvlc2aLLOwJBnilinc6xEZqMlD
5hyz3JnmDTUdbG8sh/czp2kxJqPT8sODmDcJkpuis+efoZBbAb0bsLAZiV64LfHxVx6v
IzKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=I/7aqDfC32O7hzg+rIbaqMVizCPCRn0sYJ6oxAw/1KU=;
b=FddN93HsZKIRS1S2AGaz3elTLYJQd1yv5UGJPSspE9lW0+rymi1f/TacfaKkgKFrCr
f3AdlR+HkmmYH8ofqzB58HfEeaGgIPC/2yS4vOuAuvj44dG7y7UOGJlGBHn9fpPCzru3
dhMEFOAkemXJDLAKWexV8hkh28q+o9PEvDmuzZ9B5J/kuP6l0WWcWyQYNrfC17jknVwL
V57XZBFzMd6kqEa/VXZzA2AsxQzDUgwppRgPvTWj6LSzkmcrNKe1SgrFC0j7L3+vvNGj
urzMv58lk4k/Y5M4Axwpjq0hGwX9dEILY+hTTBkj2RmUDCPaUykmQDfNV2vsgKLpv5uz
2pXg==
X-Gm-Message-State: AOAM5323qMo+kx2GCOI+fDd5QwOVcU54Eti+B2uTkxEmhxs0UAJiyJcZ
zQSBzPixJU/r+f0J7WvDLS6XssuivhNXqUriReOkz9QmnTk=
X-Google-Smtp-Source: ABdhPJxPoXQnoPiEowziSFMLup31wnGfEI9J1nEXh17f7WT6agBnLkf8AyFHCbBmegCGPDPbQ+ItH9QfHfjqrsja2Jc=
X-Received: by 2002:a92:d40d:: with SMTP id q13mr3670623ilm.161.1632403643921;
Thu, 23 Sep 2021 06:27:23 -0700 (PDT)
In-Reply-To: <9dba6f39-64c8-9077-a866-e0335eabf79b@wichmann.us>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmpMnuV-_xUox+NSRmdd6HjMiGdUu0scKhUWGzuvQVmA1Q@mail.gmail.com>
X-Mailman-Original-References: <sid7a6$kcu$1@dont-email.me>
<unlmkg1aiusdhpau4ojj05hbms6c01eoi5@4ax.com>
<9dba6f39-64c8-9077-a866-e0335eabf79b@wichmann.us>
 by: Chris Angelico - Thu, 23 Sep 2021 13:27 UTC

On Thu, Sep 23, 2021 at 10:55 PM Mats Wichmann <mats@wichmann.us> wrote:
>
> On 9/22/21 10:31, Dennis Lee Bieber wrote:
>
> > If you control both the data generation and the data consumption,
> > finding some format ...
>
> This is really the key. I rant at people seeming to believe that csv is
> THE data interchange format, and it's about as bad as it gets at that,
> if you have a choice. xml is noisy but at least (potentially)
> self-documenting, and ought to be able to recover from certain errors.
> The problem with csv is that a substantial chunk of the world seems to
> live inside Excel, and so data is commonly both generated in csv so it
> can be imported into excel and generated in csv as a result of exporting
> from excel, so the parts often are *not* in your control.
>
> Sigh.

The only people who think that CSV is *the* format are people who
habitually live in spreadsheets. People who move data around the
internet, from program to program, are much more likely to assume that
JSON is the sole format. Of course, there is no single ultimate data
interchange format, but JSON is a lot closer to one than CSV is.

(Or to be more precise: any such thing as a "single ultimate data
interchange format" will be so generic that it isn't enough to define
everything. For instance, "a stream of bytes" is a universal data
interchange format, but that's not ultimately a very useful claim.)

ChrisA

Re: XML Considered Harmful

<17f8969a-d48c-46f3-ab5e-555eafa97e39n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19728&group=comp.lang.python#19728

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a37:a7d3:: with SMTP id q202mr4762955qke.418.1632404134148;
Thu, 23 Sep 2021 06:35:34 -0700 (PDT)
X-Received: by 2002:a37:a143:: with SMTP id k64mr4689965qke.402.1632404133965;
Thu, 23 Sep 2021 06:35:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Thu, 23 Sep 2021 06:35:33 -0700 (PDT)
In-Reply-To: <f36eaa31-62ff-43b1-ad82-a08df4c0bb26n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <sid7a6$kcu$1@dont-email.me> <b5e3b045-b822-47f9-b282-2abe2312bafcn@googlegroups.com>
<f36eaa31-62ff-43b1-ad82-a08df4c0bb26n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <17f8969a-d48c-46f3-ab5e-555eafa97e39n@googlegroups.com>
Subject: Re: XML Considered Harmful
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 23 Sep 2021 13:35:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 39
 by: Mostowski Collapse - Thu, 23 Sep 2021 13:35 UTC

Or its a problem with the thread view on pipermail.
If I use the date view I see again other stuff.

---- end excursion, wont interupt again ---

Mostowski Collapse schrieb am Donnerstag, 23. September 2021 um 15:27:19 UTC+2:
> I didn't slam Python. In the end I found PyPy, and had good results.
> But there are like two kind of lists, one moderated and one unmoderated.
> For example my PyPy testing is not found here:
>
> https://mail.python.org/pipermail/python-list/2021-September/thread.html#start
>
> On the other and this thread is intact:
>
> https://groups.google.com/g/comp.lang.python/c/JrZ-Zywmzwg/m/wEArUPblAwAJ
>
> Also on pipermail there is a strange chronological reordering. My
> last recorded post is from 16. Sept from then on I got censored,
> whereas Schachner, Joseph post is from 14. Sept and follows
>
> my post. So I guess the list is heavily manipulated. Which is a pitty,
> since Python has nothing to hide. Its a good language.
> Mark Lawrence schrieb am Mittwoch, 22. September 2021 um 21:41:14 UTC+2:
> > On Tuesday, September 21, 2021 at 7:12:33 PM UTC+1, Michael F. Stemper wrote:
> > > On the prolog thread, somebody posted a link to:
> > > <https://dirtsimple.org/2004/12/python-is-not-java.html>
> > Me, but as the moderators on this group/mailing list have no objection to some people slamming Python where ever and whenever they like it, and when I object I get banned need I say more? Python doesn't discriminate against anybody unless you're on the autistic spectrum, in which case you can fuck off.
> > > --
> > > Michael F. Stemper
> > > Life's too important to take seriously.


devel / comp.lang.python / XML Considered Harmful

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor