This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Python LXML object binding.

[![Build Status](https://travis-ci.org/jessemyers/lxmlbind.png)](https://travis-ci.org/jessemyers/lxmlbind)

What is this?

The [xml.etree][1] library is a great way to manipulate XML in Python, but in most domains it is clearer to use objects that model your domain entities instead of manipulating the XML representation directly. The motivating example was [Jenkins][2] XML job configurations, but the same problem is likely to exist for any XML-based modeling.

This project attempts to use Python [data descriptors][3] to bind an element tree to Python objects.

[1]: http://lxml.de/tutorial.html [2]: http://jenkins-ci.org/ [3]: http://docs.python.org/2/howto/descriptor.html

Example

Assume that you have an API using XML representations of people with first and last names:

xml = “<person><first>John</first><last>Doe</last></person”

lxmlbind makes it easy to define a \(Person\) object that maps to this structure:

from lxmlbind.api import Base, Property

class Person(Base):
first = Property(“first”) last = Property(“last”)

Instances of \(Person\) wrap an \(lxml.etree\) and support manipulation of this structure through instance attributes:

# create the person from XML person = Person.from_xml(xml)

# get the first name attribute assert person.first == “John”

# set the last name attribute person.last = “Smith”

# print the resulting XML print person.to_xml()

# delete the first name entirely del person.first

Release History

Release History

1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
lxmlbind-1.2.tar.gz (10.6 kB) Copy SHA256 Checksum SHA256 Source Dec 17, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting