{"id":13610249,"url":"https://github.com/stchris/untangle","last_synced_at":"2025-05-14T13:07:52.287Z","repository":{"id":39737949,"uuid":"1849865","full_name":"stchris/untangle","owner":"stchris","description":"Converts XML to Python objects","archived":false,"fork":false,"pushed_at":"2024-01-19T08:34:06.000Z","size":190,"stargazers_count":620,"open_issues_count":24,"forks_count":84,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-04-10T03:47:34.728Z","etag":null,"topics":["pypi","python","xml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stchris.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null},"funding":{"github":"stchris","liberapay":"stchris"}},"created_at":"2011-06-05T10:12:12.000Z","updated_at":"2025-03-05T09:10:29.000Z","dependencies_parsed_at":"2023-02-19T16:00:58.762Z","dependency_job_id":"93eea050-c56b-4f55-ad35-263088a9df7a","html_url":"https://github.com/stchris/untangle","commit_stats":{"total_commits":191,"total_committers":17,"mean_commits":"11.235294117647058","dds":"0.47643979057591623","last_synced_commit":"9e3f5bab3ef528b3c71683721d01de9f8c494ddc"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stchris%2Funtangle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stchris%2Funtangle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stchris%2Funtangle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stchris%2Funtangle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stchris","download_url":"https://codeload.github.com/stchris/untangle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149959,"owners_count":22022851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pypi","python","xml"],"created_at":"2024-08-01T19:01:42.910Z","updated_at":"2025-05-14T13:07:47.266Z","avatar_url":"https://github.com/stchris.png","language":"Python","funding_links":["https://github.com/sponsors/stchris","https://liberapay.com/stchris"],"categories":["HTML Manipulation","资源列表","HTML 处理","HTML操作","Python","HTML Manipulation [🔝](#readme)","Awesome Python"],"sub_categories":["HTML 处理","HTML Manipulation"],"readme":"untangle\n========\n\n[![Build Status](https://github.com/stchris/untangle/actions/workflows/build.yml/badge.svg)](https://github.com/stchris/untangle/actions)\n[![PyPi version](https://img.shields.io/pypi/v/untangle.svg)](https://pypi.python.org/pypi/untangle)\n\u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n\n[Documentation](http://readthedocs.org/docs/untangle/en/latest/)\n\n* Converts XML to a Python object.\n* Siblings with similar names are grouped into a list.\n* Children can be accessed with ``parent.child``, attributes with ``element['attribute']``.\n* You can call the ``parse()`` method with a filename, an URL or an XML string.\n* Substitutes ``-``, ``.`` and ``:`` with ``_`` ``\u003cfoobar\u003e\u003cfoo-bar/\u003e\u003c/foobar\u003e`` can be accessed with ``foobar.foo_bar``, ``\u003cfoo.bar.baz/\u003e`` can be accessed with ``foo_bar_baz`` and ``\u003cfoo:bar\u003e\u003cfoo:baz/\u003e\u003c/foo:bar\u003e`` can be accessed with ``foo_bar.foo_baz``\n* Works with Python 3.7 - 3.10\n\nInstallation\n------------\n\nWith pip:\n```\npip install untangle\n```\n\nWith conda:\n```\nconda install -c conda-forge untangle\n```\n\nConda feedstock maintained by @htenkanen. Issues and questions about conda-forge packaging / installation can be done [here](https://github.com/conda-forge/untangle-feedstock/issues).\n\nUsage\n-----\n(See and run \u003ca href=\"https://github.com/stchris/untangle/blob/main/examples.py\"\u003eexamples.py\u003c/a\u003e or this blog post: [Read XML painlessly](http://pythonadventures.wordpress.com/2011/10/30/read-xml-painlessly/) for more info)\n\n```python\nimport untangle\nobj = untangle.parse(resource)\n```\n\n``resource`` can be:\n\n* a URL\n* a filename\n* an XML string\n\nRunning the above code and passing this XML:\n\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003croot\u003e\n\t\u003cchild name=\"child1\"/\u003e\n\u003c/root\u003e\n```\nallows it to be navigated from the ``untangle``d object like this:\n\n```python\nobj.root.child['name'] # u'child1'\n```\n\nChangelog\n---------\n\nsee CHANGELOG.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstchris%2Funtangle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstchris%2Funtangle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstchris%2Funtangle/lists"}