I Built a Search Engine With Zero Dependencies — Just Python 3.14's Standard Library
Every modern web app eventually hits the moment it needs search. And almost universally, the playbook looks the same: pip install elasticsearch whoosh fastapi uvicorn nltk click A few minutes later you have an 80MB virtual environment, a daemon process running somewhere, network socket overhead, and a software supply chain that just grew five links longer — all to search a few hundred markdown…
In the 2026 Zero Dependency Hackathon, a Python developer set out to build a search engine using only the Python 3.14 standard library. The result is SwiftSearch, a fast, local, and embeddable search engine that requires no pip installs, external daemons, or lockfiles. The project demonstrates how to replace the usual stack of Elasticsearch, Whoosh, and other dependencies with just Python's built-in libraries.
SwiftSearch achieves full-text retrieval through the inverted index, which relies on tokenizing text and building a list of postings for each term. The engine uses collections.defaultdict to maintain postings and document frequencies in memory, enabling quick jumps to relevant postings lists during queries. This approach reduces the time required to process queries like "python backend" compared to scanning every document sequentially.
The scoring system for results is based on a transparent one-line formula: score = (title_match × 5) + (exact_match × 4) + (content_match × 2) + frequency. By ranking terms based on their presence in the title or exact matches, SwiftSearch eliminates the need for complex tuning of BM25 parameters.
A notable challenge was handling Unicode input, which typically requires specialized libraries like nltk or regex-based tokenizers. However, SwiftSearch leverages the unicodedata module from the standard library to normalize text, split it into tokens, and handle various Unicode characters without external dependencies.
Another challenge arose from the limitations of http.server, a standard library module often dismissed for production use. To build an embeddable engine, SwiftSearch had to handle both API and static content routing, as well as manage browser quirks like keydown events interfering with query strings. Despite these hurdles, the project was completed with no external dependencies, relying solely on Python's built-in libraries.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.