{"id":15678847,"url":"https://github.com/capjamesg/nanosearch","last_synced_at":"2025-04-30T22:25:49.395Z","repository":{"id":241647146,"uuid":"807337700","full_name":"capjamesg/nanosearch","owner":"capjamesg","description":"Build a search engine from a website sitemap.","archived":false,"fork":false,"pushed_at":"2024-05-29T12:53:46.000Z","size":10,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-24T23:42:50.621Z","etag":null,"topics":["search-engine","web-search"],"latest_commit_sha":null,"homepage":"https://jamesg.blog/2024/05/29/nanosearch/","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/capjamesg.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":"2024-05-28T23:01:39.000Z","updated_at":"2024-12-30T22:29:47.000Z","dependencies_parsed_at":"2024-05-29T13:45:54.722Z","dependency_job_id":"9ccdf7d1-f613-4993-8d3e-09c9885acf81","html_url":"https://github.com/capjamesg/nanosearch","commit_stats":null,"previous_names":["capjamesg/nanosearch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fnanosearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fnanosearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fnanosearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fnanosearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capjamesg","download_url":"https://codeload.github.com/capjamesg/nanosearch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251790712,"owners_count":21644270,"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":["search-engine","web-search"],"created_at":"2024-10-03T16:25:08.406Z","updated_at":"2025-04-30T22:25:49.361Z","avatar_url":"https://github.com/capjamesg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nanosearch\n\nNanosearch is an in-memory search engine designed for small (\u003c 10,000 URL) websites.\n\nWith Nanosearch, you can build a search engine in a few lines of code.\n\nNanosearch supports the BM25 and TF/IDF algorithms.\n\nNanosearch also computes a link graph and uses the number of inlinks to a page as a ranking factor. This is useful for ranking results for queries where there are multiple relevant pages by keyword.\n\n## Installation\n\n```bash\npip install nanosearch\n```\n\n## Quickstart\n\n### Build a Search Engine from a Sitemap\n\n```python\nfrom nanosearch import NanoSearchBM25\n\nengine = NanoSearchBM25().from_sitemap(\n    \"https://jamesg.blog/sitemap.xml\",\n    title_transforms=[lambda x: x.split(\"|\")[0]]\n)\nresults = engine.search(\"coffee\")\n\nprint(results)\n```\n\n### Build a Search Engine from a List of URLs\n\n```python\nfrom nanosearch import NanoSearchBM25\n\nurls = [\n    \"https://jamesg.blog/\",\n    \"https://jamesg.blog/coffee\",\n]\n\nengine = NanoSearchBM25().from_urls(urls)\nresults = engine.search(\"coffee\")\n\nprint(results)\n```\n\n### Save an Index to Disk\n\nYou can save an index to disk and load it later with:\n\n```python\nengine.to_nanosearch_json(\"index.json\")\n\nengine = NanoSearchBM25().from_nanosearch_json(\"index.json\")\n```\n\n## Supported Algorithms\n\nNanosearch supports the following search algorithms:\n\n- TF/IDF\n- BM25\n\n\n## License\n\nThis project is licensed under an [MIT license](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapjamesg%2Fnanosearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapjamesg%2Fnanosearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapjamesg%2Fnanosearch/lists"}