Python implementation of Ruby's builder.
Switch branches/tags
Nothing to show
Clone or download
galvez Updated README in plain-text.
Updated setup import in
Latest commit 07ff9c9 Aug 25, 2016


Build Status

xmlwitch is a BSD-licensed, Python 2.5+ library that offers idiomatic XML generation through context managers (with statement) in a minimalist implementation with less than 100 lines of code. To install, just run pip install xmlwitch, easy_install xmlwitch or copy to your appropriate project's directory. It's just one file.

import xmlwitch
xml = xmlwitch.Builder(version='1.0', encoding='utf-8')
with xml.feed(xmlns=''):
    xml.title('Example Feed')
    with'John Doe')'urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6')
    with xml.entry:
        xml.title('Atom-Powered Robots Run Amok')'urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a')
        xml.summary('Some text.')

Thanks to maskllin, bbolli and kcsaff for contributions. Pull requests are welcome.