{"id":37072245,"url":"https://github.com/pgarrett-scripps/ranged_kdtree","last_synced_at":"2026-01-14T08:28:56.566Z","repository":{"id":50282165,"uuid":"518313510","full_name":"pgarrett-scripps/ranged_kdtree","owner":"pgarrett-scripps","description":"A simple and fast KD-tree for points in Python for kNN or nearest points. (damm short at just ~60 lines) No libraries needed.","archived":false,"fork":true,"pushed_at":"2022-08-23T01:42:03.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-01T04:27:44.605Z","etag":null,"topics":["boundaries","boundary","boundedbox","kdtree","kdtree-algo","kdtrees","python","rangesearch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Vectorized/Python-KD-Tree","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pgarrett-scripps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.rst","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-27T04:52:48.000Z","updated_at":"2024-09-30T21:25:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pgarrett-scripps/ranged_kdtree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pgarrett-scripps/ranged_kdtree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgarrett-scripps%2Franged_kdtree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgarrett-scripps%2Franged_kdtree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgarrett-scripps%2Franged_kdtree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgarrett-scripps%2Franged_kdtree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgarrett-scripps","download_url":"https://codeload.github.com/pgarrett-scripps/ranged_kdtree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgarrett-scripps%2Franged_kdtree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["boundaries","boundary","boundedbox","kdtree","kdtree-algo","kdtrees","python","rangesearch"],"created_at":"2026-01-14T08:28:55.913Z","updated_at":"2026-01-14T08:28:56.558Z","avatar_url":"https://github.com/pgarrett-scripps.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Python KD-Tree for Points Now with Bounded Range Search!\n=========================\n\nA simple and decently performant KD-Tree in Python.\n\nJust about 60 lines of code excluding comments.\n\nIt's so simple that you can just copy and paste, or translate to other languages!   \nYour teacher will assume that you are a good student who coded it from scratch.\n\nRange Search?\n------------\n* get_points_within_bounds(bounds), returns all points within bounds.\n\nbounds = [[lower,upper]]*dim\n\nFor dim = 3 bounds would be:\n\n[[dim1_lower, dim1_upper], [dim2_lower, dim2_upper], [dim3_lower, dim3_upper]]\n\n\n\nWhy?\n----\n\nNo external dependencies like numpy, scipy, etc.\n\nSupports points that are array-like: lists, arrays, numpy arrays.\n\nJust star this project if you find it helpful... so others can know it's better than those long winded kd-tree codes. ;)\n\nRequirements\n------------\n\nPython 2.x or 3.x\n\nDependencies\n------------\n\nNone\n\nNotes\n-----\n\nCreation of the KD-Tree isn't strictly O(n log (n)), but is similar O(n log (n)) in practice.   \nIt abuses Python's native sort (TimSort) which is O(n) for nearly sorted lists.   \n\nAdding too many points relative to the number of points in the tree can degrade performance.   \nIf you are adding many new points into the tree, it is better to re-create the tree.\n\nLicense\n-------\n\nCC0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgarrett-scripps%2Franged_kdtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgarrett-scripps%2Franged_kdtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgarrett-scripps%2Franged_kdtree/lists"}