ElementTree accessor

Published at 08, May 2009, author art. Tags: python, snippet

As you know, ElementTree's interface is boring and most time you don't need all these findalls and attribs. 80% of code requires simple operation like: "access to child B and get it's attribute C". So, why to type root.find('B').attrib['C'], when you can use simple construction like root.B.C? To accomplish this task, I wrote a simple wrapper for ElementTree.

Look at the examples and run doctests.

Pingbacks

permalink

02, September 2009, pingback from http://topsy.com/tb/aartemenko.com/te...:

ElementTree accessor — Lazy Crazy Coder's blog

Comments

Subscribe on this post's comments

No comments. Wanna be first?

First, identify yourself and come back to leave comments.

If you wish to leave comment, please, identify yourself and then come back to this page.