Show HN: Pythondocs.xyz – Live search for Python documentation
pythondocs.xyzHi 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! Looks like it was a fun project but I prefer the flexibility of https://devdocs.io as I can keep all my framework docs searchable from one place. Also the instant lookup in DevDocs is super useful, especially for Python: https://devdocs.io/python~3.10/ I agree. And the search results are not good in pythonsocs.xyz. Although I’ve upvoted this thread. Useful comments, thanks! 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 :) This may be a weird ask but it would be great if you could provide more
emphasis to source code links for standard library results. E.g. searching
for heapq would also show a link to https://github.com/python/cpython/blob/main/Lib/heapq.py 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. That's a great, suggestion thank you. 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... Looks really nice!. 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/ Thank you! And great feature suggestion. I'll put it on the list. I tried "typeof" and "is" and results were not what I wanted. Is there indexing for language keywords? Not right now, although it's something I'm interested in adding! 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. Small feedback: I tried `Iterable` as the search term and there's no mention of `typing.Iterable` on the first page - case sensitivity may help? Very useful feedback, thank you. 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. Does python not have built in documentation search? In R I use `??searchterm`. It has help(), but I don't think there's a nice search feature included. I 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 The `pydoc` / `python -m pydoc` module doesn't do search; it would be O(n) for every search like grep without e.g. a sphinx searchindex:
https://docs.python.org/3/library/pydoc.html Sphinx 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?
Or something among those lines, because... it always has this kind of stuff import search from helpTools