The Principal Dev – Masterclass for Tech Leads

The Principal Dev – Masterclass for Tech Leads28-29 May

Join

untangle

Build Status PyPi version Code style: black

Documentation

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:

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

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.