Skip to main content

Brief

alt Latest Version alt License alt Downloads Build Status

A simple xml parse and build library.

Installation

pip install lazyxml

Examples

  • xml to python object
>>> import lazyxml
>>> xml = '<demo><foo>foo</foo><bar>bar</bar></demo>'
>>> lazyxml.loads(xml)
{'bar': 'bar', 'foo': 'foo'}
>>> lazyxml.loads(xml, strip_root=False)
{'demo': {'bar': 'bar', 'foo': 'foo'}}
>>> xml = '<demo><foo>foo</foo><bar>1</bar><bar>2</bar></demo>'
>>> lazyxml.loads(xml)
{'bar': ['1', '2'], 'foo': 'foo'}
  • python object to xml
>>> data = {'demo':{'bar': ['1', '2'], 'foo': '<foo>'}}
>>> lazyxml.dumps(data)
'<?xml version="1.0" encoding="utf-8"?><demo><foo><![CDATA[<foo>]]></foo><bar><![CDATA[1]]></bar><bar><![CDATA[2]]></bar></demo>'
>>> lazyxml.dumps(data, cdata=False)
'<?xml version="1.0" encoding="utf-8"?><demo><foo>&lt;foo&gt;</foo><bar>1</bar><bar>2</bar></demo>'
>>> print lazyxml.dumps(data, indent=' ' * 4)
<?xml version="1.0" encoding="utf-8"?>
<demo>
   <foo><![CDATA[<foo>]]></foo>
   <bar><![CDATA[1]]></bar>
   <bar><![CDATA[2]]></bar>
</demo>

Documentation

See docs in readthedocs

Changelog

See changelog

Release files for lazyxml 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lazyxml 1.3.2
File Size Uploaded
lazyxml-1.3.2.tar.gz 32.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lazyxml 1.3.2
File Interpreter ABI Platform
lazyxml-1.3.2-py2-none-any.whl Python 2 none any Details

Total release size: 41.5 kB

Release files / lazyxml-1.3.2.tar.gz

Download URL lazyxml-1.3.2.tar.gz
Size 32.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cdc7c6ebcef85abd73c52ace006c8efb4b7bb377dbd82cc232e4d3708b5ff20f
BLAKE2b-256 checksum
How to use checksums
13082346e0082fedda12f3dbb19694760f32af6adae0d60880e0d5c1c775e198
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.26.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/2.7.18

Release files / lazyxml-1.3.2-py2-none-any.whl

Download URL lazyxml-1.3.2-py2-none-any.whl
Size 9.3 kB
Tags Python 2
SHA-256 checksum
How to use checksums
aec93d37740fc80032756e2c586a7062ed1439133424b4f3def1c01a47f7d8fd
BLAKE2b-256 checksum
How to use checksums
9b0d39226e75c1e94c3f1155151286bc75598e813e5bb519b511c25223de62ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.26.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/2.7.18

Release history Release notifications | RSS feed

This release

1.3.2 This release

2 release files

1.3.0

2 release files

1.2.1

1 release file

1.2

1 release file

1.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page