forked from galvez/xmlwitch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
34 lines (26 loc) · 1.17 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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 xmlwitch.py 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='http://www.w3.org/2005/Atom'):
xml.title('Example Feed')
xml.updated('2003-12-13T18:30:02Z')
with xml.author:
xml.name('John Doe')
xml.id('urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6')
with xml.entry:
xml.title('Atom-Powered Robots Run Amok')
xml.id('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a')
xml.updated('2003-12-13T18:30:02Z')
xml.summary('Some text.')
print(xml)
Please refer to
http://jonasgalvez.com.br/Software/XMLWitch.html
for further info.
Thanks to maskllin[1] and bbolli[2] for contributions.
Pull requests are welcome.
[1] http://github.com/masklinn/
[2] http://github.com/bbolli/