Description
OR
try the latest .deb
untangle alternatives and similar packages
Based on the "HTML Manipulation" category.
Alternatively, view untangle alternatives based on common mentions on social networks and blogs.
-
xmltodict
Python module that makes working with XML feel like you are working with JSON -
bleach
Bleach is an allowed-list-based HTML sanitizing library that escapes or strips markup and attributes -
html5lib
Standards-compliant library for parsing and serializing HTML documents and fragments in Python -
selectolax
Python binding to Modest and Lexbor engines (fast HTML5 parser with CSS selectors). -
BeautifulSoup
Providing Pythonic idioms for iterating, searching, and modifying HTML or XML.
InfluxDB - Power Real-Time Data Analytics at Scale
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of untangle or a related project?
README
untangle
- Converts XML to a Python object.
- Siblings with similar names are grouped into a list.
- Children can be accessed with
parent.child
, attributes withelement['attribute']
. - You can call the
parse()
method with a filename, an URL or an XML string. - Substitutes
-
,.
and:
with_
<foobar><foo-bar/></foobar>
can be accessed withfoobar.foo_bar
,<foo.bar.baz/>
can be accessed withfoo_bar_baz
and<foo:bar><foo:baz/></foo:bar>
can be accessed withfoo_bar.foo_baz
- Works with Python 2.7 and 3.4, 3.5, 3.6, 3.7, 3.8 and pypy
Installation
With pip:
pip install untangle
With conda:
conda install -c conda-forge untangle
Conda feedstock maintained by @htenkanen. Issues and questions about conda-forge packaging / installation can be done here.
Usage
(See and run examples.py or this blog post: Read XML painlessly for more info)
import untangle
obj = untangle.parse(resource)
resource
can be:
- a URL
- a filename
- an XML string
Running the above code and passing this XML:
<?xml version="1.0"?>
<root>
<child name="child1"/>
</root>
allows it to be navigated from the untangle
d object like this:
obj.root.child['name'] # u'child1'
Changelog
see CHANGELOG.md