On Thu, Oct 30, 2014 at 10:53:32AM -0200, Raniere Silva wrote:
> > The idea is that they will need to grab some XML files, parse them
> > and then do some rather simple manipulation with the outputs.
> 
> What about using JSON or YAML instead of XML?

I agree that if the point is “(de)serializing structured data” (and
not “maniplulate XML”), I'd use JSON.  It even looks a lot like
Python's dict/list/string/number syntax.  For fun, you could have them
drive the GitHub API [1] or NASA [2].

> > ElementTree vs lxml is the argument you'll get into for which
> > Python XML library you're going to want to use. I can't comment on
> > this.
> 
> Just a few words from my experience. ElementTree avoid user to
> install third party libraries but isn't easy to use. lxml is fast
> but the documentation need a little improvement for a novice
> perspective.

lxml.etree [3] and the standard library's ElementTree [4] have a very
similar syntax.  lxml makes it easier to find siblings (see the
“lxml.etree only!” comments in [3]), but I'd just stick to the
standard library for a beginner class.

Cheers,
Trevor

[1]: https://developer.github.com/v3/
[2]: http://data.nasa.gov/api-info/
     The first hit while searching for “json api science” ;)
[3]: http://lxml.de/tutorial.html
[4]: https://docs.python.org/2/library/xml.etree.elementtree.html

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Discuss mailing list
[email protected]
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org

Reply via email to