Speedy XML parser for Python
Project description
Usage is fairly straightforward:
import speedyxml
xml = speedyxml.parse('<xml><test this="now" /></xml>')
Will result in:
(
u'xml',
None,
[
(
u'test',
{u'this': u'now'},
None
)
]
)
So basically its:
(nodeName, attributes, children)
Plus some options (second argument to parse)
FLAG_EXPANDEMPTY
If you want empty attributes and children to be {} and [] instead of None, use this
FLAG_RETURNCOMMENTS
Return comments as:
(TAG_COMMENT, None, u' comment ')
FLAG_RETURNPI
Returns processing instructions as:
(TAG_PI, {u'name': u'php'}, u'phpinfo();')
FLAG_RETURNPOSITIONS
return position of tags in fourth entry in tuple
FLAG_IGNOREENTITIES
does not resolve entities when set
And one exception:
XMLParseException
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
speedyxml-0.4.1.1.tar.gz
(12.9 kB
view details)
File details
Details for the file speedyxml-0.4.1.1.tar.gz.
File metadata
- Download URL: speedyxml-0.4.1.1.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2f781f0c2ae06800d7eed58f69f11fc0224297bf26c0efdd55f683e3febbf6f
|
|
| MD5 |
94a9a1a903413240160da6cf5277a6ca
|
|
| BLAKE2b-256 |
19591b7acc303c788fd5084132f376d7d77905a39fbe5a31e8eff846479e9552
|