{"id":43942055,"url":"https://github.com/matthewandretaylor/xmlpydict","last_synced_at":"2026-03-11T02:08:12.986Z","repository":{"id":175149203,"uuid":"653444901","full_name":"MatthewAndreTaylor/xmlpydict","owner":"MatthewAndreTaylor","description":"Parse xml to python dictionaries","archived":false,"fork":false,"pushed_at":"2026-03-06T02:51:12.000Z","size":72,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-06T07:33:14.130Z","etag":null,"topics":["dictionary","parser","python3","xml"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/xmlpydict","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/MatthewAndreTaylor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-14T04:22:41.000Z","updated_at":"2026-03-06T02:50:31.000Z","dependencies_parsed_at":"2023-11-06T02:26:38.658Z","dependency_job_id":"b3b90dd1-53eb-4cda-bcda-c3e21eda7388","html_url":"https://github.com/MatthewAndreTaylor/xmlpydict","commit_stats":null,"previous_names":["matthewandretaylor/xml-to-pydict","matthewandretaylor/xmlpydict"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/MatthewAndreTaylor/xmlpydict","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewAndreTaylor%2Fxmlpydict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewAndreTaylor%2Fxmlpydict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewAndreTaylor%2Fxmlpydict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewAndreTaylor%2Fxmlpydict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatthewAndreTaylor","download_url":"https://codeload.github.com/MatthewAndreTaylor/xmlpydict/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewAndreTaylor%2Fxmlpydict/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30195529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dictionary","parser","python3","xml"],"created_at":"2026-02-07T02:06:01.383Z","updated_at":"2026-03-06T20:01:40.882Z","avatar_url":"https://github.com/MatthewAndreTaylor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xmlpydict 📑\n\n[![XML Tests](https://github.com/MatthewAndreTaylor/xml-to-pydict/actions/workflows/tests.yml/badge.svg)](https://github.com/MatthewAndreTaylor/xml-to-pydict/actions/workflows/tests.yml)\n[![PyPI versions](https://img.shields.io/badge/python-3.8%2B-blue)](https://github.com/MatthewAndreTaylor/xml-to-pydict)\n[![PyPI](https://img.shields.io/pypi/v/xmlpydict.svg)](https://pypi.org/project/xmlpydict/)\n\n## Requirements\n\n- `python 3.8+`\n\n## Installation\n\nTo install xmlpydict, using pip:\n\n```bash\npip install xmlpydict\n```\n\n## Quickstart\n\n```py\n\u003e\u003e\u003e from xmlpydict import parse\n\u003e\u003e\u003e parse(\"\u003cpackage\u003e\u003cxmlpydict language='python'/\u003e\u003c/package\u003e\")\n{'package': {'xmlpydict': {'@language': 'python'}}}\n\u003e\u003e\u003e parse(\"\u003cperson name='Matthew'\u003eHello!\u003c/person\u003e\")\n{'person': {'@name': 'Matthew', '#text': 'Hello!'}}\n```\n\n## Goals\n\nCreate a consistent parsing strategy between XML and Python dictionaries using the specification found [here](https://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html). `xmlpydict` focuses on speed; see the benchmarks below.\n\n\u003cimg width=\"256\" alt=\"small_xml_document\" src=\"https://github.com/user-attachments/assets/0248a408-6bb6-4790-bd0f-f90537e2f21a\" /\u003e\n\u003cimg width=\"256\" alt=\"large_xml_document\" src=\"https://github.com/user-attachments/assets/539a2a69-f475-46a5-bffc-1e8805a5a5e7\" /\u003e\n\n\n### xmlpydict supports the following \n\n[CDataSection](https://www.w3.org/TR/xml/#sec-cdata-sect):  CDATA Sections are stored as {'#text': CData}.\n\n[Comments](https://www.w3.org/TR/xml/#sec-comments):  Comments are tokenized for corectness, but have no effect in what is returned.\n\n[Element Tags](https://www.w3.org/TR/xml/#sec-starttags):  Allows for duplicate attributes, however only the latest defined will be taken. \n\n[Characters](https://www.w3.org/TR/xml/#charsets):  Similar to CDATA text is stored as {'#text': Char} , however this text is stripped.\n\n```py\n# Empty tags are containers\n\u003e\u003e\u003e from xmlpydict import parse\n\u003e\u003e\u003e parse(\"\u003ca\u003e\u003c/a\u003e\")\n{'a': None}\n\u003e\u003e\u003e parse(\"\u003ca/\u003e\")\n{'a': None}\n\u003e\u003e\u003e parse(\"\u003ca/\u003e\").get('href')\nNone\n```\n\n### Attribute prefixing\n\n```py\n# Change prefix from default \"@\" with keyword argument attr_prefix\n\u003e\u003e\u003e from xmlpydict import parse\n\u003e\u003e\u003e parse('\u003cp width=\"10\" height=\"5\"\u003e\u003c/p\u003e', attr_prefix=\"$\")\n{\"p\": {\"$width\": \"10\", \"$height\": \"5\"}}\n```\n\n\n### Exceptions\n\n```py\n# Grammar and structure of the xml_content is checked while parsing\n\u003e\u003e\u003e from xmlpydict import parse\n\u003e\u003e\u003e parse(\"\u003ca\u003e\u003c/ a\u003e\")\nxml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 5\n```\n\n\n### Unsupported\n\nProlog / Enforcing Document Type Definition and Element Type Declarations\n\nEntity Referencing\n\nNamespaces\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewandretaylor%2Fxmlpydict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewandretaylor%2Fxmlpydict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewandretaylor%2Fxmlpydict/lists"}