A lightweight full-text search engine for Python applications.
Project description
SearchForge
A lightweight full-text search engine for Python.
SearchForge is a pure Python search library that provides fast document indexing, TF-IDF ranking, fuzzy search, autocomplete, metadata filtering, highlighted search results, persistent storage, and a simple command-line interface.
It is designed for developers who need an easy-to-integrate search engine for Python applications without external dependencies.
Installation
Install SearchForge from PyPI:
pip install searchforge
Verify the installation:
searchforge --version
Features
- Full-text document search
- Inverted index
- TF-IDF ranking
- Tokenization
- Text normalization
- Stop-word removal
- Fuzzy search
- Autocomplete suggestions
- Metadata filtering
- Highlighted search results
- Persistent document storage
- Persistent search index
- Search analytics
- Command-line interface
Quick Start
from searchforge import SearchEngine
engine = SearchEngine()
engine.add_document(
1,
"Python Django Developer"
)
engine.add_document(
2,
"FastAPI REST API Tutorial"
)
results = engine.search("python")
for result in results:
print(result.document_id)
print(result.score)
CLI
Add a document
searchforge add sample.txt
Search
searchforge search "python"
View search analytics
searchforge stats
Display version
searchforge --version
Basic Search
results = engine.search("django")
Returns a ranked list of matching documents.
Metadata Filtering
engine.add_document(
1,
"Python Django Guide",
metadata={
"category": "Programming"
}
)
results = engine.search(
"python",
filters={
"category": "Programming"
}
)
Autocomplete
engine.suggest("py")
Example output
["python", "pytest"]
Search Analytics
engine.search("python")
engine.search("python")
print(engine.popular_queries())
Example
[("python", 2)]
Project Highlights
- Pure Python implementation
- No external search server required
- Easy to integrate into existing projects
- Suitable for small to medium-sized applications
- Published on PyPI
- Command-line support included
Typical Use Cases
SearchForge can be used in:
- Django applications
- Flask applications
- FastAPI applications
- Documentation search
- Portfolio projects
- Knowledge base systems
- Blog search
- Product catalog search
- Local desktop applications
- Educational projects
Requirements
- Python 3.10 or newer
Source Code
GitHub
https://github.com/Ravikalakoti/searchforge
PyPI
https://pypi.org/project/searchforge/
Issue Tracker
https://github.com/Ravikalakoti/searchforge/issues
License
MIT License
Author
Ravi Singh Kalakoti
Python Backend Developer
GitHub: https://github.com/Ravikalakoti
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file searchforge-0.1.2.tar.gz.
File metadata
- Download URL: searchforge-0.1.2.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21cf68cb242659904e7b1c6603bac3b5878f27d6a7340e541817f76ab0af0e11
|
|
| MD5 |
e1b831ea4de13abddba5a9920cb4f3bf
|
|
| BLAKE2b-256 |
6a6b9b73e1d185e3449b757b6c42b1396c1b193b02b43971ae03c3d8fc7718f0
|
Provenance
The following attestation bundles were made for searchforge-0.1.2.tar.gz:
Publisher:
publish.yml on Ravikalakoti/searchforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
searchforge-0.1.2.tar.gz -
Subject digest:
21cf68cb242659904e7b1c6603bac3b5878f27d6a7340e541817f76ab0af0e11 - Sigstore transparency entry: 2193307948
- Sigstore integration time:
-
Permalink:
Ravikalakoti/searchforge@6efbd369bcd11444af44059b2d995ac83c707b43 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Ravikalakoti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6efbd369bcd11444af44059b2d995ac83c707b43 -
Trigger Event:
release
-
Statement type:
File details
Details for the file searchforge-0.1.2-py3-none-any.whl.
File metadata
- Download URL: searchforge-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd550598745dd2a699fdc52a4c94545f5acc3cc0ed294e3b728c5786d1928380
|
|
| MD5 |
cc8179e82a646d30b4207cdc2e35ce8d
|
|
| BLAKE2b-256 |
1345bb14ea1be7dc52073602978eccf3a0bc693e6ed22c41413f2efad0618f30
|
Provenance
The following attestation bundles were made for searchforge-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on Ravikalakoti/searchforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
searchforge-0.1.2-py3-none-any.whl -
Subject digest:
bd550598745dd2a699fdc52a4c94545f5acc3cc0ed294e3b728c5786d1928380 - Sigstore transparency entry: 2193307954
- Sigstore integration time:
-
Permalink:
Ravikalakoti/searchforge@6efbd369bcd11444af44059b2d995ac83c707b43 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Ravikalakoti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6efbd369bcd11444af44059b2d995ac83c707b43 -
Trigger Event:
release
-
Statement type: