Software Index
Linux Software Utilities  

dexml

download download home home   report broken
important software information
company name:
Ryan Kelly
license: Freeware
minimum requirements:
functional limitations:
dexml description


dexml is a dead-simple Object-XML mapper for Python.

Let's face it: xml is a fact of modern life. I'd even go so far as to say that it's good at what is does. But that doesn't mean it's easy to work with and it doesn't mean that we have to like it. Most of the time, XML just needs to get the hell out of the way and let you do some actual work instead of writing code to traverse and manipulate yet another DOM.

The dexml module takes the obvious mapping between XML tags and Python objects and lets you capture that as cleanly as possible. Loosely inspired by Django's ORM, you write simple class definitions to define the expected structure of your XML document. Like so:

>>> import dexml
>>> from dexml import fields
>>> class Person(dexml.Model):
... name = fields.String()
... age = fields.Integer(tagname='age')

Then you can parse an XML document into an object like this:

>>> p = Person.parse("< Person name='Foo McBar' >< age >42< /age >< /Person >")
>>> p.name
u'Foo McBar'
>>> p.age
42

And you can render an object into an XML document like this:

>>> p = Person(name="Handsome B. Wonderful",age=36)
>>> p.render()
'< ?xml version="1.0" ? >< Person name="Handsome B. Wonderful" >< age >36< /age >< /Person >'

Malformed documents will raise a ParseError:

>>> p = Person.parse("< Person >< age >92< /age >< /Person >")
Traceback (most recent call last):
...
ParseError: required field not found: 'name'

Of course, it gets more interesting when you nest Model definitions, like this:

>>> class Group(dexml.Model):
... name = fields.String(attrname="name")
... members = fields.List(Person)
...
>>> g = Group(name="Monty Python")
>>> g.members.append(Person(name="John Cleese",age=69))
>>> g.members.append(Person(name="Terry Jones",age=67))
>>> g.render(fragment=True)
'< Group name="Monty Python" >< Person name="John Cleese" >< age >69< /Person >< Person name="Terry Jones" >< age >67< /age >< /Person>< /Group >'. . Publisher of dexml, Author of dexml 0.1.1. dexml is a dead-simple Object-XML mapper for Python. Let's face it: xml is a fact of modern life. I'd even go so far as to say that it's good at what is does. But that doesn&#



Similar software
Dark Orange Fox (Popularity: ) : Dark Orange Fox is a new dark orange theme for Firefox 3.0.* and 3.1.

Developer comments

I used the base from my Blue Fox/Green Fox themes to make it!. A friend of mine saw my other themes and he wanted to see ...

Dark-elementary for GNOME & XFCE (Popularity: ) : Dark-elementary for GNOME & XFCE is a mix between the Elementary and Shiki themes. Be sure to use the Elementary icons 2.1.

How to install?

· Right click on your desktop and select Change Desktop Background
· Click on the first tab: Theme
· ...

User reviews

Write a review:
1 2 3 4 5 6 7 8 9 10
1=poor 10=excellent
Write review*
Your name*
Email*
  (Comments are moderated, and will not appear on this site until the editor has approved them)
 
AD


Rate me
supported os's
stats
downloads 5
version 0.1.1
size in Kb 10
popularity   
899/1272475
user rating 5/10
our rating 0 Stars
share info
Recommend dexml
Report spyware
New Software
Popular Software
Latest Reviews