A simpler XML writer
Project description
XmlElement
A simpler XML writer.
Installation
pip install XmlElement
Test
>>> from XmlElement import XmlElement as X
>>> xml = X.from_string('<test><x/></test>')
>>> xml
XmlElement(test)
Usage
import XmlElement from XmlElement
xml = XmlElement('RootElement', s=[ # root element without attributes
X('Child1', {'name': 'child1', 'testattr': 'Example attribute'}, [ # sub element with an attribute
X('Child2', t='Example text value') # sub-sub element with text value
])
])
print(xml)
print(xml.Child1[0].attribute['testattr']) # Example attribute
print(xml.Child1[0].Child2[0].text) # Example text value
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
XmlElement-0.1.4.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for XmlElement-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1466a63031e9ae49c47c62e4d05b83ea4fde48b6d51c62855766a5e17e8a026 |
|
MD5 | 02c9d73cbcbb86cb20f98732ec6d9c0e |
|
BLAKE2b-256 | fcad076fae572119424093ed311afd7093eaa7c1df4f81bb91f1c16650a213cf |