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_bazand<foo:bar><foo:baz/></foo:bar>can be accessed withfoo_bar.foo_baz
Installation
With pip:
pip install untangle
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 (a string or an
os.PathLikeobject such aspathlib.Path) - 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 untangled object like this:
obj.root.child["name"] # u'child1'
Development
untangle uses uv for builds and virtualenv management:
$ uv sync
Run tests:
$ uv run pytest
Run linter:
$ uv run ruff check .
Run formatter checks:
$ uv run ruff format --check
Run type hint checks:
$ uv run ty check .
Changelog
see CHANGELOG.md
Metadata
Release files for untangle 1.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| untangle-1.3.1.tar.gz | 4.0 kB | With provenance | Details for untangle-1.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| untangle-1.3.1-py3-none-any.whl | Python 3 | none | any | Details for untangle-1.3.1-py3-none-any.whl |
Total release size: 8.3 kB
Release files / untangle-1.3.1.tar.gz
| Download URL | untangle-1.3.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6cac211f4d877935c1a62f543d40a596f3e4afe44380c4f6a2a1d4428214a5d0
|
|
BLAKE2b-256 checksum How to use checksums |
3cba6db19c34caa1fd66334fd1eb5f2f20df55c549b1968233fe898c4484bda5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / untangle-1.3.1-py3-none-any.whl
| Download URL | untangle-1.3.1-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
987aed263b486e251db3999cc977542e2a030f344788c9d7f2bc70e89fae9438
|
|
BLAKE2b-256 checksum How to use checksums |
be32efb0f536d2b22119f6a9ddaf29cac282e4ed432c15d349fb07d5018db863
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logSecurity for untangle 1.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for untangle-1.3.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.