{"id":21156369,"url":"https://github.com/vitroid/smartfind","last_synced_at":"2025-10-07T08:17:05.560Z","repository":{"id":141862248,"uuid":"191492921","full_name":"vitroid/smartfind","owner":"vitroid","description":"A smarter find function","archived":false,"fork":false,"pushed_at":"2019-06-12T08:11:21.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T15:21:29.036Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitroid.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":"2019-06-12T03:45:33.000Z","updated_at":"2019-06-12T08:11:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"b095f6a7-8750-41da-976f-f69632aafecf","html_url":"https://github.com/vitroid/smartfind","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vitroid/smartfind","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Fsmartfind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Fsmartfind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Fsmartfind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Fsmartfind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitroid","download_url":"https://codeload.github.com/vitroid/smartfind/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Fsmartfind/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278740865,"owners_count":26037487,"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-10-07T02:00:06.786Z","response_time":59,"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":[],"created_at":"2024-11-20T11:43:10.166Z","updated_at":"2025-10-07T08:17:05.530Z","avatar_url":"https://github.com/vitroid.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nA smarter find() function.\n\n* Can search multiple values.\n* Can search with a condition.\n* Always returns multiple matches.\n\n      In [1]: from smartfind import sfind\n\n      In [2]: C = [3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2,6,4,3,3,8,3,2,7,9,5,0]\n\n      In [3]: tuple(sfind(C, (1,)))\n      Out[3]: (1, 3)\n\n      In [4]: tuple(sfind(C, lambda x:x==1))\n      Out[4]: (1, 3)\n\n      In [5]: #Want the first item\n\n      In [6]: next(sfind(C, lambda x:x==1))\n      Out[6]: 1\n\n      In [7]: #Lookup multiple items\n\n      In [8]: list(sfind(C, lambda x:x in (1,3)))\n      Out[8]: [0, 1, 3, 9, 15, 17, 24, 25, 27]\n\n      In [9]: list(sfind(C, (1,3)))\n      Out[9]: [0, 1, 3, 9, 15, 17, 24, 25, 27]\n\n      In [10]: #Lookup from the bottom\n\n      In [11]: list(sfind(C, (1,3), fromend=True))\n      Out[11]: [-6, -8, -9, -16, -18, -24, -30, -32, -33]\n\n\nIn [13]: \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitroid%2Fsmartfind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitroid%2Fsmartfind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitroid%2Fsmartfind/lists"}