{"id":16299612,"url":"https://github.com/dcwatson/drill","last_synced_at":"2025-04-06T07:32:19.821Z","repository":{"id":57424150,"uuid":"4873950","full_name":"dcwatson/drill","owner":"dcwatson","description":"A small python library for quickly traversing XML data.","archived":false,"fork":false,"pushed_at":"2018-12-03T00:30:54.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T19:04:56.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcwatson.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}},"created_at":"2012-07-03T15:30:09.000Z","updated_at":"2018-12-03T00:30:55.000Z","dependencies_parsed_at":"2022-09-14T08:51:25.036Z","dependency_job_id":null,"html_url":"https://github.com/dcwatson/drill","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcwatson%2Fdrill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcwatson%2Fdrill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcwatson%2Fdrill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcwatson%2Fdrill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcwatson","download_url":"https://codeload.github.com/dcwatson/drill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247450465,"owners_count":20940924,"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":[],"created_at":"2024-10-10T20:48:43.410Z","updated_at":"2025-04-06T07:32:19.534Z","avatar_url":"https://github.com/dcwatson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Basic Usage\n\n    import drill\n    doc = drill.parse(path_or_url_or_string)\n    \n    # Drill down to a specific element.\n    print unicode(doc.book.title)\n    \n    # Iterate through all \"title\" tags in the document.\n    for t in doc.iter('title'):\n        print t.attrs, t.data\n    \n    # Find all \"bar\" nodes with a \"baz\" child and a \"foo\" parent.\n    q = doc.find('//foo/bar[baz]')\n    # Easily access the first and last elements of matching results.\n    print q.first(), q.last()\n    # Iterate over results.\n    for e in q:\n        do_something(e)\n    \n    # Parse only elements matching some path\n    for e in drill.iterparse(filelike, xpath='root/*/something'):\n        print e.tagname, e.data\n\n## Features\n\n* Runnable test suite\n* Python 3 support\n\n## Advantages\n\n* Pure python\n* Faster, more efficient parsing than ElementTree\n    * Using ElementTree, a ~150 MB XML file (~3,000,000 elements) took ~46 seconds to parse, consuming ~1.3 GB of RAM\n    * Parsing the same file using drill took ~24 seconds and consumed ~950 MB of RAM\n    * Very unscientific benchmarks performed on a Core i5 @ 2.8 GHz, running Windows 7. YMMV.\n* Lots of convenience methods for accessing elements quickly:\n    * doc.response.resultCode.data\n    * root[2].child['attr']\n    * first/last/prev/next methods for traversing siblings\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcwatson%2Fdrill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcwatson%2Fdrill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcwatson%2Fdrill/lists"}