All Projects → stchris → Untangle

stchris / Untangle

Licence: mit
Converts XML to Python objects

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Untangle

Piprot
How rotten are your requirements?
Stars: ✭ 409 (-18.04%)
Mutual labels:  pypi
Node Xml2js
XML to JavaScript object converter.
Stars: ✭ 4,402 (+782.16%)
Mutual labels:  xml
Iguana
universal serialization engine
Stars: ✭ 481 (-3.61%)
Mutual labels:  xml
Fluidxml
FluidXML, the PHP library for manipulating XML with a concise and fluent API.
Stars: ✭ 417 (-16.43%)
Mutual labels:  xml
Veditorkit
Lightweight and Powerful Editor Kit
Stars: ✭ 441 (-11.62%)
Mutual labels:  xml
Xmlcoder
Easy XML parsing using Codable protocols in Swift
Stars: ✭ 460 (-7.82%)
Mutual labels:  xml
Pypicloud
S3-backed pypi server implementation
Stars: ✭ 399 (-20.04%)
Mutual labels:  pypi
Log4rs
A highly configurable logging framework for Rust
Stars: ✭ 483 (-3.21%)
Mutual labels:  xml
Devpi
Python PyPi staging server and packaging, testing, release tool
Stars: ✭ 444 (-11.02%)
Mutual labels:  pypi
Folder Explorer
分析文件目录,统计数据并以树形结构和图表的形式展示结果,也可以导出多种格式留存
Stars: ✭ 479 (-4.01%)
Mutual labels:  xml
Pygmsh
Gmsh for Python
Stars: ✭ 418 (-16.23%)
Mutual labels:  pypi
Camaro
camaro is an utility to transform XML to JSON, using Node.js binding to native XML parser pugixml, one of the fastest XML parser around.
Stars: ✭ 438 (-12.22%)
Mutual labels:  xml
Wiremock
A tool for mocking HTTP services
Stars: ✭ 4,790 (+859.92%)
Mutual labels:  xml
Strongbox
Strongbox is an artifact repository manager.
Stars: ✭ 412 (-17.43%)
Mutual labels:  pypi
Quick Xml
Rust high performance xml reader and writer
Stars: ✭ 480 (-3.81%)
Mutual labels:  xml
Wikiteam
Tools for downloading and preserving wikis. We archive wikis, from Wikipedia to tiniest wikis. As of 2020, WikiTeam has preserved more than 250,000 wikis.
Stars: ✭ 404 (-19.04%)
Mutual labels:  xml
Zek
Generate a Go struct from XML.
Stars: ✭ 451 (-9.62%)
Mutual labels:  xml
Finviz
Unofficial API for finviz.com
Stars: ✭ 493 (-1.2%)
Mutual labels:  pypi
Corexlsx
Excel spreadsheet (XLSX) format parser written in pure Swift
Stars: ✭ 481 (-3.61%)
Mutual labels:  xml
Soapengine
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app.
Stars: ✭ 468 (-6.21%)
Mutual labels:  xml

untangle

Build Status PyPi version Code style: black

Documentation

  • Converts XML to a Python object.
  • Siblings with similar names are grouped into a list.
  • Children can be accessed with parent.child, attributes with element['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 with foobar.foo_bar, <foo.bar.baz/> can be accessed with foo_bar_baz and <foo:bar><foo:baz/></foo:bar> can be accessed with foo_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 untangled object like this:

obj.root.child['name'] # u'child1'

Changelog

see CHANGELOG.md

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].