This project has been archived by its maintainers, and is no longer receiving any updates.
nanosearch
Nanosearch is an in-memory search engine designed for small (< 10,000 URL) websites.
With Nanosearch, you can build a search engine in a few lines of code.
Nanosearch supports the BM25 and TF/IDF algorithms.
Nanosearch 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.
Installation
pip install nanosearch
Quickstart
Build a Search Engine from a Sitemap
from nanosearch import NanoSearchBM25
engine = NanoSearchBM25().from_sitemap(
"https://jamesg.blog/sitemap.xml",
title_transforms=[lambda x: x.split("|")[0]]
)
results = engine.search("coffee")
print(results)
Build a Search Engine from a List of URLs
from nanosearch import NanoSearchBM25
urls = [
"https://jamesg.blog/",
"https://jamesg.blog/coffee",
]
engine = NanoSearchBM25().from_urls(urls)
results = engine.search("coffee")
print(results)
Save an Index to Disk
You can save an index to disk and load it later with:
engine.to_nanosearch_json("index.json")
engine = NanoSearchBM25().from_nanosearch_json("index.json")
Supported Algorithms
Nanosearch supports the following search algorithms:
- TF/IDF
- BM25
License
This project is licensed under an MIT license.
Metadata
Release files for nanosearch 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nanosearch-0.1.2.tar.gz | 6.7 kB | Without provenance | Details for nanosearch-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nanosearch-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for nanosearch-0.1.2-py3-none-any.whl |
Total release size: 14.0 kB
Release files / nanosearch-0.1.2.tar.gz
| Download URL | nanosearch-0.1.2.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c7cf5a3d8bfc0e532207c500c5753778412d53fa40cf809a2d0889ded4d5211
|
|
BLAKE2b-256 checksum How to use checksums |
00b19db4e92379d5b107df3f6dccf15ff0f10dd0d503f261287c332af89086f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / nanosearch-0.1.2-py3-none-any.whl
| Download URL | nanosearch-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2ea71c6943cb1abb0de4fa4ea8aa5c3b3fe75b0f13020b6dcc82ffadaef5cdc
|
|
BLAKE2b-256 checksum How to use checksums |
5aa949d332513c041dd8dc71718cbf6e792bfda5487924789859365403d53046
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for nanosearch 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.