{"id":19899552,"url":"https://github.com/pushshift/binary_search","last_synced_at":"2026-06-09T03:06:45.464Z","repository":{"id":102301923,"uuid":"279944559","full_name":"pushshift/binary_search","owner":"pushshift","description":"Example of a binary search implementation using real data (Reddit author info)","archived":false,"fork":false,"pushed_at":"2020-07-15T18:48:52.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T06:44:27.929Z","etag":null,"topics":["binarysearch","python3","reddit","search"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pushshift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-07-15T18:19:21.000Z","updated_at":"2020-07-15T19:01:52.000Z","dependencies_parsed_at":"2023-05-01T20:13:18.498Z","dependency_job_id":null,"html_url":"https://github.com/pushshift/binary_search","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pushshift/binary_search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushshift%2Fbinary_search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushshift%2Fbinary_search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushshift%2Fbinary_search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushshift%2Fbinary_search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pushshift","download_url":"https://codeload.github.com/pushshift/binary_search/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushshift%2Fbinary_search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34089400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":["binarysearch","python3","reddit","search"],"created_at":"2024-11-12T20:09:01.601Z","updated_at":"2026-06-09T03:06:45.459Z","avatar_url":"https://github.com/pushshift.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Binary Search implementation using Python\n\nThis code gives an example of implementing binary search using Python. This is a bare-bones example of how to implement a binary search using sorted data (Reddit Authors). Each record is 44 bytes and consists of three fields -- author name, id and the author creation time (epoch).\n\n- The first field is author and is 32 bytes in size. The author name is null padded.\n- The second field is the id of the author and is an 8 byte integer.\n- The third field is the author creation time (in epoch seconds) and is a 4 byte integer.\n\nThere are two methods in binary_search.py.\n\n- The search_record method returns the record position if a match is found or returns False if no match is found.\n- The fetch_record method fetches a record from authors.dat\n\nThis code could be further optimized by including a cache for the search and fetch methods.\n\nYou will need to download the authors.dat file from https://files.pushshift.io/reddit/authors.dat.zst. When you download the file, decompress the file and put it in the same directory as the binary_search.py script.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushshift%2Fbinary_search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpushshift%2Fbinary_search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushshift%2Fbinary_search/lists"}