{"id":30950939,"url":"https://github.com/imgurbot12/pyxml","last_synced_at":"2025-09-11T05:28:06.369Z","repository":{"id":149899516,"uuid":"622381681","full_name":"imgurbot12/pyxml","owner":"imgurbot12","description":"Pure python3 alternative to stdlib xml.etree with HTML support","archived":false,"fork":false,"pushed_at":"2025-01-07T22:47:56.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T23:31:18.676Z","etag":null,"topics":["html-parser","parser","python","python3","xml","xml-parser"],"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/imgurbot12.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}},"created_at":"2023-04-01T23:53:37.000Z","updated_at":"2025-01-07T22:48:00.000Z","dependencies_parsed_at":"2025-01-07T23:27:03.555Z","dependency_job_id":"0a084787-3a64-4359-bccb-c1668da62229","html_url":"https://github.com/imgurbot12/pyxml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imgurbot12/pyxml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgurbot12%2Fpyxml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgurbot12%2Fpyxml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgurbot12%2Fpyxml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgurbot12%2Fpyxml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imgurbot12","download_url":"https://codeload.github.com/imgurbot12/pyxml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgurbot12%2Fpyxml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274582547,"owners_count":25311639,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["html-parser","parser","python","python3","xml","xml-parser"],"created_at":"2025-09-11T05:27:17.545Z","updated_at":"2025-09-11T05:28:06.361Z","avatar_url":"https://github.com/imgurbot12.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pyxml\n------\nPure python3 alternative to stdlib xml.etree with HTML support\n\n### Install\n\n```\npip install pyxml3\n```\n\n### Advantages\n\n1. The default parser ignores XML Declaration Entities avoiding \n   most if not all XML related vulnerabilities such as \n   [The Billion Laughs Attack](https://en.wikipedia.org/wiki/Billion_laughs_attack)\n \n2. Our XPATH implementation is much more complete than both xml.etree\n   and even LXML. Additional functions and features are available making\n   it easier to quickly parse complex data structures in a single line.\n\n### Examples\n\n###### Standard Usage:\n\n```python\nimport pyxml\n\netree = pyxml.fromstring(b'\u003cp\u003eHello World!\u003c/p\u003e')\nfor element in etree.iter():\n  print(element)\n\nwith open('example.xml', 'rb') as f:\n  etree = pyxml.fromstring(f)\n  print(etree)\n```\n\n###### Monkey Patch:\n\n```python\nimport pyxml\npyxml.compat.monkey_patch()\n\nfrom xml.etree import ElementTree as ET\n\netree = ET.fromstring('\u003cdiv\u003e\u003cp class=\"hello world\"\u003eHello World!\u003c/p\u003e\u003c/div\u003e')\nfor element in etree.iter():\n  print(element)\n\nprint(etree.find('//p[starts-with(lower-case(text()), \"hello\")]'))\n```\n\n###### HTML:\n\n```python\nimport pyxml.html\n\netree = pyxml.html.fromstring('\u003cdiv\u003e\u003cp\u003eHello World!\u003c/p\u003e\u003cbr\u003e\u003c/div\u003e')\nfor element in etree.iter():\n  print(element)\n\nprint(etree.find('//p[notempty(text())]'))\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimgurbot12%2Fpyxml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimgurbot12%2Fpyxml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimgurbot12%2Fpyxml/lists"}