Show HN: Pythondocs.xyz – Live search for Python documentation (pythondocs.xyz)
Hi everyone!
I've been working on a web search interface for Python's documentation as a personal project, and I think it's ready for other people to use...
Please give it a go (and join me in praying to the server gods):
Here's the tech stack for those interested:
- Parser: Beautiful Soup + Mozilla Bleach
- Database: in-memory SQLite (aiosqlite) + SQLAlchemy
- Web server: FastAPI + Uvicorn + Jinja2
- Front end: Tailwind CSS + htmx + Alpine.js
I have ideas for future improvements but hopefully the current version is useful to someone.
Let me know what you think!
15 comments
[ 3.2 ms ] story [ 52.9 ms ] threadI mean you could use string methods to search for something of course, help just returns a string.
Then again, it's Python. There's probably some kind of
Or something among those lines, because... it always has this kind of stuffSphinx searchindex.js does Porter stemming for English and other languages: https://github.com/sphinx-doc/sphinx/blob/5.x/sphinx/search/...
sphinxcontrib.websupport.search supports Xapian, Whoosh (Python), and null: https://github.com/sphinx-doc/sphinxcontrib-websupport/blob/...
sphinx-elasticsearch https://github.com/zeitonline/sphinx_elasticsearch :
> This is a stand-alone extraction of the functionality used by readthedocs.org, compatible with elasticsearch-6.
MeiliSearch (rust) compared with ElasticSearch (java), Algolia, TypeSense (C++): https://docs.meilisearch.com/learn/what_is_meilisearch/compa...
Is there a good way to index each sphinx doc set's searchindex.js?
Feature-request: Would love auto-suggest as I type. one of my favorite example(s) is Algolia's doc search https://www.algolia.com/doc/
And great feature suggestion. I'll put it on the list.
The ordering of search results is currently very crude - it's basically just alphabetical. I plan to add "order by relevance" in the future, and I'll definitely bear capitalisation in mind.
Is there indexing for language keywords?
You can get usually get quite good results by selecting Standard Library and Definitions, though.
"is" is a special case as I currently enforce a 3 character minimum to keep the number of live search results sane.
Better search results is my next big feature. I'm thinking about "sort by relevance", improved keyword and Python language parsing, and so on.
And DevDocs is great :)
I know these links are already at the very top of most pages in the python documentation but they are easily missed and it would be good for search tools to provide a nudge to the actual source.
A related thought is that I'd like to pull out results like built-in functions and Standard Library modules to make them more prominent, and perhaps a link to the source code could be presented alongside...